eclipse-basyx / basyx-java-server-sdk

MIT License
55 stars 45 forks source link

[BUG] Serialization endpoint and createAASXAASEnvironmentSerialization methods unable to download and include files #353

Closed StenGruener closed 1 month ago

StenGruener commented 2 months ago

Describe the bug Both tried serialization methods fail to download/include attached files into the serialized AASX file. An exception is trown and the file content downloaded via serialization endpoint is empty.

To Reproduce Steps to reproduce the behavior:

  1. Upload attached file into aas-env (rename zip to aasx)
  2. Open ui
  3. Click on download button (null.aasx) in the aas list
  4. See error log, instpect AAS in package explorer there is no attached file

Expected behavior Files should be downloaded and included in the output.

BaSyx (please complete the following information):

Screenshots If applicable, add screenshots to help explain your problem. file-bug.zip

Used Asset Administration files (.aasx/.json/.xml) Please drop your AAS files here that were used when the bug was encountered.

Additional context Add any other context about the problem here. image image

mateusmolina-iese commented 2 months ago

Hi @StenGruener,

thanks for raising the issue. We will take a look at the provided example and get back to you.

StenGruener commented 2 months ago

@mateusmolina-iese thanks! Also, Files seem to be broken in general (looks like this is some kind of a regression, since it was fixed in 1.5) - the value contains like /tmp/filename which is not a downloadable URI I would expect as an AAS client.

aaronzi commented 2 months ago

I can also reproduce this bug when downloading an AAS as a .aasx file using the serialization endpoint.

Regarding file handling during runtime, we provide the standardized attachment endpoints for uploading/updating, downloading and deleting files from (file) submodelElements (see screenshot). image

Btw, the file is called null.aasx and causes some unexpected behaviour because you forgot to specify the idShort of the AAS ;)

StenGruener commented 2 months ago

@aaronzi thanks, but this also happens when proper AASes are loaded. So i am sure it is not based on the missing idshort, correct?

aaronzi commented 2 months ago

You are right, this also happens with any other AAS. It seems as this was never implemented.

StenGruener commented 2 months ago

any indication when/if it gonna be implemented?

aaronzi commented 2 months ago

We have added this to our backlog. I cannot give you any specifics. I will update you as soon as we have implemented this.

If you need this urgently, please send me an email so we can discuss how to proceed.

StenGruener commented 4 weeks ago

Thanks, any target milestone where binaries would be availalbe from maven? or are there some nightly builds?

aaronzi commented 4 weeks ago

You're welcome. I can't give any specifics but soon ;)

StenGruener commented 1 week ago

@aaronzi Hi Aaron, it is unfortunatelly still failing in conjunction with ConnectedSubmodelService image

https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/97f5be874fbb6fd343e618fcf21af26973d2ea87/basyx.submodelservice/basyx.submodelservice-client/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/client/ConnectedSubmodelService.java#L211

Do i see that this could whould construct the attachment url (ending with /attachment) and create a file based on that url? Any hope to get this one fixed?