Agent token rejected by server (OD-1884)
Closed
Shivum opened 2 weeks ago

Trying to run an agent on a new onedev instance with the given command or converting it to a docker compose gives the error "ERROR io.onedev.agent.AgentSocket - Agent token rejected by server" on the agent. Regenerating the token gives the same error anyways.

Robin Shen commented 2 weeks ago

Different agent should be using different agent, and if a token is regenerated, you need to copy it to /conf/agent.properties, followed by restart of the agent.

Shivum commented 2 weeks ago

I'm trying to create a single agent. Copying the docker run command from the create an agent menu will give me that error without having another agent. I have deleted the bind that it has but it doesn't change anything.

So from a new install going to "Administration -> Agents -> Clicking the + -> Running the docker run command" Will immediately give me Agent token rejected by server

Robin Shen commented 2 weeks ago

Works at my side. Make sure you are connecting to the right server by checking the serverUrl environment.

Shivum commented 2 weeks ago

The url is correct. however, it is being proxied by cloudflare tunnels, I'm not sure if that matters

Robin Shen commented 2 weeks ago

Most probably that is the reason. You may connect to OneDev server directly to see if it works.

Shivum commented 2 weeks ago

Yeah connecting to the container directly seemed to work. So I guess it is a cloudflared issue, but wouldn't it give a timed out or some other error instead of rejected agent?

Robin Shen commented 2 weeks ago

OneDev agent authenticates itself via header Authorization: Bearer <agent token>. Please make sure this header is preserved across cloudflare.

Robin Shen changed state to 'Closed' 2 weeks ago
Previous Value Current Value
Open
Closed
issue 1 of 1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
OD-1884
Please wait...
Page is in error, reload to recover