Agent service stuck in activating

$ sudo systemctl | grep buildk
buildkite-agent.service loaded activating auto-restart Buildkite Agent

After initial setup this Linux agent worked for a while and handled jobs, but after rebooting the machine, the bk-agent never gets further than “activating”.

If I try …

sudo systemctl stopt buildkite-agent sudo systemctl start buildkite-agent

… it stops just fine, but then goes back into the activating state as before.

Oh, that doesn’t sound good — sorry! What’s the full output of systemctl status buildkite-agent look like? Is there anything in the logs, journalctl -u buildkite-agent.service?

Though is says exited/FAILURE there, my grep command above still says “activating”

Yes, I can see it has the string “activating” in it, but the reason it’s still activating is that the process isn’t started, it’s exiting with exit code 1. Can you see the logs? They should contain some hint as to why it isn’t working.

Where would the logs for the build agent startup be?

Oh, you said where that was in the earlier message - sorry

I’m seeing:

Aug 22 12:47:49 paul-HP-ENVY-x360-Convertible systemd[1]: buildkite-agent.service: Service RestartSec=5s expired, scheduling restart.
Aug 22 12:47:49 paul-HP-ENVY-x360-Convertible systemd[1]: buildkite-agent.service: Scheduled restart job, restart counter is at 2459.
Aug 22 12:47:49 paul-HP-ENVY-x360-Convertible systemd[1]: Stopped Buildkite Agent.
Aug 22 12:47:49 paul-HP-ENVY-x360-Convertible systemd[1]: Started Buildkite Agent.
Aug 22 12:47:49 paul-HP-ENVY-x360-Convertible buildkite-agent[18329]: Missing build-path. See: buildkite-agent start --help
Aug 22 12:47:49 paul-HP-ENVY-x360-Convertible systemd[1]: buildkite-agent.service: Main process exited, code=exited, status=1/FAILURE
Aug 22 12:47:49 paul-HP-ENVY-x360-Convertible systemd[1]: buildkite-agent.service: Failed with result ‘exit-code’.
Aug 22 12:47:54 paul-HP-ENVY-x360-Convertible systemd[1]: buildkite-agent.service: Service RestartSec=5s expired, scheduling restart.
Aug 22 12:47:54 paul-HP-ENVY-x360-Convertible systemd[1]: buildkite-agent.service: Scheduled restart job, restart counter is at 2460.
Aug 22 12:47:54 paul-HP-ENVY-x360-Convertible systemd[1]: Stopped Buildkite Agent.
Aug 22 12:47:54 paul-HP-ENVY-x360-Convertible systemd[1]: Started Buildkite Agent.
Aug 22 12:47:54 paul-HP-ENVY-x360-Convertible systemd[1]: buildkite-agent.service: Main process exited, code=exited, status=1/FAILURE
Aug 22 12:47:54 paul-HP-ENVY-x360-Convertible systemd[1]: buildkite-agent.service: Failed with result ‘exit-code’.

It’s muttering about a missing buildkite path, yet I see this in the doco:

OK, so I filled in more of the config, including items I though were optional because of defaults. Now I’m stuck on permissions on mkdir /usr/local/var/buildkite-agent/* which I think is because of a missing group ‘admin’. I’ll do some more reading.

OK I think I’m through it after a bunch more chowns and mkdirs to facilitate ‘first time’. Much for our own notes on BK agents, but that suggestion to review ‘build-path’ was the log-jam breaker - thanks.