eclipse-basyx / basyx-java-server-sdk

MIT License
55 stars 45 forks source link

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

Open ghadaghido opened 3 months ago

ghadaghido commented 3 months ago

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"
}

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

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