Quick command to a disconnected worker leaves an orphaned 'running' execution and a generic error #6

Open
opened 2026-09-08 20:57:19 -04:00 by jared · 0 comments
Owner

Overview

POST /api/workers/:id/command inserts the execution row before checking whether the worker WebSocket is connected. When the worker is offline the route returns 400 Worker not connected, but the row stays in running forever (until the next server restart marks it failed). Meanwhile the UI discards the server message and shows only "Failed to execute command".

The Quick Command worker dropdown also lists offline workers as selectable, so this is easy to trigger.

Where

  • server.js app.post('/api/workers/:id/command') – INSERT precedes the workers.get(workerId) check.
  • public/index.html executeQuickCommand() – ignores err.error from the response.
  • loadWorkers()<option> for offline workers is not disabled.

Suggested fix

  • Check connectivity first (or delete/mark the row failed on the 400 path).
  • Surface the server's error text in the UI.
  • Disable/grey offline workers in the dropdown and default-select the first online one.
## Overview `POST /api/workers/:id/command` inserts the execution row **before** checking whether the worker WebSocket is connected. When the worker is offline the route returns `400 Worker not connected`, but the row stays in `running` forever (until the next server restart marks it failed). Meanwhile the UI discards the server message and shows only "Failed to execute command". The Quick Command worker dropdown also lists offline workers as selectable, so this is easy to trigger. ## Where - `server.js` `app.post('/api/workers/:id/command')` – INSERT precedes the `workers.get(workerId)` check. - `public/index.html` `executeQuickCommand()` – ignores `err.error` from the response. - `loadWorkers()` – `<option>` for offline workers is not disabled. ## Suggested fix - Check connectivity first (or delete/mark the row failed on the 400 path). - Surface the server's error text in the UI. - Disable/grey offline workers in the dropdown and default-select the first online one.
jared added the buguxfrontendbackendexecutionspriority/high labels 2026-09-08 20:57:19 -04:00
Sign in to join this conversation.