eclipse-aaspe / server

C# based server for AASX packages
Other
69 stars 51 forks source link

[Bug]: Adding Thumbnail to AssetInformation via REST Request doesn't work if Shell was created via REST API #241

Open BohnSeb opened 5 months ago

BohnSeb commented 5 months ago

Contact Details

No response

Describe the bug

If a Shell is created via REST Request, a thumbnail can't be added to the AssetInformation. { "messages": [ { "code": "InternalServerError", "correlationId": null, "messageType": "Error", "text": "AASX Package New Package not opened. Aborting!", "timestamp": "18.04.2024 13:21:06" } ] }

To reproduce

  1. Create Shell via REST Request (POST /shells): { "idShort": "123456", "id": "this-is-a-test-id", "assetInformation": { "assetKind": "Instance", "globalAssetId": "https://test-url.com/123456", "defaultThumbnail": { "path":"/aasx/thumbnails/this-is-a-test-id.png", "contentType":"image/png" } }, "modelType": "AssetAdministrationShell" }
  2. PUT Image to thumbnail (PUT /shells/dGhpcy1pcy1hLXRlc3QtaWQ=/asset-information/thumbnail): multipart/form-data: file=image.png (image.png can be the png that you want to use as the thumbnail)

Screenshots

No response

Expected Behaviour

The Thumbnail is added to the AssetAdministrationShell and displayed in webUI

Version

2023-11-17A

Operating System

Windows

Relevant log output

No Log output in Console
BohnSeb commented 4 months ago

I managed to acquire additional knowledge. Adding an Image is only possible if an aasx file for this shell is present in the data-path folder. This can be "hacked" by manually downloading the package via the GET packages/{packageId} Endpoint.

However the problem seems to be bigger. Even if you add the thumbnail successfully it doesn't get written into the aasx file in the data-path folder. This results in all images (and persumably resources in general) to be lost after a reboot of the server. Should I open a dedicated ticket for this or do you want to handle it in this one?