[MGNLCI-29] An import of a node whose path already exists will fail if createTasks=never Created: 15/Sep/20  Updated: 14/Apr/21

Status: Selected
Project: Content Importer
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Christopher Zimmermann Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: XML File config.modules.ui-admincentral.virtualUriMappings.default.xml    
Issue Links:
Relates
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: Content Importer Obstacles

 Description   

Note: this problem was noticed with the content-importer feature, but it appears the problem could be in Magnolia (because the feature was working in 6.2.2 but stopped in 6.2.3)

Attempting to use the content-import feature to import a bootstrap file which should replace an existing node (they have the same path) fails with an error if the bootstrap file has no UUID. If the bootstrap file has the same UUID as the target node, then it succeeds.

To reproduce:

  • Configure the content importer to import files from a local directory. 
  • Configure it to use `createTasks=never`
  • Validate 'always' and 'on-change'

For example, add this to magnolia.properties:

magnolia.content.bootstrap.dir=${magnolia.home}/../../../content-importer
magnolia.content.bootstrap.createTasks=never

(See https://documentation.magnolia-cms.com/display/DOCS62/Content+Importer+module)

  • Put the bootstrap file in the directory (file is attached to this ticket.)
  • Start magnolia.
  • Note the error in the logs and that the content was not bootstrapped.

 

Can't start module content-importerjava.lang.RuntimeException: Error importing /Users/cz/Documents/a-projects/testing/6.2.3-import-test/website-spa-demo-releases/apache-tomcat/webapps/magnoliaPublic/../../../content-importer/public/config.modules.ui-admincentral.virtualUriMappings.default.xml: Same name sibling not allowed for node /modules/ui-admincentral/virtualUriMappings/default by definition *

 

2020-09-15 12:28:54,754 INFO  gnolia.content.observer.TaskCreatorWatcherCallback: New file detected at '/Users/cz/Documents/a-projects/testing/6.2.3-import-test/website-spa-demo-releases/apache-tomcat/webapps/magnoliaPublic/../../../content-importer/public/config.modules.ui-admincentral.virtualUriMappings.default.xml', bootstrapping. 2020-09-15 12:28:54,757 ERROR info.magnolia.module.ModuleManagerImpl            : Can't start module content-importerjava.lang.RuntimeException: Error importing /Users/cz/Documents/a-projects/testing/6.2.3-import-test/website-spa-demo-releases/apache-tomcat/webapps/magnoliaPublic/../../../content-importer/public/config.modules.ui-admincentral.virtualUriMappings.default.xml: Same name sibling not allowed for node /modules/ui-admincentral/virtualUriMappings/default by definition * (declaring type mgnl:content)    at info.magnolia.importexport.DataTransporter.importXmlStream(DataTransporter.java:409) ~[magnolia-core-6.2.3.jar:?]    at info.magnolia.importexport.DataTransporter.importXmlStream(DataTransporter.java:266) ~[magnolia-core-6.2.3.jar:?]    at info.magnolia.importexport.DataTransporter.importFile(DataTransporter.java:191) ~[magnolia-core-6.2.3.jar:?]    at info.magnolia.importexport.DataTransporter.executeBootstrapImport(DataTransporter.java:218) ~[magnolia-core-6.2.3.jar:?]    at info.magnolia.content.observer.TaskCreatorWatcherCallback.process(TaskCreatorWatcherCallback.java:178) ~[magnolia-content-importer-1.0.4.jar:?]    at info.magnolia.content.observer.TaskCreatorWatcherCallback.added(TaskCreatorWatcherCallback.java:141) ~[magnolia-content-importer-1.0.4.jar:?]    at info.magnolia.content.observer.ContentImporterModule$1.visitFile(ContentImporterModule.java:124) ~[magnolia-content-importer-1.0.4.jar:?]    at info.magnolia.content.observer.ContentImporterModule$1.visitFile(ContentImporterModule.java:120) ~[magnolia-content-importer-1.0.4.jar:?]    at java.nio.file.Files.walkFileTree(Files.java:2670) ~[?:1.8.0_151]


 Comments   
Comment by Espen Jervidalo [ 18/Sep/20 ]

Whether this is a bug is for me debatable. The use-case that this tries to open up is to override existing data by loading new content into it. I would consider throwing an exception the expected behavior. Instead of patching this, the original usecase should be fixed:

Enable different virtualURIMapping per instance type (author/public) by using light development.

Comment by Christopher Zimmermann [ 29/Sep/20 ]

This ticket is not about virtualURIMapping, its about fixing the features of the content importer.

The "createTasks=never" bootstrapping feature needs to work as documented. This optional feature is for develoers who want to ensure certain content is imported. If developers do not want this behaviour they can use the "onchange" which will then not import automatically if the node already exists - it creates a task instead. Or "always", which is the default.

https://documentation.magnolia-cms.com/display/DOCS62/Content+Importer+module

Generated at Mon Feb 12 00:22:43 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.