Skip to content

Show why a deployment failed and where to read its log - #27

Merged
lnsp merged 1 commit into
masterfrom
deploy-failure-output
Nov 21, 2026
Merged

lnsp merged 1 commit into
masterfrom
deploy-failure-output

Conversation

@lnsp

@lnsp lnsp commented Nov 21, 2026

Copy link
Copy Markdown
Member

Shows why a deployment failed, using the failure object that newer platforms add to deployments.

build push --wait

Last lines of version 7:
  listening on :8080
  \x1b[31mpanic: no database\x1b[0m
deployment of version 7 failed (health): not ready within 300s; version 6 keeps serving
Read its log with: valar service logs --deployment 7
  • The kind and message come from failure; a server without it gets today's error text (deployment of version 7 failed: <error>).
  • The serving version is the newest done deployment in the list the wait already fetched, so it costs no extra request.
  • The last 20 lines are read through the existing logs API (deployment=N&seek=end&skip=20) only on a terminal, outside CI (CI unset or false) and without --json. Control characters are escaped. Reading the log is best effort; errors are ignored.
  • The exit code stays 1 (failed).

deployment list

VERSION STATUS          CREATED      BUILD ERROR
6       done            22 hours ago b6
7       failed (health) 2 minutes ago b7   not ready within 300s

With --json, failure passes through unchanged and is omitted when the server sends none.

Tests

Table-driven against a test HTTP server: failure present, failure absent (older server), terminal with and without CI, and --json passthrough of deployment list.

build push --wait reports a failed deployment with the server's failure
kind and message, the version that keeps serving, and the command that
reads the deployment's log. On a terminal outside CI it also prints the
last 20 lines of that log, with control characters escaped. Servers
without failure kinds still get their error text.

deployment list marks failed deployments with their kind, and --json
passes the failure object through.
@lnsp
lnsp merged commit 9fd5306 into master Nov 21, 2026
3 checks passed
@lnsp
lnsp deleted the deploy-failure-output branch November 21, 2026 09:42
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.

1 participant