github action fails to deploy because of CLI issue
Anonymous
PROOP

13 days 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](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 withrailway 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

13 days 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

13 days ago

I got the same issue here


jjao
PRO

13 days ago

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


brams-dev
HOBBY

13 days 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

13 days ago

Same same, no fix found so far


sfreytag
HOBBY

13 days 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

13 days ago

Yeah same thing happening to me also and its frustrating


f00xhunter
PRO

13 days ago

me too. no ability to deploy new code


riklomas
PRO

13 days ago

Same here!


f00xhunter

me too. no ability to deploy new code

sfreytag
HOBBY

13 days 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?


brams-dev
HOBBY

13 days 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

13 days 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

13 days 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...


adriancoll-stowlog
PRO

13 days ago

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

13 days ago

same problem


edwinlilja
PRO

13 days ago

Yup, same problem here


chitchatcafe
PRO

13 days ago

same problem


Anonymous
PRO

13 days 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

13 days ago

Same here


cestivan
PRO

13 days ago

Same here!


cestivan
PRO

13 days ago

Even if I use RAILWAY_API_TOKEN, I still encounter exceptions.


lucasadearaujo
PRO

13 days ago

goddamit, you guys never fail to disappoint


crystian
HOBBY

13 days ago

yeap, me too

Attachments


chitchatcafe
PRO

13 days ago

When will the problem be resolved?


Anonymous
PRO

13 days 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.2https://github.com/railwayapp/cli/pull/700

sfreytag
HOBBY

13 days 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?


ray-chen
EMPLOYEE

13 days ago

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


Railway
BOT

13 days 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

13 days ago

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


arresejo
PRO

13 days ago

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

Attachments


pietz
PRO

13 days ago

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


ray-chen
EMPLOYEE

13 days ago

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


arresejo
PRO

13 days ago

Seems to be ok now


jc-ethira
PRO

13 days ago

Now it’s working again!


Railway
BOT

13 days ago

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


Railway
BOT

13 days ago

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


sesprit
PRO

13 days ago

Worked, thanks guys!


shooosty
HOBBY

13 days ago

thanks guys


ray-chen
EMPLOYEE

13 days ago

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 13 days ago


Loading...