Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-6794

oak-upgrade fails to copy nt:file node if it was previously moved

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: upgrade
    • Labels:
      None

      Description

      I'm using crx2oak to do blue-green deployments. Delta migration on certain content paths is consistently failing with the folowing error:

      06.10.2017 12:53:02.355 ERROR  c.a.g.c.e.MigrationEngine: The internal error occurred during migration. The migration process has been aborted and it is not complete!
      java.lang.RuntimeException: javax.jcr.RepositoryException: Failed to copy content
              at com.google.common.io.Closer.rethrow(Closer.java:149)
              at com.adobe.granite.crx2oak.engine.crx.CrxUpgradeEngine.migrateCrx2(CrxUpgradeEngine.java:102)
              at com.adobe.granite.crx2oak.engine.MigrationEngine$1.doMigration(MigrationEngine.java:53)
              at com.adobe.granite.crx2oak.engine.MigrationEngine.process(MigrationEngine.java:92)
              at com.adobe.granite.crx2oak.pipeline.Pipeline.run(Pipeline.java:103)
              at com.adobe.granite.crx2oak.CRX2Oak.run(CRX2Oak.java:66)
              at com.adobe.granite.crx2oak.CRX2Oak.main(CRX2Oak.java:51)
      Caused by: javax.jcr.RepositoryException: Failed to copy content
              at org.apache.jackrabbit.oak.upgrade.RepositoryUpgrade.copy(RepositoryUpgrade.java:561)
              at com.adobe.granite.crx2oak.engine.crx.CrxUpgradeEngine.upgradeFromCrx2(CrxUpgradeEngine.java:80)
              at com.adobe.granite.crx2oak.engine.crx.CrxUpgradeEngine.migrateCrx2(CrxUpgradeEngine.java:100)
              ... 5 common frames omitted
      Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: OakConstraint0030: Uniqueness constraint violated at path [/] for one of the property in [jcr:uuid] having value dce2a7ce-f0b7-45b0-a0a9-f46c1d2bddd4
              at org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditor.checkUniquenessConstraints(PropertyIndexEditor.java:319)
              at org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditor.updateIndex(PropertyIndexEditor.java:299)
              at org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditor.leave(PropertyIndexEditor.java:239)
              at org.apache.jackrabbit.oak.spi.commit.ProgressNotificationEditor.leave(ProgressNotificationEditor.java:76)
              at org.apache.jackrabbit.oak.spi.commit.VisibleEditor.leave(VisibleEditor.java:63)
              at org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:56)
              at org.apache.jackrabbit.oak.plugins.index.IndexUpdate.enter(IndexUpdate.java:169)
              at org.apache.jackrabbit.oak.spi.commit.CompositeEditor.enter(CompositeEditor.java:66)
              at org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:49)
              at org.apache.jackrabbit.oak.spi.commit.EditorHook.processCommit(EditorHook.java:55)
              at org.apache.jackrabbit.oak.upgrade.RepositoryUpgrade$LoggingCompositeHook.processCommit(RepositoryUpgrade.java:1049)
              at org.apache.jackrabbit.oak.segment.SegmentNodeStore$Commit.prepare(SegmentNodeStore.java:604)
              at org.apache.jackrabbit.oak.segment.SegmentNodeStore$Commit.optimisticMerge(SegmentNodeStore.java:634)
              at org.apache.jackrabbit.oak.segment.SegmentNodeStore$Commit.execute(SegmentNodeStore.java:690)
              at org.apache.jackrabbit.oak.segment.SegmentNodeStore.merge(SegmentNodeStore.java:334)
              at org.apache.jackrabbit.oak.spi.state.ProxyNodeStore.merge(ProxyNodeStore.java:43)
              at org.apache.jackrabbit.oak.upgrade.RepositoryUpgrade.copy(RepositoryUpgrade.java:557)
              ... 7 common frames omitted
      

      It appears to happen when an nt:file node was moved in the source repository and crx2oak is trying to copy the moved node to the destination. I was able to isolate it in a unit test, see attached.

      The steps to reproduce are:

      1. initial migration copies the nt:file node to the destination
      2. the nt:file node is moved in the source repository
      3. oak-upgrade copies the moved nt:file to the target with --merge-paths option .

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              yegor.kozlov Yegor Kozlov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: