Skip to content

[BUG] Deploy on a plain (non-Git) internal stack returns 500 "Unexpected end of JSON input" #1271

Description

@framinosona

Description

Calling the stack deploy endpoint for a plain, internal (non-Git) stack returns an HTML 500 error page with the message "Unexpected end of JSON input" — looks like the server tries to JSON.parse() an empty/absent request body without handling that case. The stack itself is unaffected (container keeps running as-is), the call just fails outright rather than deploying.

Reproduced via the strausmann/mcp-dockhand MCP integration, so I can't fully rule that layer out, but the response is a raw Dockhand-rendered 500 HTML error page (SvelteKit default error page), which points at the Dockhand backend itself throwing on an unhandled JSON parse.

Steps to reproduce

  1. Create a plain internal stack (POST /api/stacks with a compose string referencing a pre-built image, e.g. image: ghcr.io/<user>/<image>:latest, plus envVars) and deploy it — this part works fine, container starts correctly with env vars applied.
  2. Call the deploy endpoint again on that same stack (equivalent of clicking "Deploy" a second time, e.g. to pull a newer image tag) with no request body.
  3. Get back:
    <title>Unexpected end of JSON input</title>
    ...
    <span class="status">500</span>
    <h1>Unexpected end of JSON input</h1>
  4. The existing container is untouched (uptime doesn't reset) — the request fails before doing anything.

Logs

HTTP 500: Unexpected end of JSON input
(SvelteKit default error page, no additional server-side detail exposed via the response)

Dockhand version

1.0.27

Hawser version (if used)

N/A (direct socket connection)

Connection mode

socket

Please confirm the following

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingready to gofixed, goes to the next release

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions