Skip to content
Latchkey

CI Deadlock: No Output Then Killed

A step emits nothing and never finishes until the timeout kills it. Silent hangs are usually a real deadlock or a command blocking on input, which is a deterministic code/config issue, not a blip.

What this error means

The log shows the step starting, then no further output, until it is cancelled for timing out. A deterministic deadlock reproduces every run regardless of runner.

shell
Run ./build.sh
(no output)
##[error] The operation was canceled.

Common causes

A lock-ordering or thread deadlock

Two paths waiting on each others locks never proceed; the process sits idle until killed.

A command blocking on stdin

An interactive prompt with no TTY in CI blocks forever waiting for input that never comes.

How to fix it

Make commands non-interactive and dump stacks

Avoid input waits and capture where it is stuck.

shell
export DEBIAN_FRONTEND=noninteractive
apt-get install -y <pkg>          # no prompts
# for a hung JVM/Go process, capture a stack dump on the runner
jstack <pid> 2>/dev/null || kill -QUIT <pid>

Find and fix the deadlock

  1. Reproduce locally with the same inputs and capture a thread/goroutine dump.
  2. Add timeouts to blocking calls so they fail with context.
  3. Remove any reliance on interactive input in CI.

How to prevent it

  • Always run CI commands non-interactively.
  • Add timeouts to blocking operations.
  • A retry will not fix a deterministic deadlock; it must be fixed in your code/config. A larger runner does not help here.

Frequently asked questions

What causes "Deadlock then killed"?
Two paths waiting on each others locks never proceed; the process sits idle until killed.
How do I fix Deadlock then killed?
Avoid input waits and capture where it is stuck.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card