# Identify signal in Error: The command was interrupted by a signal

**URL:** <https://forum.buildkite.community/t/identify-signal-in-error-the-command-was-interrupted-by-a-signal/1405>\
**Category:** General\
**Created:** [January 4, 2021, 5:13pm UTC](https://forum.buildkite.community/t/identify-signal-in-error-the-command-was-interrupted-by-a-signal/1405 "2021-01-04T17:13:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![simonbyrne](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/simonbyrne/32/847_2.png) [@simonbyrne](https://forum.buildkite.community/u/simonbyrne)\
**Post date:** [January 4, 2021, 5:13pm UTC](https://forum.buildkite.community/t/identify-signal-in-error-the-command-was-interrupted-by-a-signal/1405/1 "2021-01-04T17:13:12Z")

</div>

We are having a job failing with “Error: The command was interrupted by a signal”: is there a way to identify what signal is causing this failure?

The [docs](https://buildkite.com/docs/agent/v3#exit-codes) state that in this case the exit code should be 128 + signal number, but the timeline states the command exit code is 255 (success).

The job is here:

> **[RRTMGP-CI #20 · CliMA](https://buildkite.com/clima/rrtmgp-ci/builds/20#70fd31e5-73b3-4e70-9023-b85935f7a2f0)**
>
> Try #260:

---

<div class="post-metadata">

**Author:** ![sj26](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/sj26/32/17_2.png) [@sj26](https://forum.buildkite.community/u/sj26)\
**Post date:** [January 5, 2021, 1:44am UTC](https://forum.buildkite.community/t/identify-signal-in-error-the-command-was-interrupted-by-a-signal/1405/2 "2021-01-05T01:44:17Z")

</div>

Hi @simonbyrne!

Sorry, it doesn’t look like the agent reported which signal interrupted the command there. Sometimes it’s not possible to observe the signal, but the agent will do its best.

An exit code of 255 can mean that the agent or some intermediate part of the bootstrap and plugins didn’t receive an exit code and so reported `-1` (which wraps around to `255` as an unsigned integer). It shouldn’t be reported as a success, sorry! Where are you seeing that? I can only see:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/buildkite1/original/1X/1663013aeb5944c42cf401ba21558590a6af3391.png)

---

<div class="post-metadata">

**Author:** ![simonbyrne](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/simonbyrne/32/847_2.png) [@simonbyrne](https://forum.buildkite.community/u/simonbyrne)\
**Post date:** [January 27, 2021, 8:42pm UTC](https://forum.buildkite.community/t/identify-signal-in-error-the-command-was-interrupted-by-a-signal/1405/3 "2021-01-27T20:42:48Z")

</div>

These docs:

> **[The Buildkite Agent v3](https://buildkite.com/docs/agent/v3#exit-codes)**
>
> The buildkite agent is a small, reliable and cross-platform build runner that makes it easy to run automated builds on your own infrastructure. Its main responsibilities are polling buildkite.com for work, running build jobs, reporting back the...

state that 255 means “The agent was gracefully terminated”

---

<div class="post-metadata">

**Author:** ![anon8263991](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@anon8263991](https://forum.buildkite.community/u/anon8263991)\
**Post date:** [January 28, 2021, 5:57am UTC](https://forum.buildkite.community/t/identify-signal-in-error-the-command-was-interrupted-by-a-signal/1405/4 "2021-01-28T05:57:24Z")

</div>

> 255 The agent was gracefully terminated

I’ll double check this, but I think this might mean “the agent received a signal to gracefully terminate, and so it stopped the running job(s)”.

I can see that agent didn’t run any further jobs - is it possible the instance shutdown for some reason?

Unfortunately 255 can **also** happen in the scenario @sj26 highlighted. This is probably a bug in the agent (it should be possible to detect when it happens and not report 255 to the Buildkite API), however we haven’t managed to find and squash the root cause.

---

<div class="post-metadata">

**Author:** ![simonbyrne](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/simonbyrne/32/847_2.png) [@simonbyrne](https://forum.buildkite.community/u/simonbyrne)\
**Post date:** [January 28, 2021, 4:35pm UTC](https://forum.buildkite.community/t/identify-signal-in-error-the-command-was-interrupted-by-a-signal/1405/5 "2021-01-28T16:35:02Z")

</div>

We spawn agents on demand, and run them with `--acquire-job`, so they will disconnect once completed.

---

<div class="post-metadata">

**Author:** ![simonbyrne](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/simonbyrne/32/847_2.png) [@simonbyrne](https://forum.buildkite.community/u/simonbyrne)\
**Post date:** [January 28, 2021, 4:41pm UTC](https://forum.buildkite.community/t/identify-signal-in-error-the-command-was-interrupted-by-a-signal/1405/6 "2021-01-28T16:41:26Z")

</div>

In this case the cause was apparently an OOM killed process.

---

<div class="post-metadata">

**Author:** ![anon8263991](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@anon8263991](https://forum.buildkite.community/u/anon8263991)\
**Post date:** [January 29, 2021, 5:43am UTC](https://forum.buildkite.community/t/identify-signal-in-error-the-command-was-interrupted-by-a-signal/1405/7 "2021-01-29T05:43:48Z")

</div>

Oh, that’s interesting.

Given that, it does seem like there’s a gap in the way the agent detects and reports signals in some cases. We’ll dig into it and see what we can find. Thanks!
