[ https://issues.apache.org/jira/browse/SLING-11560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17585189#comment-17585189 ]
Timothee Maret commented on SLING-11560: ---------------------------------------- Thank you for reporting [~manasmaji4]. I think we'd need to allow configuring the IdConflictPolicy and set the default to LEGACY. That way we will ensure backward compatibility while allowing to test with the new default. This would need to be done in two bundles 1. [ContentPackageExtractor|https://github.com/apache/sling-org-apache-sling-distribution-journal/blob/264c4092451fe522d453c69e16ae74c0b4cec53f/src/main/java/org/apache/sling/distribution/journal/bookkeeper/ContentPackageExtractor.java#L116] 2. [VltUtils|https://github.com/apache/sling-org-apache-sling-distribution-core/blob/1511fb3844f8cb699262cb82e5b920095638587f/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/VltUtils.java#L231] [~manasmaji4] would like to contribute those changes ? > Vault error when importing a node with the same name and UUID as a > pre-existing non-sibling node > ------------------------------------------------------------------------------------------------ > > Key: SLING-11560 > URL: https://issues.apache.org/jira/browse/SLING-11560 > Project: Sling > Issue Type: Bug > Components: Content Distribution > Reporter: Manas Kumar Maji > Priority: Major > Fix For: Content Distribution Core 0.4.6 > > > 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. > {noformat} > 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] > {noformat} > *Older Behaviour:* In the older version of jackrabbit vault (3.4.6), an new > UUID would be created for the new node: > {noformat} > 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. > {noformat} > *Current Behaviour:* From the AEM author logs, it seems that the OSGi config > having the _IdConflictPolicy.LEGACY_ is not being respected by SCD: > {noformat} > 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 > {noformat} > *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. -- This message was sent by Atlassian Jira (v8.20.10#820010)