Skip to content

Fix Submodel registry unlink swallowing Registry failures - #1077

Merged
aaronzi merged 2 commits into
eclipse-basyx:mainfrom
aaronzi:fix/1076-submodel-registry-unlink
Oct 22, 2026
Merged

aaronzi merged 2 commits into
eclipse-basyx:mainfrom
aaronzi:fix/1076-submodel-registry-unlink

Conversation

@aaronzi

@aaronzi aaronzi commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Pull Request Template

Description of Changes

With registry integration enabled, DELETE /submodels/{id} returned 204 when the Submodel Registry could not be reached. Before deleting, the integration checked whether the descriptor existed, and that check treated every ApiException as "does not exist". A connection failure or a 5xx response therefore skipped the Registry DELETE. The Submodel was then deleted locally and its descriptor stayed in the Registry.

This applies the change #1034 made on the AAS side:

  • Submodel deletion calls deleteSubmodelDescriptorById directly, with no existence check first.
  • Only HTTP 404 counts as "already absent". The deletion goes ahead and an info message is logged.
  • Any other Registry failure throws RepositoryRegistryUnlinkException and keeps the local Submodel. That includes transport errors (code 0), 5xx responses and 403. BaSyxExceptionHandler maps the exception to 500, which is how DELETE /shells/{id} already behaves.
  • The exception message now includes the HTTP status and the response body, or the cause message when there is no body.

The feature README now describes what happens on a failure.

Related Issue

Closes #1076

BaSyx Configuration for Testing

The new unit tests need no special configuration. They use the in-memory backend and a mocked SubmodelRegistryApi.

The existing service-backed integration tests run unchanged, using the default, multiurl and authregistry profiles.

AAS Files Used for Testing

None. The unit tests create their Submodels in code.

Additional Information

New RegistryIntegrationSubmodelRepositoryTest covers four cases:

  • A successful delete removes the descriptor and never reads it first.
  • A 404 from the Registry still deletes the Submodel.
  • A 503 keeps the Submodel and reports the status and response body.
  • An unreachable Registry (connection refused) keeps the Submodel.

On the old code all four tests fail (3 failures, 1 error). With the fix they all pass.

Validation performed:

  • mvn -pl basyx.submodelrepository/basyx.submodelrepository-feature-registry-integration -Dtest=RegistryIntegrationSubmodelRepositoryTest test

Not part of this PR: as the issue notes, updateSubmodel still doesn't sync the descriptor to the Registry.

CI fix: MongoDB image pinned to 8.2.12

A second commit fixes CI failures that also affect main. They have nothing to do with the change above. The ubuntu-24.04 runner image moved from kernel 6.17 to a newer one. On Linux kernel 6.19 and later, mongo:8 (currently 8.3.13) and mongo:8.0 exit at startup with "MongoDB cannot start: Linux kernel versions 6.19 and newer has a known incompatibility" (SERVER-121912). As a result, every MongoDB-backed job failed with container mongo is unhealthy. mongo:8.2.12 starts and passes the existing healthcheck, so all 15 compose files that used mongo:8 now pin it, including the examples and the registry dev setups. It can go back to a floating tag once MongoDB ships the TCMalloc fix.

Submodel deletion no longer checks for the descriptor first. It calls the
Registry DELETE directly, treats only 404 as already absent, and keeps the
local Submodel for every other Registry failure, matching the AAS
Repository behavior from eclipse-basyx#1034.

Closes eclipse-basyx#1076
The GitHub ubuntu-24.04 runner image moved to a Linux kernel >= 6.19.
mongo:8 (now 8.3.13) and 8.0 refuse to start on such kernels
(SERVER-121912), so every MongoDB-backed CI job failed with an unhealthy
mongo container. 8.2.12 starts and passes the existing healthcheck.
@aaronzi
aaronzi merged commit 5dec385 into eclipse-basyx:main Oct 22, 2026
66 of 68 checks passed
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.

[BUG] Registry integration: DELETE /submodels/{id} answers 204 but the Submodel Registry keeps the descriptor when the Registry call fails

1 participant