"Project not found" and "Unauthorized. Please login with
railway login
"

6 months ago

Hey,

I keep getting "Unauthorized. Please login with railway login" when I try to link a service to my repository in a Dev Container in VS Code.

Here are the steps I have taken so far:

"node@c330773242b0:/workspaces/warpdomains$ railway status

Project Token not found

node@c330773242b0:/workspaces/warpdomains$ echo 'export RAILWAY_TOKEN=<token>' >> ~/.zshrc

source ~/.zshrc

node@c330773242b0:/workspaces/warpdomains$ railway status

Project: warp-domains

Environment: staging

Service: None

node@c330773242b0:/workspaces/warpdomains$ railway service

> Select a service warpdomains

Project not found. Run railway link to connect to a project.

node@c330773242b0:/workspaces/warpdomains$ railway link

Unauthorized. Please login with railway login

node@c330773242b0:/workspaces/warpdomains$ railway run --service warpdomains npm run dev

> warpdomains@1.0.0 dev

> nodemon app.mjs

[nodemon] 2.0.22

[nodemon] to restart at any time, enter rs

[nodemon] watching path(s): .

[nodemon] watching extensions: js,mjs,json

[nodemon] starting node app.mjs

Initializing Redis client...

Redis Configuration: {

hasRedisUrl: true,

hasRedisPublicUrl: true,

environment: 'development',

port: '3000'

}

Redis client connected

Starting application...

Environment check: {

NODE_ENV: 'development',

PWD: '/workspaces/warpdomains',

DIRNAME: '/workspaces/warpdomains'

}

Express app created

Starting server with environment variables: {

RAILWAY_ENVIRONMENT: 'staging',

PORT: '3000',

HAS_AXIOM_TOKEN: true,

HAS_DB_URL: true

}

Registering API routes...

API routes registered

Middleware and routes set up

Starting server...

Uncaught Exception: Error: listen EADDRINUSE: address already in use 0.0.0.0:3000

at Server.setupListenHandle [as _listen2] (node:net:1904:16)

at listenInCluster (node:net:1961:12)

at doListen (node:net:2135:7)

at process.processTicksAndRejections (node:internal/process/task_queues:83:21) {

code: 'EADDRINUSE',

errno: -98,

syscall: 'listen',

address: '0.0.0.0',

port: 3000

}

New database connection established

Database tables initialized successfully

System logs initialized successfully"

  1. (new terminal window)

node@c330773242b0:/workspaces/warpdomains$ railway link

Unauthorized. Please login with railway login

node@c330773242b0:/workspaces/warpdomains$ railway service

Project Token not found

node@c330773242b0:/workspaces/warpdomains$ echo 'export RAILWAY_TOKEN=<token>' >> ~/.zshrc

source ~/.zshrc

node@c330773242b0:/workspaces/warpdomains$ railway service

> Select a service warpdomains

Project not found. Run railway link to connect to a project.

node@c330773242b0:/workspaces/warpdomains$

Each time I try to login (with or without --browserless), it opens the window, I verify, see a 'success' message and when I return to VS Code it says Unauthorized.

Solved

2 Replies

6 months ago

Remove the RAILWAY_TOKEN variable and use only railway login


6 months ago

Thanks so much


Status changed to Solved brody 6 months ago


"Project not found" and "Unauthorized. Please login with `railway login`" - Railway Help Station