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

Issue : Unexpected Error 500 Occurred After using Blob input #312

Open
ghadaghido opened this issue Jun 13, 2024 · 1 comment
Open

Issue : Unexpected Error 500 Occurred After using Blob input #312

ghadaghido opened this issue Jun 13, 2024 · 1 comment

Comments

@ghadaghido
Copy link

Description

We have encountered an "Error 500" on our application after the recent update. This error prevents users from accessing the application properly. Attached are two screenshots: one showing the error in Basyx UI and another showing Postman.

I am trying to use an invokable operation for a Blob input in my Submodel using Basyx UI:

The inputs are like this ("value": "base64 encoded of the JSON file of the submodel"):

{
  "modelType": "Blob",
  "contentType": "application/json",
  "idShort": "aasFile",
  "value": "ewogICJhc3NldEFkbWluaXN0cmF0aW9uU2hlbGxzIjogWwogICAgewogICAgICAiYXNzZXRJbmZvcm1hdGlvbiI6IHsKICAgICAgICAiYXNzZXRLaW5kIjogIklOU1RBTkNFIiwKICAgICAgICAiYXNzZXRUeXBlIjogbnVsbCwKICAgICAgICAiZGVmYXVsdFRodW1ibmFpbCI6IHsKICAgICAgICAgICJjb250ZW50VHlwZSI6ICJpbWFnZS9qcGciLAogICAgICAgICAgInBhdGgiOi"
}
  • Error 500 Screenshot:
    error500

  • The error snippet is:

    java.lang.ClassCastException: class org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBlob cannot be cast to class org.eclipse.digitaltwin.aas4j.v3.model.Property (org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBlob and org
    .eclipse.digitaltwin.aas4j.v3.model.Property are in unnamed module of loader org.springframework.boot.loader.LaunchedURLClassLoader @4dd8dc3)
        at org.eclipse.digitaltwin.basyx.TestOrchestrator.SubmodelFactory.creation(SubmodelFactory.java:76) ~[classes!/:1.0-SNAPSHOT]
        at org.eclipse.digitaltwin.basyx.InvokableOperation.invoke(InvokableOperation.java:51) ~[basyx.submodelservice-core-2.0.0-milestone-02.jar!/:2.0.0-milestone-02]
        at org.eclipse.digitaltwin.basyx.submodelservice.InMemorySubmodelService.invokeOperation(InMemorySubmodelService.java:218) ~[basyx.submodelservice-backend-inmemory-2.0.0-milestone-02.jar!/:2.0.0-milestone-02]
        at org.eclipse.digitaltwin.basyx.submodelrepository.backend.CrudSubmodelRepository.invokeOperation(CrudSubmodelRepository.java:243) ~[basyx.submodelrepository-backend-2.0.0-milestone-02.jar!/:2.0.0-milestone-02]
        at org.eclipse.digitaltwin.basyx.submodelrepository.feature.registry.integration.RegistryIntegrationSubmodelRepository.invokeOperation(RegistryIntegrationSubmodelRepository.java:142) ~[basyx.submodelrepository-feature-re
    gistry-integration-2.0.0-milestone-02.jar!/:2.0.0-milestone-02]
    

Steps Taken

But when I test with Postman, it shows no error:
postman

Possible Causes

Seems the problem might be in my docker-compose.yml file:

version: '3'
services:
  # TestOrchestrator Service
  testorchestrator:
    build:
      context: .
      dockerfile: Dockerfile.testorchestrator
    container_name: testorchestrator
    ports:
      - "8082:8082"
    volumes:
      - ./src/main/resources/application.properties:/app/application.properties
    depends_on:
      - shell-registry
      - submodel-registry

  # AAS Environment
  aas-environment:
    image: eclipsebasyx/aas-environment:2.0.0-milestone-02
    container_name: aas-environment
    volumes:
      - ./basyx/aas-env.properties:/application/application.properties
      - ./aas:/application/aas
    ports:
      - 9081:8081
    restart: always
    depends_on:
      shell-registry:
        condition: service_healthy
      submodel-registry:
        condition: service_healthy

  # AAS Registry
  shell-registry:
    image: eclipsebasyx/aas-registry-log-mem:2.0.0-milestone-02
    container_name: shell-registry
    ports:
      - 9082:8080
    volumes:
      - ./basyx/aas-registry.yml:/workspace/config/application.yml
    restart: always

  # Submodel Registry
  submodel-registry:
    image: eclipsebasyx/submodel-registry-log-mem:2.0.0-milestone-02
    container_name: submodel-registry
    ports:
      - 9083:8080
    volumes:
      - ./basyx/sm-registry.yml:/workspace/config/application.yml
    restart: always

  # AAS Discovery
  shell-discovery:
    image: eclipsebasyx/aas-discovery:2.0.0-milestone-02
    container_name: shell-discovery
    ports:
      - 9084:8081
    volumes:
      - ./basyx/aas-discovery.properties:/application/application.properties
    restart: always

  # AAS Web UI
  aas-web-ui:
    image: aaronzi/basyx-aas-ui:SNAPSHOT_12
    container_name: aas-web-ui
    ports:
      - "9080:3000"
    environment:
      AAS_DISCOVERY_PATH: "http://localhost:9084/lookup/shells"
      AAS_REGISTRY_PATH: "http://localhost:9082/shell-descriptors"
      SUBMODEL_REGISTRY_PATH: "http://localhost:9083/submodel-descriptors"
      AAS_REPO_PATH: "http://localhost:9081/shells"
      SUBMODEL_REPO_PATH: "http://localhost:9081/submodels"
      CD_REPO_PATH: "http://localhost:9081/concept-descriptions"
      PRIMARY_COLOR: "#76b900"
      LOGO_PATH: "/Logo/HTW.svg"
    volumes:
      - ./logo:/usr/src/app/dist/Logo
    restart: always
    depends_on:
      aas-environment:
        condition: service_healthy

Expected Behavior

The application should function normally, and users should be able to input Blob data without encountering any server errors.
expected

Actual Behavior

After adding the value, it displays an "Error 500" page, preventing access.

@aaronzi
Copy link
Member

aaronzi commented Jun 18, 2024

Hi @ghadaghido.
Thank you for submitting the issue and providing a detailed description. We will look into it and get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants