# Buildkite Agent with spawn=2 will randomly fail/create new agents

**URL:** <https://forum.buildkite.community/t/buildkite-agent-with-spawn-2-will-randomly-fail-create-new-agents/520>\
**Category:** General\
**Created:** [May 24, 2019, 3:43pm UTC](https://forum.buildkite.community/t/buildkite-agent-with-spawn-2-will-randomly-fail-create-new-agents/520 "2019-05-24T15:43:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathan.pierce](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/nathan.pierce/32/393_2.png) [@nathan.pierce](https://forum.buildkite.community/u/nathan.pierce)\
**Post date:** [May 24, 2019, 3:43pm UTC](https://forum.buildkite.community/t/buildkite-agent-with-spawn-2-will-randomly-fail-create-new-agents/520/1 "2019-05-24T15:43:28Z")

</div>

```auto
2019-05-24 06:58:46 DEBUG CICDM016-1 GET https://agent.buildkite.com/v3/jobs/a12e2a3d-be99-4080-9bef-d1a4d3c9505f 
2019-05-24 06:58:46 DEBUG CICDM016-1 ↳ GET https://agent.buildkite.com/v3/jobs/a12e2a3d-be99-4080-9bef-d1a4d3c9505f proto=HTTP/2.0 status=200 Δ=27.460123ms

  _ _ _ _ _ _ _ _
 | | (_) | | | | (_) | | |
 | | ___ _ _| |__ | | | ___| |____  _____ _ ______ | |_
 | '_ \| | | | | |/ _` | |/ / | __/ _ \ / _` |/ _` |/ _ \ '_ \|__ |
 | |_) | |_| | | | (_| | <| | || __/ | (_| | (_| |__/ | | | |_
 |_. __/ \__ ,_|_|_|\ __,_|_|\_\_|\__ \ ___| \__ ,_|\ __, |\___ |_| |_|\__|
                                                __/ |
 http://buildkite.com/agent |___/

2019-05-24 07:03:17 NOTICE Starting buildkite-agent v3.11.2 with PID: 772
2019-05-24 07:03:17 NOTICE The agent source code can be found here: https://github.com/buildkite/agent
2019-05-24 07:03:17 NOTICE For questions and support, email us at: hello@buildkite.com
2019-05-24 07:03:17 INFO Configuration loaded path=/usr/local/etc/buildkite-agent/buildkite-agent.cfg
2019-05-24 07:03:17 DEBUG Bootstrap command: /usr/local/bin/buildkite-agent bootstrap
2019-05-24 07:03:17 DEBUG Build path: /Users/cicd/.buildkite-agent/builds
2019-05-24 07:03:17 DEBUG Hooks directory: /usr/local/etc/buildkite-agent/hooks
2019-05-24 07:03:17 DEBUG Plugins directory: /Users/cicd/.buildkite-agent/plugins
2019-05-24 07:03:17 INFO Registering agent 1 of 2 with Buildkite...
2019-05-24 07:03:17 DEBUG POST https://agent.buildkite.com/v3/register
2019-05-24 07:03:18 DEBUG ↳ POST https://agent.buildkite.com/v3/register proto=HTTP/2.0 status=201 Δ=266.298053ms
2019-05-24 07:03:18 INFO Registering agent 2 of 2 with Buildkite...
2019-05-24 07:03:18 DEBUG POST https://agent.buildkite.com/v3/register
2019-05-24 07:03:18 DEBUG ↳ POST https://agent.buildkite.com/v3/register proto=HTTP/2.0 status=201 Δ=37.774678ms
2019-05-24 07:03:18 INFO CICDM016-3 Connecting to Buildkite... 
2019-05-24 07:03:18 INFO CICDM016-4 Connecting to Buildkite... 
2019-05-24 07:03:18 DEBUG CICDM016-3 POST https://agent.buildkite.com/v3/connect 
2019-05-24 07:03:18 INFO Started 2 Agent(s)
2019-05-24 07:03:18 INFO You can press Ctrl-C to stop the agents
2019-05-24 07:03:18 DEBUG CICDM016-4 POST https://agent.buildkite.com/v3/connect 
2019-05-24 07:03:18 DEBUG CICDM016-4 ↳ POST https://agent.buildkite.com/v3/connect proto=HTTP/2.0 status=200 Δ=129.825443ms
2019-05-24 07:03:18 INFO CICDM016-4 Waiting for work... 
2019-05-24 07:03:18 DEBUG CICDM016-4 GET https://agent.buildkite.com/v3/ping 
2019-05-24 07:03:18 DEBUG CICDM016-3 ↳ POST https://agent.buildkite.com/v3/connect proto=HTTP/2.0 status=200 Δ=135.57234ms
2019-05-24 07:03:18 INFO CICDM016-3 Waiting for work... 
2019-05-24 07:03:18 DEBUG CICDM016-3 GET https://agent.buildkite.com/v3/ping 
2019-05-24 07:03:18 DEBUG CICDM016-3 ↳ GET https://agent.buildkite.com/v3/ping proto=HTTP/2.0 status=200 Δ=38.426374ms

```

From the logs above, I don’t see any reason this would happen. It caused some of our jobs to get “Agent Lost”. Other nodes running buildkite agents from the same network/switch were fine (I looked at their logs).

What do you suggest I check?

---

<div class="post-metadata">

**Author:** ![anon46008679](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@anon46008679](https://forum.buildkite.community/u/anon46008679)\
**Post date:** [May 24, 2019, 10:18pm UTC](https://forum.buildkite.community/t/buildkite-agent-with-spawn-2-will-randomly-fail-create-new-agents/520/2 "2019-05-24T22:18:35Z")

</div>

@anon18197598 can you spot anything awry in the log here?

---

<div class="post-metadata">

**Author:** ![anon18197598](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@anon18197598](https://forum.buildkite.community/u/anon18197598)\
**Post date:** [May 24, 2019, 10:20pm UTC](https://forum.buildkite.community/t/buildkite-agent-with-spawn-2-will-randomly-fail-create-new-agents/520/3 "2019-05-24T22:20:02Z")

</div>

I’d upgrade to the latest, there have been several fixes that might be relevant.

---

<div class="post-metadata">

**Author:** ![nathan.pierce](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/nathan.pierce/32/393_2.png) [@nathan.pierce](https://forum.buildkite.community/u/nathan.pierce)\
**Post date:** [May 28, 2019, 12:53pm UTC](https://forum.buildkite.community/t/buildkite-agent-with-spawn-2-will-randomly-fail-create-new-agents/520/4 "2019-05-28T12:53:32Z")

</div>

Thank you gentlemen, I will notify you once we’re upgraded and if we see anything
