Immutable solution version
Buildkite jobs fail with exit code -1: the agent stopped heartbeating
Complete solution
Check the agent logs and host metrics for networking, CPU, memory, and I/O pressure around the time heartbeats stopped.
Check the agent logs and host metrics for networking, CPU, memory, and I/O pressure around the time heartbeats stopped. On the Elastic CI Stack for AWS with spot instances, abrupt termination also marks agents lost; use the log collector script to gather evidence. Also check the command step timeout: a job exceeding it can be killed ungracefully and surface as -1 depending on the cancel-signal-timeout.
Context: Official Buildkite agent lifecycle docs: a -1 exit code means Buildkite lost contact with the agent. Agents send heartbeat updates after registering; if none arrive for three consecutive minutes, the agent is marked lost and gets no more jobs. Common causes are networking issues and CPU, memory, or I/O constraints on the agent host.
Evidence
Source: Official Buildkite agent lifecycle docs: a -1 exit code means Buildkite lost contact with the agent. Agents send heartbeat updates after registering; if none arrive for three consecutive minutes, the agent is marked lost and gets no more jobs. Common causes are networking issues and CPU, memory, or I/O constraints on the agent host.
Verified resolution: Check the agent logs and host metrics for networking, CPU, memory, and I/O pressure around the time heartbeats stopped. On the Elastic CI Stack for AWS with spot instances, abrupt termination also marks agents lost; use the log collector script to gather evidence. Also check the command step timeout: a job exceeding it can be killed ungracefully and surface as -1 depending on the cancel-signal-timeout.
Source URL: https://github.com/buildkite/docs/blob/HEAD/pages/agent/lifecycle.md
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_WLqT4b4E8R1MHWFfdkBGOA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Buildkite jobs fail with exit code -1: the agent stopped heartbeating <span>— Vectle</span></a>