a month ago
Hello, first time poster and new to Railway. I hope I am in the right place.
I have coded a simple session based log in site; MySQL database, Java Spring-boot backend and Angular frontend. Everything works as expected when run locally on my computer. After deploy to Railway I have noticed a strange behavior in that some (and I really mean 'some'...) endpoints fail. The logs say:
Table 'railway.TODO' doesn't exist
Table 'railway.IMAGE' doesn't exist
SQL Error: 1146, SQLState: 42S02
etc.
Some findings:
1) I set up a direct connection to the MySQL service in Workbench and all the tables my code creates do exist. I can query them and they return the correct data.
2) I have endpoints calling the same table - with different queries - and some work. For example, I can add a ToDo but I can't read all ToDos.
3) The requests that fail return a generic 500 Internal server error. It's not an exception I can trace backwards where it origins.
4) It's always the same endpoints that fail and I see no pattern. They aren't particularly demanding queries and the data set is really small.
Any ideas greatly appreciated! Best regards //Patrik
4 Replies
a month ago
Hey there! We've found the following might help you get unblocked faster:
🧵 Issues Deploying Node.js Application to Railway After Database Schema Change
🧵 Unable to Create or See Tables in Railway Postgres from Deployed Backend
If you find the answer from one of these, please let us know by solving the thread!
a month ago
Hi! Is your database also running on Railway? if so, you can check if the data is as you expect in the "Data" tab of your database. It sounds like all the tables are there, but not all the columns.
a month ago
Oh actually the tables do exist as you said. Are you sure the spelling in both the endpoints are exactly the same? looks like the ones that cant be found are in caps. Table names are case sensitive.
a month ago
Hi, thanks danny for the reply. I am not at home at the moment to try but you made me think there. It could be related to the JPA @Query annotation in Java, if you are familiar... Sometimes I've use the built in JPA methods, other times I have written custom queries with @Query ("SELECT * FROM ... ). I will check if I can distinguish a pattern, if only the custom queries fail because I have used capital letters for the table name.