Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-11560

Vault error when importing a node with the same name and UUID as a pre-existing non-sibling node

    XMLWordPrintableJSON

Details

    Description

      The latest version of org.apache.jackrabbit.vault (3.6.1.T20220805092633-0b8a2641) is throwing an exception when trying to install a content package (via SCD), which has a node with the same name and UUID as an existing non-sibling node.

      Caused by: javax.jcr.ReferentialIntegrityException: Node identifier Optional[df89c4d9-6d47-480a-af2d-1bffa49bc5d1] already taken by node /content/dam/test/SYEW0105.JPG
          at org.apache.jackrabbit.vault.fs.impl.io.DocViewImporter.addNode(DocViewImporter.java:862) [org.apache.jackrabbit.vault:3.6.1.T20220805092633-0b8a2641]
          at org.apache.jackrabbit.vault.fs.impl.io.DocViewImporter.startDocViewNode(DocViewImporter.java:405) [org.apache.jackrabbit.vault:3.6.1.T20220805092633-0b8a2641]
          at org.apache.jackrabbit.vault.fs.impl.io.DocViewSAXHandler.startElement(DocViewSAXHandler.java:348) [org.apache.jackrabbit.vault:3.6.1.T20220805092633-0b8a2641]
      

      Older Behaviour: In the older version of jackrabbit vault (3.4.6), an new UUID would be created for the new node:

      17.08.2022 17:37:00.739 *WARN* [qtp1778855870-1811] org.apache.jackrabbit.vault.fs.impl.io.DocViewSAXImporter Packaged node at /content/dam/hunting/SYEW0105.JPG is referenceable and collides with existing node at /content/dam/test/SYEW0105.JPG. Will create new UUID.
      

      Current Behaviour: From the AEM author logs, it seems that the OSGi config having the IdConflictPolicy.LEGACY is not being respected by SCD:

      24.08.2022 15:10:45.799 *WARN* [qtp1859723769-86] org.apache.jackrabbit.vault.fs.impl.io.DocViewImporter Node Collision: To-be imported node /content/dam/hunting/SYEW0105.JPG uses a node identifier Optional[df89c4d9-6d47-480a-af2d-1bffa49bc5d1] which is already taken by /content/dam/test/SYEW0105.JPG, trying to resolve conflict according to policy FAIL
      

      Expected Behaviour: SCD should take the IdConflictPolicy into consideration when installing the content packages. So if IdConflictPolicy.LEGACY is set, then a new UUID should be generated for the new node.

      Attachments

        Issue Links

          Activity

            People

              marett Timothee Maret
              manasmaji4 Manas Kumar Maji
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 4h 50m
                  4h 50m