"The agent cannot authenticate until the workspace provision job has been completed."
However, when the unit starts, as part of a remote exec provisioner, it just keeps repeating this:
Restarting the systemd unit has no effect.
The token is being passed through from the coder_agent resource (coder_agent.main.token).
With
coder state pull I can see that the token on the agent resource is correct compared to the one on disk, but I cannot get this agent to associated.I've tried adding a
coder_agent_instance but it doesn't help.I see an old closed issue https://github.com/coder/coder/issues/5704 as being similar, but there's no clear fix present there.
Perhaps worth mentioning:
- Using an AWS instance, but in a different account, so using token auth, not aws instance identity
- AWS instance is created by a module that is intended to work independently of Coder; seems to pose some issues for knitting the agent together with the instance, couldn't get
coder_metadata to work either- Actual instance is spun up fine and seems happy except for the agent connection
