Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Failed to open IDTA 02017-1-0_Template_Asset Interfaces Description.aasx #24

Open
ZiqiangXu11 opened this issue Apr 2, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ZiqiangXu11
Copy link

Contact Details

[email protected]

What happened?

When open published IDTA 02017-1-0_Template_Asset Interfaces Description.aasx from IDTA, an error happened.

Relevant log output

Following is the detail error message.
---------------------------------------------
Traceback (most recent call last):
  File "basyx\aas\adapter\aasx.py", line 142, in read_into
IndexError: list index out of range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "aas_editor\widgets\treeview_pack.py", line 496, in openPack
  File "aas_editor\package.py", line 35, in __init__
  File "aas_editor\package.py", line 84, in _read
  File "basyx\aas\adapter\aasx.py", line 144, in read_into
ValueError: Not a valid AASX file: aasx-origin Relationship is missing.
@ZiqiangXu11 ZiqiangXu11 added the bug Something isn't working label Apr 2, 2024
@zrgt
Copy link
Collaborator

zrgt commented Apr 12, 2024

@ZiqiangXu11 Sorry for the long response. I guess the problem occures because of the bug in submodel-template aasx file referenced here: eclipse-aaspe/package-explorer#161

There is a tool which can fix the problem: https://github.com/LukasBenner/AASFix

@zrgt zrgt closed this as completed Apr 18, 2024
@ZiqiangXu11
Copy link
Author

@zrgt
Hi, thanks for looking into this issue.
After fixing the AID submodel template by AASFix, error still happened when open it by AASManager.


Traceback (most recent call last):
File "basyx\aas\adapter\xml\xml_deserialization.py", line 287, in _failsafe_construct
File "basyx\aas\adapter\xml\xml_deserialization.py", line 722, in construct_submodel_element
File "basyx\aas\adapter\xml\xml_deserialization.py", line 959, in construct_submodel_element_list
File "", line 1099, in extend
File "", line 1078, in append
File "basyx\aas\model\base.py", line 2105, in insert
File "basyx\aas\model\base.py", line 1886, in add
File "basyx\aas\model\base.py", line 1926, in _execute_item_add_hook
File "basyx\aas\model\submodel.py", line 760, in _check_constraints
basyx.aas.model.base.AASConstraintViolation: All first level elements must be of the type specified in type_value_list_element=SubmodelElement, got ReferenceElement (Constraint AASd-108)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "basyx\aas\adapter\xml\xml_deserialization.py", line 287, in _failsafe_construct
File "basyx\aas\adapter\xml\xml_deserialization.py", line 722, in construct_submodel_element
File "basyx\aas\adapter\xml\xml_deserialization.py", line 931, in construct_submodel_element_collection
File "basyx\aas\adapter\xml\xml_deserialization.py", line 333, in _failsafe_construct_multiple
File "basyx\aas\adapter\xml\xml_deserialization.py", line 291, in _failsafe_construct
ValueError: Failed to construct {https://admin-shell.io/aas/3/0}submodelElementList on line 235 using construct_submodel_element!

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "basyx\aas\adapter\xml\xml_deserialization.py", line 287, in _failsafe_construct
File "basyx\aas\adapter\xml\xml_deserialization.py", line 722, in construct_submodel_element
File "basyx\aas\adapter\xml\xml_deserialization.py", line 931, in construct_submodel_element_collection
File "basyx\aas\adapter\xml\xml_deserialization.py", line 333, in _failsafe_construct_multiple
File "basyx\aas\adapter\xml\xml_deserialization.py", line 291, in _failsafe_construct
ValueError: Failed to construct {https://admin-shell.io/aas/3/0}submodelElementCollection on line 171 using construct_submodel_element!

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "basyx\aas\adapter\xml\xml_deserialization.py", line 287, in _failsafe_construct
File "basyx\aas\adapter\xml\xml_deserialization.py", line 1033, in construct_submodel
File "basyx\aas\adapter\xml\xml_deserialization.py", line 333, in _failsafe_construct_multiple
File "basyx\aas\adapter\xml\xml_deserialization.py", line 291, in _failsafe_construct
ValueError: Failed to construct {https://admin-shell.io/aas/3/0}submodelElementCollection on line 47 using construct_submodel_element!

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "aas_editor\widgets\treeview_pack.py", line 496, in openPack
File "aas_editor\package.py", line 35, in init
File "aas_editor\package.py", line 84, in _read
File "basyx\aas\adapter\aasx.py", line 151, in read_into
File "basyx\aas\adapter\aasx.py", line 194, in _read_aas_part_into
File "basyx\aas\adapter\aasx.py", line 224, in _parse_aas_part
File "basyx\aas\adapter\xml\xml_deserialization.py", line 1471, in read_aas_xml_file
File "basyx\aas\adapter\xml\xml_deserialization.py", line 1438, in read_aas_xml_file_into
File "basyx\aas\adapter\xml\xml_deserialization.py", line 333, in _failsafe_construct_multiple
File "basyx\aas\adapter\xml\xml_deserialization.py", line 291, in _failsafe_construct
ValueError: Failed to construct {https://admin-shell.io/aas/3/0}submodel on line 27 using construct_submodel!

@zrgt
Copy link
Collaborator

zrgt commented Apr 19, 2024

@ZiqiangXu11

Unfortunately the bug is still on the side of submodel-template. It violates some constraint and that'why AAS Manager can not construct the submodel.

I have already opened the issue for the template here: admin-shell-io/submodel-templates#62

Probably you can fix the problem following these steps:

  • open AASX file with some Archive programm (e.g. WINrar)
  • open file \aasx\AAS_Template_for_AID\AAS_Template_for_AID.aas.xml in archive
  • replace "SubmodelElement" with "ReferenceElement" on line 2706.
  • Save changes

@zrgt zrgt reopened this Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants