fix(console): set GIN_MODE=debug to prevent xdg-open panic in container#567
Draft
sudhir-intc wants to merge 1 commit intomainfrom
Draft
fix(console): set GIN_MODE=debug to prevent xdg-open panic in container#567sudhir-intc wants to merge 1 commit intomainfrom
sudhir-intc wants to merge 1 commit intomainfrom
Conversation
The console service was crash-looping due to the app attempting to launch a browser via xdg-open when GIN_MODE was not set to 'debug'. Since the container runs in a headless environment with no display server, this caused a panic on every startup. Setting GIN_MODE=debug suppresses the launchBrowser goroutine and allows the service to start normally.
|
Hey @sudhir-intc thanks for creating this, #564 is addressing the issues. Thank you! |
Contributor
|
@sudhir-intc For #564, you'll need to be on main for both console and sample-web-ui. |
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.
Problem
The
consoleservice was crash-looping on startup. Two issues were identified and resolved:1. Dirty database migration (
schema_migrations)Migration version
20250701000000was marked asdirty=truein the database, causing the app to exit with:Root cause: A previous migration run failed mid-flight, leaving
golang-migrateunable to proceed.Fix: Clear the dirty flag by running the following against the
dbcontainer:Replace 20250701000000 with the actual dirty version shown in the error if it differs.
This is a one-time manual recovery step — once cleared, the app will re-run the migration on next startup.
2.
xdg-openpanic on startup (this commit)After the migration was fixed, the app panicked with:
The
handleDebugModefunction spawns a goroutine to open a browser viaxdg-openwheneverGIN_MODE != "debug". In the headless scratch container there is no display server, so this always panics.Fix: Added
GIN_MODE: debugto theconsoleservice environment indocker-compose.yml. This suppresses thelaunchBrowsergoroutine and allows the service to start normally.3. Missing
APP_ENCRYPTION_KEYAPP_ENCRYPTION_KEYwas empty, causing the app to fall through to the D-Bus keyring which is not available in the container. This is set in the local.envfile (gitignored).