rwth-iat / aas_manager

AAS Manager is an editor and viewer for Asset Administration Shells. Powered by https://github.com/eclipse-basyx/basyx-python-sdk
GNU General Public License v3.0
21 stars 7 forks source link

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

Open ZiqiangXu11 opened 7 months ago

ZiqiangXu11 commented 7 months ago

Contact Details

ziqiang.xu@omron.com

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.
zrgt commented 7 months ago

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

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

ZiqiangXu11 commented 7 months ago

@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 commented 7 months ago

@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: https://github.com/admin-shell-io/submodel-templates/issues/62

Probably you can fix the problem following these steps: