github action fails to deploy because of CLI issue
Anonymous
PROOP

a year ago

My github actions is essentially just copy pasted from the railwayapp/cli the only edit really is using the secrets for the service id:

deploy-job: runs-on: ubuntu-latest container: ghcr.io/railwayapp/cli:latest env: SVC_ID: ${{ secrets.RAILWAY_SERVICE_ID }} RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }} steps: - uses: actions/checkout@v3 - run: railway up --service=${{ env.SVC_ID }}

When I run the work flow it fails because of the error:

Run railway up --service=*** railway up --service=*** shell: sh -e {0} env: SVC_ID: *** RAILWAY_TOKEN: *** Unauthorized. Please login with railway login The RAILWAY_TOKEN environment variable is set but may be invalid or expired.

I have triple checked the RAILWAY_TOKEN

I have tried it with railway project token

I have tried it with railway account token

I have even tried to just make the github action manually create the environment and then use the cli to try to deploy

nothing works, same error every time. I just want to deploy using the cli. I can't be the only one having this issue.

Project ID: 79303174-dea0-448f-8003-8c6efadd5ed5

Solved

39 Replies

Anonymous
PRO

a year ago

Same here but with gitlab CI/CD. Token is recreated, still same error: "The RAILWAY_TOKEN environment variable is set but may be invalid or expired."


Anonymous
PRO

a year ago

I got the same issue here


jjao
PRO

a year ago

Same issue here, just suddenly stopped working for me, and I refreshed the token and still got the same error


brm-sh
PRO

a year ago

I'm having the same issue, on the hobby plan. I've also tried recreating my token. I'm deploying using the cli on forgejo (gitea) actions.


chrisschmit
PRO

a year ago

Same same, no fix found so far


sfreytag
HOBBY

a year ago

...and same here too. I tried the CLI on my computer and that seemed to have issues - railway login returned 404. railway link told me a new version of the CLI was available so I upgraded to v4.11.2 and then railway login worked again.

I am running my GitHub action using ghcr.io/railwayapp/cli:latest - I wonder if this has an older version of the CLI and that's causing the issues?

Update: 4.11.2 was published to GHCR this morning: https://github.com/railwayapp/cli/actions/runs/19693091312

Update2: Running the action in ghcr.io/railwayapp/cli:4.11.2 did not fix it

Update3: Running it in cli:4.11.1 did not fix it either. So perhaps this is an issue on Railway's side with token authentication.

Update4: Same issue on my localhost - I did a railway logout then set up a project token then tried that from the CLI.

From the comments above this is happening on GitHub, GitLab, Forgejo and localhost, and my test suggests it is happening with 4.11.1 which was working fine yesterday in my GitHub actions. So this really does look like it is on Railway's side.


iamsooraj
HOBBY

a year ago

Yeah same thing happening to me also and its frustrating


f00xhunter
PRO

a year ago

me too. no ability to deploy new code


riklomas
PRO

a year ago

Same here!


f00xhunter

me too. no ability to deploy new code

sfreytag
HOBBY

a year ago

I can still deploy OK from localhost if I do 'railway login' and authenticate thru the web. It seems to be just the token based auth that not working. Would that get you moving at least?


brm-sh
PRO

a year ago

I'm able to deploy new code by doing railway login locally (authenticating using the browser).

$ railway -V

railway 4.6.1


leka74
HOBBY

a year ago

Having same issue on Github Actions pipeline. I re-generated the token but didn't work.

```

Unauthorized. Please login with railway login

The RAILWAY_TOKEN environment variable is set but may be invalid or expired.

Error: Process completed with exit code 1.

```


pietz
PRO

a year ago

yup, same here. Wasn't able to find a workaround. Literally cannot deploy and onboarded my company to railway yesterday. This is kinda shitty...


Same here, looks like there's an issue in the last version of the CLI.

V - 4.11.2

https://github.com/railwayapp/cli/pull/700


shooosty
HOBBY

a year ago

same problem


edwinlilja
PRO

a year ago

Yup, same problem here


chitchatcafe
PRO

a year ago

same problem


Anonymous
PRO

a year ago

I have the same issue i have debugged severally (running locally and on ci(github actions)) but i keep getting the error below when i use railway up

railway up --service=backend --environment=staging --detach
Unauthorized. Please login with `railway login`
The RAILWAY_TOKEN environment variable is set but may be invalid or expired.

jc-ethira
PRO

a year ago

Same here


cestivan
PRO

a year ago

Same here!


cestivan
PRO

a year ago

Even if I use RAILWAY_API_TOKEN, I still encounter exceptions.


lucasadearaujo
PRO

a year ago

goddamit, you guys never fail to disappoint


crystian
HOBBY

a year ago

yeap, me too

Attachments


chitchatcafe
PRO

a year ago

When will the problem be resolved?


Anonymous
PRO

a year ago

Same problem here as well


adriancoll-stowlog

Same here, looks like there's an issue in the last version of the CLI. V - 4.11.2 <https://github.com/railwayapp/cli/pull/700>

sfreytag
HOBBY

a year ago

I tried rolling back to 4.10 and @brams-dev says it is broken for him on 4.6 so maybe not a CLI issue?


Hey! We're looking into this right now, apologies for the inconvenience


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!


crystian
HOBBY

a year ago

just for knowledge, the deploy works, just the report on github does not work (in my case)


tradingdojoco
FREE

a year ago

Having the same issue with GitHub Actions using cli v4.11.1

Attachments


pietz
PRO

a year ago

It has been more than 7h since this was initially reported. We cannot deploy anything. You really need to get moving.


Apologies for the delay here. We've merged a fix, please try again


tradingdojoco
FREE

a year ago

Seems to be ok now


jc-ethira
PRO

a year ago

Now it’s working again!


Railway
BOT

a year ago

✅ The ticket Access Issue Detected has been marked as completed.


Railway
BOT

a year ago

✅ The ticket Authorization Issue Detected has been marked as completed.


sesprit
PRO

a year ago

Worked, thanks guys!


shooosty
HOBBY

a year ago

thanks guys


Awesome to hear. Again, super sorry about this!

Going to mark this thread as resolved, thank you for the patience 🫡


Status changed to Solved ray-chen • 12 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...