eclipse-basyx / basyx-java-server-sdk

MIT License
59 stars 46 forks source link

[BUG] AASX cannot be viewed in AASXPackageExplorer after downloading with AAS-Web-UI #510

Open JBlezi opened 2 weeks ago

JBlezi commented 2 weeks ago

Describe the bug When downloading an AASX from the basyx docker aas-environment-v3 using the aas-web-ui it cannot be viewed in the AasxPackageExplorer. The issue seems to be the addition of a valueId tag, that creates the error.

After I manually deleted the valueId tag, the shell can be viewed in the AasxPackageExplorer without a problem.

This is the error in the AasxPackageExplorer logs:

Error: while receiving file drop to window: PackageCentral: while performing load from Z:\Users\juliusblezinger\Downloads\Murrelektronik_556613_AAS.aasx at \PackageCentral.cs:line 83 gave: One or more errors occurred. (While opening aasx C:\users\juliusblezinger\Temp\tmpf406.aasx from source local file: Z:\Users\juliusblezinger\Downloads\Murrelektronik_556613_AAS.aasx buffered to: C:\users\juliusblezinger\Temp\tmpf406.aasx at \AdminShellPackageEnv.cs:line 491 gave: While reading the AASX C:\users\juliusblezinger\Temp\tmpf406.aasx at \AdminShellPackageEnv.cs:line 481 gave: While reading spec from the AASX C:\users\juliusblezinger\Temp\tmpf406.aasx at \xmlization.cs:line 20625 gave: The required property Keys has not been given in the XML representation of an instance of class Reference at: submodels/*[1]/submodelElements/*[7]/valueId) PackageCentral: while performing load from Z:\Users\juliusblezinger\Downloads\Murrelektronik_556613_AAS.aasx at \PackageCentral.cs:line 83 gave: One or more errors occurred. (While opening aasx C:\users\juliusblezinger\Temp\tmpf406.aasx from source local file: Z:\Users\juliusblezinger\Downloads\Murrelektronik_556613_AAS.aasx buffered to: C:\users\juliusblezinger\Temp\tmpf406.aasx at \AdminShellPackageEnv.cs:line 491 gave: While reading the AASX C:\users\juliusblezinger\Temp\tmpf406.aasx at \AdminShellPackageEnv.cs:line 481 gave: While reading spec from the AASX C:\users\juliusblezinger\Temp\tmpf406.aasx at \xmlization.cs:line 20625 gave: The required property Keys has not been given in the XML representation of an instance of class Reference at: submodels/*[1]/submodelElements/*[7]/valueId)
InnerException: One or more errors occurred. (While opening aasx C:\users\juliusblezinger\Temp\tmpf406.aasx from source local file: Z:\Users\juliusblezinger\Downloads\Murrelektronik_556613_AAS.aasx buffered to: C:\users\juliusblezinger\Temp\tmpf406.aasx at \AdminShellPackageEnv.cs:line 491 gave: While reading the AASX C:\users\juliusblezinger\Temp\tmpf406.aasx at \AdminShellPackageEnv.cs:line 481 gave: While reading spec from the AASX C:\users\juliusblezinger\Temp\tmpf406.aasx at \xmlization.cs:line 20625 gave: The required property Keys has not been given in the XML representation of an instance of class Reference at: submodels/*[1]/submodelElements/*[7]/valueId)
InnerException: While opening aasx C:\users\juliusblezinger\Temp\tmpf406.aasx from source local file: Z:\Users\juliusblezinger\Downloads\Murrelektronik_556613_AAS.aasx buffered to: C:\users\juliusblezinger\Temp\tmpf406.aasx at \AdminShellPackageEnv.cs:line 491 gave: While reading the AASX C:\users\juliusblezinger\Temp\tmpf406.aasx at \AdminShellPackageEnv.cs:line 481 gave: While reading spec from the AASX C:\users\juliusblezinger\Temp\tmpf406.aasx at \xmlization.cs:line 20625 gave: The required property Keys has not been given in the XML representation of an instance of class Reference at: submodels/*[1]/submodelElements/*[7]/valueId at    at AasxPackageLogic.PackageCentral.PackageCentralItem.Load(PackageCentral packageCentral, String location, String fullItemLocation, Boolean overrideLoadResident, PackageContainerOptionsBase containerOptions, PackCntRuntimeOptions runtimeOptions) in D:\a\aasx-package-explorer\aasx-package-explorer\src\AasxPackageLogic\PackageCentral\PackageCentral.cs:line 102
   at AasxPackageExplorer.MainWindow.UiLoadPackageWithNew(PackageCentralItem packItem, AdminShellPackageEnv takeOverEnv, String loadLocalFilename, String info, Boolean onlyAuxiliary, Boolean doNotNavigateAfterLoaded, PackageContainerBase takeOverContainer, String storeFnToLRU, Boolean indexItems) in D:\a\aasx-package-explorer\aasx-package-explorer\src\AasxPackageExplorer\MainWindow.xaml.cs:line 376
   at AasxPackageExplorer.MainWindow.Window_Drop(Object sender, DragEventArgs e) in D:\a\aasx-package-explorer\aasx-package-explorer\src\AasxPackageExplorer\MainWindow.xaml.cs:line 3364.Inner message: One or more errors occurred. (While opening aasx C:\users\juliusblezinger\Temp\tmpf406.aasx from source local file: Z:\Users\juliusblezinger\Downloads\Murrelektronik_556613_AAS.aasx buffered to: C:\users\juliusblezinger\Temp\tmpf406.aasx at \AdminShellPackageEnv.cs:line 491 gave: While reading the AASX C:\users\juliusblezinger\Temp\tmpf406.aasx at \AdminShellPackageEnv.cs:line 481 gave: While reading spec from the AASX C:\users\juliusblezinger\Temp\tmpf406.aasx at \xmlization.cs:line 20625 gave: The required property Keys has not been given in the XML representation of an instance of class Reference at: submodels/*[1]/submodelElements/*[7]/valueId)
Inner message: While opening aasx C:\users\juliusblezinger\Temp\tmpf406.aasx from source local file: Z:\Users\juliusblezinger\Downloads\Murrelektronik_556613_AAS.aasx buffered to: C:\users\juliusblezinger\Temp\tmpf406.aasx at \AdminShellPackageEnv.cs:line 491 gave: While reading the AASX C:\users\juliusblezinger\Temp\tmpf406.aasx at \AdminShellPackageEnv.cs:line 481 gave: While reading spec from the AASX C:\users\juliusblezinger\Temp\tmpf406.aasx at \xmlization.cs:line 20625 gave: The required property Keys has not been given in the XML representation of an instance of class Reference at: submodels/*[1]/submodelElements/*[7]/valueId

To Reproduce

  1. Upload an AASX via /upload endpoint
  2. Add discovery entry via POST request to /lookup/shells endpoint
  3. go to web ui on port 3000
  4. Click on download AASX
  5. Try to open downloaded AASX in AasxPackageExplorer

Expected behavior Downloaded AASX should be viewable after download without any further modifications

BaSyx (please complete the following information):

Screenshots If applicable, add screenshots to help explain your problem.

Used Asset Administration files (.aasx/.json/.xml) Any file

BaSyx configuration

version: "3.7"

services:
  mongodb:
    image: mongo:5.0.10
    volumes:
      - mongodb-data-version-5.0.10:/data/db
    container_name: mongodb-aasreg-smreg-v3
    environment:
      MONGO_INITDB_ROOT_USERNAME: admin
      MONGO_INITDB_ROOT_PASSWORD: admin
      MONGODB_EXTRA_FLAGS: --wiredTigerCacheSizeGB=2
    deploy:
      resources:
        limits:
          memory: 4G
        reservations:
          memory: 2G
    ports:
      - 27017:27017
    healthcheck:
      test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s
    logging:
      driver: "json-file"
      options:
        max-size: "1g"
        max-file: "3"

  aas-registry-service:
    image: eclipsebasyx/aas-registry-log-mongodb:2.0.0-SNAPSHOT
    container_name:  aas-registry-v3
    environment:
      SPRING_DATA_MONGODB_URI: mongodb://admin:admin@mongodb:27017
      BASYX_CORS_ALLOWED_METHODS: GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD
      BASYX_CORS_ALLOWED_ORIGINS: "*"
    ports:
      - 8050:8080
    depends_on:
      - mongodb
    restart: always

  submodel-registry-service:
    image: eclipsebasyx/submodel-registry-log-mongodb:2.0.0-SNAPSHOT
    container_name:  submodel-registry-v3
    # pull_policy: never
    environment:
      SPRING_DATA_MONGODB_URI: mongodb://admin:admin@mongodb:27017
      BASYX_CORS_ALLOWED_METHODS: GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD
      BASYX_CORS_ALLOWED_ORIGINS: "*"
    ports:
      - 8051:8080
    depends_on:
      - mongodb
    restart: always

  aas-environment-service:
    image: eclipsebasyx/aas-environment:2.0.0-SNAPSHOT
    volumes:
    - ./application.properties:/application/application.properties
    container_name:  aas-environment-v3
    # pull_policy: never
    ports:
      - 8082:8081
    environment:
      BASYX_CORS_ALLOWED_METHODS: GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD
      BASYX_CORS_ALLOWED_ORIGINS: "*"
      BASYX_AASREPOSITORY_FEATURE_REGISTRYINTEGRATION: http://aas-registry-service:8080 # <--- to register the AAS in the AAS registry
      BASYX_EXTERNALURL: http://localhost:8082 # <--- to create the connection from the registry to the environment
      BASYX_SUBMODELREPOSITORY_FEATURE_REGISTRYINTEGRATION: http://submodel-registry-service:8080 # <--- to register the submodels in the submodel registry
    depends_on:
      - mongodb
    restart: always

  aas-web-ui:
      image: eclipsebasyx/aas-gui:v2-241006
      container_name: aas-web-ui
      ports:
          - "3000:3000"
      environment:
          AAS_REGISTRY_PATH: "http://localhost:8050"
          SUBMODEL_REGISTRY_PATH: "http://localhost:8051"
          AAS_DISCOVERY_PATH: "http://localhost:8083"
          AAS_REPO_PATH: "http://localhost:8082/shells"
          SUBMODEL_REPO_PATH: "http://localhost:8082/submodels"
          CD_REPO_PATH: "http://localhost:8082/concept-descriptions"
          # DASHBOARD_SERVICE_PATH: "<dashboard_service_path>" (optional; Time Series Data)
          # PRIMARY_COLOR: "<primary_color>" (optional; Corporate Design)
          # LOGO_PATH: "<logo_path_in_container>" (optional; Corporate Design)
          # BASE_PATH: "<base_path>" (optional)
          # INFLUXDB_TOKEN: "<influxdb_token>" (optional; Time Series Data)
          # KEYCLOAK_URL: "<keycloak_url>" (optional; RBAC feature)
          # KEYCLOAK_REALM: "<keycloak_realm>" (optional; RBAC feature)
          # KEYCLOAK_CLIENT_ID: "<keycloak_client_id>" (optional; RBAC feature)
      depends_on:
        - aas-environment-service

  aas-discovery-service:
    image: eclipsebasyx/aas-discovery:2.0.0-SNAPSHOT
    container_name: aas-discovery-service
    volumes:
      - ./application.properties:/application/application.properties
    ports:
      - 8083:8081
    environment:
      BASYX_CORS_ALLOWED_METHODS: GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD
      BASYX_CORS_ALLOWED_ORIGINS: "*"
    depends_on:
      - mongodb
      - aas-environment-service
      - aas-registry-service
      - submodel-registry-service
    restart: always

volumes:
   mongodb-data-version-5.0.10:
      driver: local

System (please complete the following information):

Additional context Add any other context about the problem here.

mdanish98 commented 2 weeks ago

Hi @JBlezi

Thanks for raising this issue. Could you also please update the AASXPackageExplorer version?

JBlezi commented 2 weeks ago

I just added the version of AASXPackageExplorer under Basyx @mdanish98