Server-Side Errors
How to find and fix Railway deploy logs, API route errors, and 500 responses.
What Are Server-Side Errors?
Server-side errors happen on the server (Railway), not in your browser. You might see:
- A "500 Internal Server Error" message in the browser
- An API request that returns an error
- A deploy that fails on Railway
The browser cannot tell you the details — you need to check the server logs.
How to Check Railway Logs
Step 1: Find the Logs
Go to the Railway dashboard, select your service, click the Deployments tab, and click View logs on the active deployment.

Step 2: Find the Error
In the Deploy Logs tab, look for red lines — these are errors. Normal log lines are white/gray.

Step 3: Copy the Error Message
Click on the red error line to expand its details. You will see the full error message in the Name/Value attributes. Copy this text and give it to Claude.

Server logs show everything the app prints while running, including error messages with file names and line numbers.
Understanding 500 Errors
When the browser shows "500 Internal Server Error", it means something crashed on the server. The browser only knows something went wrong — the details are in Railway logs.
API Route Errors
Next.js API routes (app/api/...) run on the server. Common issues:
| Problem | Likely Cause |
|---|---|
| 500 error on API call | Bug in the API route code (check Railway logs) |
| 404 on API call | Wrong URL path or missing API file |
| Empty response | Database query returned no data |
| Timeout | Query too slow or infinite loop |
Testing API Routes Locally
You can test API routes locally before pushing:
# Start the dev server
pnpm dev:your-app-name
# In another terminal, test the API
curl http://localhost:3000/api/your-routeNote: API routes that query the database will not work locally (database is only available in PR preview environments). But you can still check for syntax errors and logic issues.
Common Server Error Causes
- Missing environment variables — a variable required by the app is not set in Railway
- Database query errors — wrong table name, wrong column, SQL syntax error
- Import errors — importing a file or package that does not exist
- Type errors at runtime — passing wrong data types to functions
Checking Preview Deploy Logs
When your PR preview deployment is not working:
Quiz
Where do you find the details of a 500 Internal Server Error?