3 months ago
Hey all, I’m trying to deploy a Spring Boot 3.4.2 backend on Railway with PostgreSQL.
My application.properties uses:
spring.datasource.url=${DATABASEURL} spring.datasource.username=${DATABASEUSERNAME}
spring.datasource.password=${DATABASE_PASSWORD}
spring.datasource.driver-class-name=org.postgresql.Driver
On Railway, I’ve set the variables based on the default PostgreSQL plugin values.
Logs show the app starts normally, finds all JPA repositories, then after Tomcat started on port 8080, it just silently restarts.
No obvious exceptions — it seems to crash right after everything boots.
Could this be a DATABASE_URL formatting issue? Or am I missing something about how Railway injects environment variables into the container?
Any help would be appreciated 🙏
0 Replies
3 months ago
check your activity logs, are you running out of memory
Yes Im getting an email: Deploy Ran Out of Memory!
Uh oh. Your deployment for tutor-app-platform in beautiful-radiance ran out of memory within the production environment and crashed.
Its my first time deploying a spring boot app so I could be missing something obvious
3 months ago
you are limited to 500mb of memory on trial, since you need more you will need to upgrade to a paid plan
Just to check in order to connect Spring boot app to PgSql database I need spring.datasource.url=${DATABASEURL} with DATABASEURL being jdbc:postgresql://postgres.railway.internal:5432/railway
But the fact that it seems to restart spring boot without throwing any clear errors makes me think its an issue of misconfigured environment more than memory
3 months ago
the error you got says you ran out of memory
3 months ago
!s
Status changed to Solved brody • 3 months ago