Cannot calculate unfinished jobs (401 Unauthorized)


I am trying to configure Drone Autoscaler and I am hitting an issue.

{"id":"hIm1VPn5QEN6Ps6d","level":"debug","msg":"calculate unfinished jobs","time":"2020-07-07T17:10:40Z"}
{"error":"client error 401: {\"message\":\"Unauthorized\"}\n","id":"hIm1VPn5QEN6Ps6d","level":"error","msg":"cannot calculate unfinished jobs","time":"2020-07-07T17:10:40Z"}

I have created a new user with the following command:

drone user add --admin --machine autoscaler                                                                 
Successfully added user autoscaler                                                                                                      
Generated account token XXXXXXXXXXXXXXX

and used the resulting token to set the DRONE_AGENT_TOKEN variable.
Is this correct?

The instruction say:

Create a Drone Token

You need to create a user Drone token with administrative privilege that you can provide to the autoscaler. The autoscaler will use this token to remotely access the Drone build queue. If you do not know how to create a token please see our tutorial.

Where is the tutorial?

I have tried using the token with the drone cli and the token itself is correct. Is perhaps the variable not the correct one? Or something else i need to do to allow the agent to talk to the Drone server?

The correct variable is DRONE_SERVER_TOKEN.