Skip to content
CLI throwing "Unauthorized" with RAILWAY_TOKEN
romain-courtsidelabs
OP

a year 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

a year 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!


a year ago

Hey, we will be looking into this!


tgarrett-verygoodapps

a year ago

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


damyantuta

a year ago

We're experiencing the same issue aswell


Anonymous

a year ago

I'm getting the same issue.


a year ago

We are pushing out a fix for this shortly.


Anonymous

a year ago

I filed a ticket with a script to reproduce.


0xmukesh

a year ago

is there any update regarding this?


0xmukesh

a year ago

i'm facing this issue


0xmukesh

a year ago

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


Status changed to Solved brody • about 1 year ago


Railway
BOT

a year ago

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


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


nunommc

a year ago

Yes


nunommc

a year 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`

a year ago

Whats your CLI version?

railway -V


nunommc

a year ago

$ railway -V                                                                                                                           
railway 4.11.0

a year ago

Have you tried resetting the login altogether?

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


nunommc

a year 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

a year ago


thdxg

10 months 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

10 months 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

10 months 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.

10 months ago

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


thdxg

10 months 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.

10 months ago

Are you using an account scoped token?


thdxg

10 months ago

Yes


10 months ago

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


Welcome!

Sign in to your Railway account to join the conversation.

Loading...