You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot list or delete contexts when an orphaned or invalid context exists in local config #631
When the local configuration file contains an orphaned or broken context (for example, referencing a server or user that no longer exists in servers or users), the CLI becomes difficult to recover:
microcks context (list) aborts completely, preventing users from viewing even valid contexts.
microcks context <name> --delete also fails before removing the context, making it impossible to clean up the broken entry through the CLI.
As a result, users are forced to manually locate and edit ~/.config/microcks/config to remove the invalid YAML entry.
Expected behavior
microcks context should list all defined contexts, displaying the server reference from contextRef.Server without failing when the full context resolution cannot find the associated server or user.
microcks context <name> --delete should remove the context reference directly from contexts, without requiring ResolveContext(context) to succeed first.
Garbage collection of unreferenced servers or users during context deletion should be idempotent. If a server or user is already missing, the command should continue without failing or aborting the configuration save.
Actual behavior
Running microcks context fails with:
Error: resolving context "<context-name>": Server '<server-name>' undefined
As a result, no contexts are displayed to the user.
The context is not deleted, and the configuration file on disk remains unchanged.
How to Reproduce?
Steps to Reproduce
Create a configuration file (e.g. /tmp/test-config or ~/.config/microcks/config) containing one valid context and one orphaned context referencing a non-existent server:
I reproduced this on current master (d3fced2) using a temporary config with one valid context and one context referencing a missing server.
Listing contexts aborts when resolving the broken entry, and deleting that entry fails before RemoveContext is reached, leaving the configuration unchanged.
I’d like to fix both recovery paths and add regression tests covering listing and deleting an orphaned context. Would this approach be welcome?
Activity
AyushmanMohapatra015 commentedon Nov 19, 2026
I reproduced this on current
master(d3fced2) using a temporary config with one valid context and one context referencing a missing server.Listing contexts aborts when resolving the broken entry, and deleting that entry fails before
RemoveContextis reached, leaving the configuration unchanged.I’d like to fix both recovery paths and add regression tests covering listing and deleting an orphaned context. Would this approach be welcome?
aryarathoree commentedon Nov 19, 2026
@AyushmanMohapatra015 actually I am waiting for the maintainers to review the issue and then will be working on it.
AyushmanMohapatra015 commentedon Nov 19, 2026
Sure @aryarathoree thanks for lmk !!
aryarathoree commentedon Nov 19, 2026
hey @Caesarsage , would love to know your take on this issue