railway up suddenly started failing with -> Failed to upload code with status code 403 Forbidden
ben5516
PROOP

7 months ago

Yesterday midday I was able to deploy fine. Then later in the evening and continuing onto this morning deploys fail with: Failed to upload code with status code 403 Forbidden

railway --version

railway 4.5.6

railway up --verbose

Indexed Compressed [====================] 100% railway up

service: 8d94972c-572f-4158-b02d-cfee83b22b85

environment: 4dd6438d-db3c-47c1-9a20-ec7d866cfe01

bytes: 7156904

url: https://backboard.railway.com/project/505f25ed-4b70-4633-b76a-062b8ea852f1/environment/4dd6438d-db3c-47c1-9a20-ec7d866cfe01/up?serviceId=8d94972c-572f-4158-b02d-cfee83b22b85

Failed Failed to upload code with status code 403 Forbidden

Solved

8 Replies

Railway
BOT

7 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


chandrika
EMPLOYEE

7 months ago

Hi there, could you try re-authenticating your CLI?


Status changed to Awaiting User Response Railway 7 months ago


ben5516
PROOP

7 months ago

I ran

railway logout

railway login --browserless
(visited URL and authorized the login)
railway link
railway up

Indexed Compressed [====================] 100% Failed Failed to upload code with status code 403 Forbidden


Status changed to Awaiting Railway Response Railway 7 months ago


ben5516
PROOP

7 months ago

By the way, the problem is unique to a single service within this project (the rails api). I can deploy to another service with railway up just fine.


ben5516
PROOP

7 months ago

If I clone my Github repo to another directory on my Mac, I can deploy from that directory without a problem. This bug seems to be in the railway command itself. It persists even if I wipe out ~/.railway/config.json and re-authenticate and re-link.

As an example: Original directory -> ~/Code/repo-name/myproject
railway up

This fails point_up_2 emoji

git clone repo-name ~/Downloads

cd ~/Downloads/repo-name/myproject

railway link
railway up

This works point_up_2 emoji

So, it's specific to the local path somehow. Either credentials are getting cached somewhere other than ~/.railway or a server side auth check is comparing credentials with the local project path and rejecting the upload.


ben5516
PROOP

7 months ago

Ok, I was able to resolve this issue, though I'm not sure the exact cause.

After cloning my repo to a second folder and verifying I could deploy from that folder, I compared the contents of the two folder to see what files existed in the original that wasn't in the clone.

diff -rq api~old api

I deleted some logs and tmp files but that didn't fix the issue.

Finally, after deleting log files and a .ruby-lsp folder, I was able to deploy again from the original directory.

shrug emoji So the issue is somewhere in the railway up command, it's not happy with certain files.


chandrika
EMPLOYEE

7 months ago

Glad you got it working!

A hunch is that the log, temp, dot folder had data that couldn't be pushed because they were just too large or had certain permissions that prevent the push.


Status changed to Awaiting User Response Railway 7 months ago


Status changed to Solved chandrika 7 months ago


chandrika

Glad you got it working!A hunch is that the log, temp, dot folder had data that couldn't be pushed because they were just too large or had certain permissions that prevent the push.

ben5516
PROOP

7 months ago

That was my guess as well. I wonder if the "403 Forbidden" text is from an actual HTTP error or rather a default error message. If it's the latter, an initial improvement to the CLI would be to improve the error messaging.


Status changed to Awaiting Railway Response Railway 7 months ago


Status changed to Solved ben5516 7 months ago


Loading...