getting 500 while login
gokul704
HOBBYOP

2 months ago

while i am trying to login i am getting 500 but i am connected to database but still i am getting 500 alll my services are up

$10 Bounty

4 Replies

A 500 error means your application code is throwing an unhandled exception during the login process—this isn't a Railway platform issue. The good news is your logs will tell you exactly what's going wrong.

Head to your service's Deployments tab and check the logs for your running deployment. Look for any error messages or stack traces that appear when you try to log in. Common culprits during authentication include database query failures, missing environment variables that your auth logic needs, unhandled null or undefined values, session or cookie misconfiguration, or ORM/driver errors.

Once you spot the error message in the logs, you'll know what to fix in your code. If you want to share the specific error you're seeing, I can help you work through it.


Status changed to Awaiting User Response Railway 2 months ago


gokul704
HOBBYOP

2 months ago

2025-12-31T05:49:51.099001956Z [inf] white_check_mark emoji Connected to PostgreSQL database 2025-12-31T05:49:51.099008264Z [err] Login error: error: relation "users" does not exist 2025-12-31T05:49:51.099012893Z [err] at /app/node_modules/pg-pool/index.js:45:11 2025-12-31T05:49:51.099017145Z [err] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 2025-12-31T05:49:51.099021240Z [err] at async login (/app/src/controllers/authController.js:58:20) { 2025-12-31T05:49:51.099026050Z [err] length: 104, 2025-12-31T05:49:51.099030592Z [err] severity: 'ERROR', 2025-12-31T05:49:51.099035416Z [err] code: '42P01', 2025-12-31T05:49:51.099040607Z [err] detail: undefined, 2025-12-31T05:49:51.099046044Z [err] hint: undefined, 2025-12-31T05:49:51.099050386Z [err] position: '53', 2025-12-31T05:49:51.099056115Z [err] internalPosition: undefined, 2025-12-31T05:49:51.099060435Z [err] internalQuery: undefined, 2025-12-31T05:49:51.099064230Z [err] where: undefined, 2025-12-31T05:49:51.099068342Z [err] schema: undefined, 2025-12-31T05:49:51.099072503Z [err] table: undefined, 2025-12-31T05:49:51.099078433Z [err] column: undefined, 2025-12-31T05:49:51.099083165Z [err] dataType: undefined, 2025-12-31T05:49:51.099086731Z [err] constraint: undefined, 2025-12-31T05:49:51.099091096Z [err] file: 'parse_relation.c', 2025-12-31T05:49:51.099094668Z [err] line: '1449', 2025-12-31T05:49:51.099098663Z [err] routine: 'parserOpenTable' 2025-12-31T05:49:51.099102837Z [err] } 2025-12-31T05:49:51.099107512Z [inf] POST /api/auth/login 500 89.702 ms - 42


Status changed to Awaiting Railway Response Railway 2 months ago


I'd make sure your database is structured correctly such that the specific table you're trying to access has a relation to the users table.


ilyassbreth
FREE

2 months ago

your database doesn't have a users table. you're connected to postgres fine but the table just doesn't exist yet

you need to run your database migrations or create the users table manually. if you're using an orm like prisma do npx prisma migrate deploy or whatever your migration command is. if you're doing raw sql you gotta run your create table script

basically your app code is trying to query a table that hasn't been created in the database yet

hope this help you


Loading...