Any engine fix: The connect code expired before the machine used it

The connect code expired

A code minted in the dashboard is good for twenty minutes. When it lapses the token behind it is revoked, so an install that uses it afterwards produces an agent that dials out forever and is refused every time.

expired before that machine connected
Printed by Termdeck.

Diagnosis

What it actually is

The window is twenty minutes

Short on purpose: until a machine claims it, the code is a bearer credential, and one left sitting in a chat log is a machine somebody else can add to your account.

Expiry revokes rather than hides

The pending machine is removed and its token is revoked with a reason recorded. There is nothing to reactivate afterwards, which is why a stale code cannot be nursed back into working.

An install with a lapsed code still looks successful

The installer writes the environment file and starts the service without ever contacting the master. The failure appears later, on the first dial, in the agent log.

Check

Confirm it before you fix it

Run thisWhat a good answer looks like
grep -c TERMDECK_AGENT_TOKEN ~/.termdeck/agent.envWhether a token was written at all. One means the install completed, and the question moves to whether the master recognises it.
tail -n 20 ~/.termdeck/logs/agent.logA refusal with an HTTP status is the confirmation. The agent names the status and what to do about it.

Every command here has been run on a real machine. Termdeck answers the same questions for every machine you have connected, without opening a terminal on any of them.

Fix

Cheapest thing first

1. Mint a new code and install again

Fresh code, fresh token. Run the install on the machine inside the window rather than saving the command for later.

2. Uninstall the agent carrying the dead token first

Otherwise the machine ends up with two services, one of them permanently refused and quietly filling a log.

Not this

What will not help

Waiting to see whether it comes back

An expired code is gone rather than paused. Neither side is going to reconsider it.

FAQ

The connect code expired before the machine used it, answered

How long is a connect code valid?

Twenty minutes from the moment it is created.

Can I use one code on two machines?

No. A code becomes one machine, and it stops working as soon as that machine claims it or the window closes.

Does an expired code mean I lost a machine?

No, because the machine was never added. The only thing lost is the code.