[MGNLREST-256] AssetReferenceResolver throws an exception when the asset key cannot be resolved Created: 18/May/20 Updated: 16/Feb/22 Resolved: 24/Jan/22 |
|
| Status: | Closed |
| Project: | Magnolia REST Framework |
| Component/s: | None |
| Affects Version/s: | 2.2 |
| Fix Version/s: | 2.2.11 |
| Type: | Bug | Priority: | Major |
| Reporter: | Adrien Manzoni | Assignee: | Chuong Doan Huy |
| Resolution: | Fixed | Votes: | 4 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | 3d 5h | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Template: |
|
||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||
| Task DoD: |
[X]*
Doc/release notes changes? Comment present?
[X]*
Downstream builds green?
[X]*
Solution information and context easily available?
[X]*
Tests
[X]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||||||
| Bug DoR: |
[X]*
Steps to reproduce, expected, and actual results filled
[X]*
Affected version filled
|
||||||||||||
| Release notes required: |
Yes
|
||||||||||||
| Date of First Response: | |||||||||||||
| Epic Link: | SPA Editor Backlog | ||||||||||||
| Sprint: | DevX 1, DevX 2 | ||||||||||||
| Story Points: | 5 | ||||||||||||
| 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. |
| Comments |
| Comment by Christopher Zimmermann [ 07/Dec/21 ] |
|
An author may not be able to recover from this situation as they can no longer edit the page in the SPA. They would need to fix or remove the node via the JCR app. |