[MGNLREST-359] Cannot put nodes with colons in the name Created: 12/Apr/22  Updated: 14/Apr/22  Resolved: 14/Apr/22

Status: Closed
Project: Magnolia REST Framework
Component/s: None
Affects Version/s: 2.2.11
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Richard Gange Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: 6.2.16
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MGNLREST-343 Empty node name when using illegal ch... Closed
is related to MGNLDAM-1017 Endpoint for uploading assets Closed
is related to MGNLREST-349 Creating asset via rest is not possib... Closed
is related to DOCU-2430 How to add an asset with REST tutoria... Closed
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

 Description   

When trying to follow the instructions on How to add an asset with REST you find that it doesn't work anymore. Ever since this MGNLREST-343 change you cannot put a subnode with a name which has a colon. They are switched to dashes. Therefore it's impossible to upload an asset via rest since the binary subnode needs to be called "jcr:content".

Leads to these errors in the log file:

2022-04-12 18:31:38,331 WARN  info.magnolia.cms.filters.ContentTypeFilter       : Content type for http://localhost:8080/magnoliaAuthor/.rest/nodes/v1/dam/noodle-soup is not set.
2022-04-12 18:31:38,331 WARN  info.magnolia.cms.filters.ContentTypeFilter       : Response is not committed yet. Setting content type: text/html.
2022-04-12 18:31:39,319 ERROR info.magnolia.ai.image.ImageRecognitionModule     : An error occurred while trying to run image recognition
javax.jcr.PathNotFoundException: jcr:content
	at org.apache.jackrabbit.core.NodeImpl$8.perform(NodeImpl.java:2167) ~[jackrabbit-core-2.20.4.jar:2.20.4]
	at org.apache.jackrabbit.core.NodeImpl$8.perform(NodeImpl.java:2161) ~[jackrabbit-core-2.20.4.jar:2.20.4]
	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216) ~[jackrabbit-core-2.20.4.jar:2.20.4]
	at org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:91) ~[jackrabbit-core-2.20.4.jar:2.20.4]
	at org.apache.jackrabbit.core.NodeImpl.getNode(NodeImpl.java:2161) ~[jackrabbit-core-2.20.4.jar:2.20.4]
	at info.magnolia.jcr.wrapper.DelegateNodeWrapper.getNode(DelegateNodeWrapper.java:204) ~[magnolia-core-6.2.16.jar:?]
	at info.magnolia.jcr.decoration.ContentDecoratorNodeWrapper.getNode(ContentDecoratorNodeWrapper.java:151) ~[magnolia-core-6.2.16.jar:?]
	at info.magnolia.jcr.wrapper.DelegateNodeWrapper.getNode(DelegateNodeWrapper.java:204) ~[magnolia-core-6.2.16.jar:?]
	at info.magnolia.jcr.decoration.ContentDecoratorNodeWrapper.getNode(ContentDecoratorNodeWrapper.java:151) ~[magnolia-core-6.2.16.jar:?]
	at info.magnolia.jcr.wrapper.DelegateNodeWrapper.getNode(DelegateNodeWrapper.java:204) ~[magnolia-core-6.2.16.jar:?]
	at info.magnolia.jcr.decoration.ContentDecoratorNodeWrapper.getNode(ContentDecoratorNodeWrapper.java:151) ~[magnolia-core-6.2.16.jar:?]
	at info.magnolia.jcr.wrapper.DelegateNodeWrapper.getNode(DelegateNodeWrapper.java:204) ~[magnolia-core-6.2.16.jar:?]
	at info.magnolia.jcr.decoration.ContentDecoratorNodeWrapper.getNode(ContentDecoratorNodeWrapper.java:151) ~[magnolia-core-6.2.16.jar:?]
	at info.magnolia.jcr.wrapper.DelegateNodeWrapper.getNode(DelegateNodeWrapper.java:204) ~[magnolia-core-6.2.16.jar:?]
	at info.magnolia.jcr.decoration.ContentDecoratorNodeWrapper.getNode(ContentDecoratorNodeWrapper.java:151) ~[magnolia-core-6.2.16.jar:?]
	at info.magnolia.ai.image.ImageRecognitionAggregator.getBytes(ImageRecognitionAggregator.java:52) ~[magnolia-image-recognition-1.2.5.jar:?]
	at info.magnolia.ai.image.ImageRecognitionModule.runRecognition(ImageRecognitionModule.java:365) ~[magnolia-image-recognition-1.2.5.jar:?]
	at info.magnolia.ai.image.ImageRecognitionModule.lambda$instantiateEventListener$6(ImageRecognitionModule.java:352) ~[magnolia-image-recognition-1.2.5.jar:?]
	at info.magnolia.observation.DeferringEventListener$ObservationBasedDelayedExecutor$1.run(DeferringEventListener.java:102) [magnolia-core-6.2.16.jar:?]
	at info.magnolia.cms.util.DelayedExecutor$RunnableWrapper.run(DelayedExecutor.java:103) [magnolia-core-6.2.16.jar:?]
	at EDU.oswego.cs.dl.util.concurrent.ClockDaemon$RunLoop.run(Unknown Source) [concurrent-1.3.4.jar:?]
	at java.lang.Thread.run(Thread.java:834) [?:?]

Notes
This issue was introduced in Magnolia 6.2.16. You might be able to workaround the problem with a downgrade of the rest modules to 2.2.10 but that needs to be verified!

Another option is we close this ticket as "Won't fix" but instead provide a new endpoint for uploading assets which would be a lot more convenient. See MGNLDAM-1017.


Generated at Mon Feb 12 06:59:08 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.