Trouble starting Sensu Go Agent

From pfak in the the Sensu Community Slack:

Having trouble starting sensu-go-agent (5.16.1-8521) on ubuntu 18.04:

Feb 29 16:25:09 kvm sensu-agent[17396]: {"component":"agent","error":"error creating agent: error compacting queue: bucket already exists","level":"fatal","msg":"error executing sensu-agent","time":"2020-02-29T16:25:09Z"}

I tried blowing away “/var/cache/sensu/sensu-agent/*” and starting the service. No such luck. I verified there is no other sensu-agent process running on the machine.

Solved by submitter:

Oh, gee. Since I was using a wildcard, it didn’t catch “/var/cache/sensu/sensu-agent/.lasr.temp.db”. Once I blew away that file everything works now.

Follow-up:

If you need to clear the sensu-agent cache, completely remove the /var/cache/sensu/sensu-agent directory (while the agent is stopped). It will be re-created when sensu-agent starts.