fix(terminal): terminal fails to open with custom node - #1382
Conversation
Greptile SummaryFixes terminal startup for custom node images by trying alternate users and shells.
Confidence Score: 3/5The PR should not merge until CLI aliases remain usable when the terminal falls back to an image's default user. The new fallback successfully opens a shell under a different home directory, but existing aliases still resolve node configuration and credentials through that user's home, leaving common node CLI commands broken on the path this change is intended to repair. src/components/terminal/DockerTerminal.tsx
|
| Filename | Overview |
|---|---|
| src/components/terminal/DockerTerminal.tsx | Adds user and shell fallback attempts with persistent diagnostics, but default-user sessions can make home-relative CLI aliases target the wrong configuration directory. |
| src/i18n/locales/en-US.json | Adds localized messages for user fallback, shell fallback, and complete exec failure. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Open node terminal] --> B[Configured user + bash]
B -->|fails| C[Configured user + sh]
C -->|fails| D[Image default user + bash]
D -->|fails| E[Image default user + sh]
B -->|runs| F[Connect stream]
C -->|runs| F
D -->|runs| F
E -->|runs| F
E -->|fails| G[Display accumulated errors]
F --> H[Install CLI aliases]
H --> I[Interactive terminal]
Reviews (1): Last reviewed commit: "fix(terminal): fall back when a custom i..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1382 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 211 211
Lines 7190 7190
Branches 1447 1447
=========================================
Hits 7190 7190 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Closes #1359
Description
When using a custom-built LND image in a Polar network, the terminal window opens for a fraction of a second and immediately closes. The cause is two hardcoded assumptions in
DockerTerminal.tsx: the exec requires/bin/bashand a user namedlndto exist in the container. Polar's managed images satisfy both via their entrypoint scripts, but custom images don't. So the exec fails silently, and the window closes before anyone can see why.This PR tries the expected user and shell first, then falls back to the image's default user and to
/bin/shif needed, printing a note in the terminal whenever it falls back. If every attempt fails, the window now stays open and shows the error instead of closing.Steps to Test
The terminal window should stay open, show a note that it's connected as the image's default user, and give you a working shell.
Screenshots