Skip to content
Latchkey

CI Step Hangs Until Timeout - Diagnose Stuck Processes

A step stops producing output and sits silent until the job timeout kills it. The process is not crashed - it is stuck, waiting on something that will never arrive.

What this error means

The log goes quiet mid-step. No progress, no error - just silence until the job hits its timeout and is cancelled. Often the last line is a command that waits: a prompt, a network read, or a long-running watcher started in the foreground.

CI log
Run ./scripts/deploy.sh
Waiting for service to become healthy...
# (no further output for 30 minutes)
##[error] The operation was canceled.

Common causes

A process is waiting on input or a TTY

A command expecting interactive input (a confirmation prompt, a password, a pager) blocks forever in CI where there is no TTY to answer it.

A blocking network call with no timeout

A request to a service that never responds, with no client timeout, hangs the step indefinitely until the job-level timeout intervenes.

A foreground long-running process

Starting a dev server, watcher, or tail -f in the foreground without backgrounding it means the step never returns.

How to fix it

Add per-step and per-command timeouts

Bound the wait so a hang fails fast instead of consuming the whole job.

Terminal
timeout 300 ./scripts/deploy.sh    # fail after 5 min instead of hanging
# and at the job level:
# timeout-minutes: 15

Make commands non-interactive

  1. Pass non-interactive flags (-y, --no-input, CI=true, DEBIAN_FRONTEND=noninteractive).
  2. Background long-running processes and poll for readiness with a bounded loop.
  3. Set explicit client timeouts on every network call in scripts.

How to prevent it

  • Always set per-step timeouts in addition to a job timeout.
  • Run commands non-interactively in CI.
  • Give every network/health-check call a bounded timeout.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →