CLI throwing "Unauthorized" with RAILWAY_TOKEN
romain-courtsidelabs
HOBBYOP

4 months ago

This worked a few hours ago with the same token (it hasn't changed in my project settings since). now when I run RAILWAY_TOKEN=${PROJECT_TOKEN} railway status it throws:

Unauthorized. Please login with `railway login`

I'm trying to deploy a service from GitHub Actions, and can't use the Railway CLI Docker image because I need a bunch of custom things installed in that job.

Solved

27 Replies

Railway
BOT

4 months ago

Hello!

We're acknowledging your issue and attaching a ticket to this thread.

We don't have an ETA for it, but, our engineering team will take a look and you will be updated as we update the ticket.

Please reply to this thread if you have any questions!


4 months ago

Hey, we will be looking into this!


tgarrett-verygoodapps
PRO

4 months ago

I'm seeing this issue as well. Fails in CI as will as local with the latest CLI installed.


damyantuta
PRO

4 months ago

We're experiencing the same issue aswell


Anonymous
PRO

4 months ago

I'm getting the same issue.


4 months ago

We are pushing out a fix for this shortly.


Anonymous
PRO

4 months ago

I filed a ticket with a script to reproduce.


0xmukesh
PRO

4 months ago

is there any update regarding this?


0xmukesh
PRO

4 months ago

i'm facing this issue


0xmukesh
PRO

4 months ago

and it is a huge blocker for me rn for deploying my services


Status changed to Solved brody 4 months ago


Railway
BOT

4 months ago

✅ The ticket Access Issues with CLI Command has been marked as completed.


cc @nuno costa - are you still seeing this issue?


nunommc
PRO

4 months ago

Yes


nunommc
PRO

4 months ago

I used railway login --browserless maybe 20 times, and it always shows this:

    ~/rails/mfsdfsd    master *65 ?36  railway login --browserless                                                                                                                           ✔  2.7.8Browserless Login
Please visit:
  https://railway.com/cli-login?d=d29yZENvZGU9b3JhbmdlLWF0dHJhY3RpdmUtbW....lc3RhdGlvbiZob3N0bmFtZT1iYWNodXM=
Your pairing code is: orange-attractive-manifestation
Logged in as nuno.mmc@gmail.com
    ~/rails/mfsdfsd    master *65 ?36  railway ssh                                                                                                                                   ✔  11s   2.7.8Unauthorized. Please login with `railway login`
    ~/rails/mfsdfsd    master *65 ?36  railway ssh                                                                                                                                         1 ✘  2.7.8Unauthorized. Please login with `railway login`

4 months ago

Whats your CLI version?
railway -V


nunommc
PRO

4 months ago

$ railway -V                                                                                                                           
railway 4.11.0

4 months ago

Have you tried resetting the login altogether?

Deleting ~/.railway and doing the login + link to project/service from scratch


nunommc
PRO

4 months ago

I deleted ~/.railway/config.json and tried again and it worked! 👍🏻

However, I still notice one small glitch, when I call railway link it doesn't show in my console options to select, it looks like it's hanging, then I press and it selects my the default option which wasn't visible


nunommc
PRO

4 months ago


thdxg
PRO

a month ago

I'm experiencing the same problem. While the browser login works, I get "Unauthorized" with both RAILWAY_API_TOKEN and RAILWAY_TOKEN. I tried deleting the .railway directory in home, but that didn't fix it.

~
❯ railway whoami
Unauthorized. Please check that your RAILWAY_TOKEN is valid and has access to the resource you're trying to use.

~
❯ railway -V
railway 4.27.4

a month ago

As per the message, RAILWAY_TOKEN does not have access to the resources you are trying to access (whoami). You will need to use an account-scoped RAILWAY_API_TOKEN.


thdxg
PRO

a month ago

Using the account token throws an error as well.

~
❯ railway login
Invalid RAILWAY_API_TOKEN. Please check that it is valid and has access to the resource you're trying to use.

a month ago

Why run railway login when you are authenticating with a token?


thdxg
PRO

a month ago

railway whoami also didn't work. Sorry the example above was misleading

~
❯ railway whoami
Unauthorized. Please check that your RAILWAY_API_TOKEN is valid and has access to the resource you're trying to use.

a month ago

Are you using an account scoped token?


thdxg
PRO

a month ago

Yes


a month ago

Can you open your own thread, don't wanna continue this on a post from 2025


Loading...