Restore sessions from Docker container metadata after server restart#142
Merged
Yashb404 merged 4 commits intochore/upgrade-depfrom Feb 13, 2026
Merged
Restore sessions from Docker container metadata after server restart#142Yashb404 merged 4 commits intochore/upgrade-depfrom
Yashb404 merged 4 commits intochore/upgrade-depfrom
Conversation
Draft
- Add metadata labels to containers (session_id, owner_id, shell, etc.) - Restore sessions on server startup from existing containers - Attempt session restoration on WebSocket reconnection - Update container creation to include comprehensive labels - Fix pre-existing containers accessibility after upgrade Co-authored-by: Yashb404 <139128977+Yashb404@users.noreply.github.com>
- Replace detailed Docker/bollard errors with generic messages - Keep detailed error logging server-side for debugging - Prevent leaking internal operational details to clients Co-authored-by: Yashb404 <139128977+Yashb404@users.noreply.github.com>
- Fix timer reset issue: preserve container age on restoration - Replace println!/eprintln! with tracing::info!/error! - Use container creation timestamp for accurate session age tracking Co-authored-by: Yashb404 <139128977+Yashb404@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Upgrade server dependencies for enhanced functionality
Restore sessions from Docker container metadata after server restart
Feb 13, 2026
Member
|
the issue is still there , for the containers created before the dependency upgrade they are unable to connect , they do not load in the window. in the terminal , an attempting to connect and then it fails with [!] Failed to start viewer container. Please try again later. [!] Connection Closed. meanwhile the container was created in background but never connected to the screen Server listening on port 3000... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After the Axum upgrade, the in-memory SessionMap is cleared on restart. Pre-existing Docker containers remain running but become inaccessible because their session metadata is lost.
Changes
Session metadata persistence via Docker labels
session_id,owner_id,project_owner_id,project_slug,shell,container_typeSession restoration on startup
restore_sessions_from_containers()queries Docker API for all running TryCli containersLazy restoration on reconnection
restore_specific_session()handles WebSocket connections to sessions not yet restoredSecurity hardening
Example
Backward Compatibility
Containers created before this change lack the new labels and won't be automatically restored. They follow existing cleanup behavior: reaped after 30s of inactivity.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.