Skip to content

surface contextual Docker error when daemon is unreachable#148

Open
rx18-eng wants to merge 2 commits into
stratum-mining:mainfrom
rx18-eng:fix/144-docker-unreachable-banner
Open

surface contextual Docker error when daemon is unreachable#148
rx18-eng wants to merge 2 commits into
stratum-mining:mainfrom
rx18-eng:fix/144-docker-unreachable-banner

Conversation

@rx18-eng
Copy link
Copy Markdown
Contributor

@rx18-eng rx18-eng commented May 9, 2026

Body

before this, when docker quit while sv2-ui was running, the dashboard just said "Mining services are stopped." and the start mining button silently failed. now it tells you docker is the actual problem and shows the contextual error from the backend.

two changes:

  • /api/status now returns docker: { reachable: boolean }. when false, the dashboard shows a red "Docker isn't running" banner. wrapped the ping in a 500ms Promise.race so a slow daemon can't stall the status response.
  • handleStartMining was throwing away the response body when /api/restart 500'd. now it parses the body the same way ReviewStart.tsx:73-77 already does in the wizard, and shows the contextual error string verbatim in a red "Could not start mining services" banner.

priority on the configured-but-stopped state: docker-down > start-error > existing "stopped" banner. the Start Mining button stays in all three so the user can retry once docker is back.

tested in WSL with native docker:

  • typecheck, lint, build clean.
  • sudo systemctl stop docker docker.socket → red banner appears within ~10s. clicked Start Mining with docker still down → 500 with the contextual error (visible in screenshots). sudo systemctl start docker → banner returns to the blue stopped state and Start Mining works again.
Screenshot 2026-05-09 155846 Screenshot 2026-05-09 155143

not in this PR: settings page has the same gap on its start/stop controls, happy to do that as a follow-up if you want. no UI tests for the banner branching because there's no jsdom/testing-library in the repo today.

closes #144

rx18-eng added 2 commits May 9, 2026 15:28
Signed-off-by: rx18-eng <remopanda78@gmail.com>
Signed-off-by: rx18-eng <remopanda78@gmail.com>
@rx18-eng
Copy link
Copy Markdown
Contributor Author

rx18-eng commented May 9, 2026

@pavlenex would appreciate your review whenever you have time !

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.

Provide contextual error instead of Mining Services stopped when docker hasn't started

1 participant