Uploaded image for project: 'Magnolia REST Framework'
  1. Magnolia REST Framework
  2. MGNLREST-359

Cannot put nodes with colons in the name

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 2.2.11
    • None

      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.

        Acceptance criteria

              Unassigned Unassigned
              rgange Richard Gange
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD