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

AssetReferenceResolver throws an exception when the asset key cannot be resolved

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.2.11
    • 2.2
    • None
    • None

    Description

      When we query a node containing a broken asset link and we try to resolve it via the AssetReferenceResolver, the system will throw an exception and therefore the rest call will return a 500 to the client.

      In the case of the SPA renderer, this will basically break the whole page in the editor.

      Ideally, the system should just return the id in case it cannot resolve it.

      Example exception:

      2021-12-07 07:55:27,077 ERROR [http-nio-8080-exec-4] magnolia.rest.reference.dam.AssetReferenceResolver {Remote-Host=85.3.97.243, User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36, environmentId=main, requesturi=/.rest/delivery/pages/v1/samplesite.com/page-4}: Unexpected error getting original rendition for s3:dam.kjo2j0x0vqxk57g4.saas.magnolia-cloud.com/samplesite.com/rasa_111234.jpg
      software.amazon.awssdk.services.s3.model.NoSuchKeyException: The specified key does not exist. (Service: S3, Status Code: 404, Request ID: D44CZTEFV8SZ7C2J, Extended Request ID: T+qHP72GmRcG2/yDyHfN+kMhu1h8G1iqZV7gPrnP+zNgS3J3B/acGCkZp3U1cUahwVjewKfjDcs=)
      	at software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleErrorResponse(AwsXmlPredicatedResponseHandler.java:156) ~[aws-xml-protocol-2.16.88.jar:?]
      	at software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleResponse(AwsXmlPredicatedResponseHandler.java:106) ~[aws-xml-protocol-2.16.88.jar:?]
      

      The solution should cover all asset providers so that none of them breaks the response.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                chuong.doan Chuong Doan Huy
                amanzoni Adrien Manzoni
                Votes:
                4 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD

                    Time Tracking

                      Estimated:
                      Original Estimate - Not Specified
                      Not Specified
                      Remaining:
                      Remaining Estimate - Not Specified
                      Not Specified
                      Logged:
                      Time Spent - 3d 5h
                      3d 5h