Skip to content

fix: skip malformed AASX files during AAS Environment startup (#765) - #1056

Closed
mandardharurkar wants to merge 1 commit into
eclipse-basyx:mainfrom
mandardharurkar:main
Closed

fix: skip malformed AASX files during AAS Environment startup (#765)#1056
mandardharurkar wants to merge 1 commit into
eclipse-basyx:mainfrom
mandardharurkar:main

Conversation

@mandardharurkar

Copy link
Copy Markdown

Description of Changes

Wrapped the per-file AASX loading logic in AasEnvironmentPreconfigurationLoader with a try-catch block. Instead of propagating the exception and crashing the entire AAS Environment, the loader now:

  • Logs a warning with the filename and exception message
  • Skips the problematic file
  • Continues loading the remaining AAS files

This ensures a single corrupt or unsupported AASX file does not prevent the entire environment from starting.

Related Issue

#765

BaSyx Configuration for Testing

No special configuration needed. Default AAS Environment setup works.

To reproduce the original crash (before fix):

  1. Place a malformed AASX file in the preconfiguration directory
  2. Start the AAS Environment component
  3. Observe the application crash

After the fix, the same setup logs a warning and continues starting normally.

AAS Files Used for Testing

File Relevance
sample.aasx The sample file that caused the crash — used to verify it's now skipped gracefully
A valid test AASX file Confirms that valid files still load correctly alongside the corrupt one

Additional Information

  • Also applied the same try-catch pattern to AuthorizedAASEnvironmentPreconfigurationLoader since it extends the base loader and had the same vulnerability.
  • Added a unit test that places one valid + one corrupt AASX file in a temp directory and asserts the valid one loads while the corrupt one is skipped without throwing.
  • Considered adding a --strict flag to restore the old crash-on-error behavior, but decided to keep the fix minimal per the issue scope.

File Location - basyx-java-server-sdk\basyx.aasenvironment\basyx.aasenvironment-core\src\test\resources\org\eclipse\digitaltwin\basyx\aasenvironment\invalid_environment.aasx

@mandardharurkar mandardharurkar closed this by deleting the head repository Aug 29, 2026
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

Successfully merging this pull request may close these issues.

1 participant