Skip to content
Exit Status

Exit Status

The web UI shows no exit status. A run there ends as ok, failed or stopped (see Runs and Progress).

Scripts branch on sind’s exit status, so it is part of the command line contract: a status may be added, but never renumbered.

Status Meaning Typical cause
0 The command succeeded
1 The command ran and failed Docker is not reachable, a node did not become ready within --wait, a cluster does not exist, a required sind doctor check failed, an invalid SIND_* variable, such as SIND_REALM, or config file
2 sind rejected the command line before acting on it An unknown command or flag, a flag value or argument that is not valid, the wrong number of arguments
130 SIGINT, SIGTERM or SIGHUP interrupted the command Ctrl-C, timeout, docker stop, a closed terminal or SSH session

sind ssh, sind exec, sind enter and sind logs exit with the status of the program they run instead, see below.

Usage errors

Status 2 means that the command line has to change before the command can succeed; running it again will not help.

$ sind get cluster dev extra
12:00:00.000 ERRO accepts at most 1 arg(s), received 2 (usage: sind get cluster [NAME])
$ echo $?
2

An error in the arguments ends with the usage line of the command, as above; one in a flag value names the flag.

This covers:

  • an unknown command or help topic, with --help too: sind get bogus, sind get bogus --help, sind help bogus, sind completion fishy

  • an unknown flag, a flag without its value, or a value that is not valid: sind get clusters -o yaml, sind --realm Not_A_Realm get clusters, sind create worker --count x. A flag value reads the same whatever the flag, with what it wants instead:

    $ sind get clusters -o yaml
    12:00:00.000 ERRO invalid --output value "yaml": want human or json
    $ sind create cluster --wait 5
    12:00:00.000 ERRO invalid --wait value "5": want a duration with a unit, such as 90s, 5m or 1h30m
    
  • the wrong number of arguments, or an argument that is not valid: sind get cluster a b, sind get cluster Not_A_Name

  • a node argument that does not parse, that names no node, or that names several nodes where one is needed: sind power on 'worker-[', sind power on @compute, sind ssh 'worker-[0-1]'

  • sind exec without -- and a command, and sind ssh with a remote command that does not follow --: sind ssh worker-0 hostname

  • a --progress mode sind does not know, or one it cannot show, such as tty where standard error is not a terminal, and a --progress-log file it cannot use: sind --progress tree get clusters, sind --progress tty create cluster 2>create.log (see Progress Display)

A SIND_* variable, such as SIND_REALM, and the config file are not part of the command line: an invalid one exits 1, with an error that names it. SIND_PROGRESS, SIND_PROGRESS_LOG and SIND_VERBOSE fail no command: with a value sind cannot use, it shows no progress, writes no event log, or logs as without the variable, and says why in one line when it does not know the mode or the number, or cannot use the file. The default activity log never fails a command and never says a word when it cannot be written. See Environment Variables.

Commands that run a program

sind ssh, sind exec, sind enter and sind logs hand the terminal to a program, docker exec running ssh, the command or a shell, or docker logs, and exit with its status. They add no error line of their own, since the program has written its own diagnostics.

$ sind exec -- sh -c 'exit 42'
$ echo $?
42
  • The status is the command’s, as docker exec reports it, and for sind ssh the remote command’s, as ssh reports it. ssh exits 255 when it cannot connect. Docker’s own errors, such as a container that is not running, give docker’s status and message.
  • A failure before the program starts is sind’s: sind exec in a cluster that does not exist, or without a submitter or controller, exits 1, as do sind ssh and sind logs for a node or cluster that does not exist, and a usage error exits 2.
  • A docker process killed by signal N exits 128 + N, as a shell reports it. Killed by SIGINT, SIGTERM or SIGHUP, it exits 130, like an interrupted sind: these signals reach docker when they are sent to sind’s process group, as by Ctrl-C.

Interrupts

The first SIGINT, SIGTERM or SIGHUP stops the command and runs its cleanup, such as the rollback of a failed sind create cluster; sind then exits 130. A --wait limit of sind create cluster or sind create worker that runs out is not an interrupt: the command rolls back the same way and exits 1. A --wait limit of a power command that runs out exits 1 too; the nodes stay as they are. SIGTERM and SIGHUP exit 130 too, not 143 or 129, so that a script checks one status for “interrupted”. SIGHUP comes when the terminal or SSH session of the command goes away; under nohup, sind ignores it. A second signal ends sind at once, without waiting for the cleanup to finish. A command that changes something also finishes its cleanup when the program that reads its output has gone, as tee in sind create cluster 2>&1 | tee create.log goes with the same Ctrl-C. sind ui and sind mcp stream are the exceptions: SIGINT, SIGTERM or SIGHUP is how a server is stopped, so they shut down and exit 0. On a terminal, the progress display says interrupting while the cleanup runs, and the summary line it leaves says the command was canceled.

MCP tools

A tool call of the MCP server returns the command’s exit status as exitCode, next to its stdout and stderr: a tool call whose arguments sind rejects reads 2, and sind_exec returns the status of the command it ran. A call whose command exits non-zero is also marked as an error (isError: true).

Last updated on