Strapi won't load on Railway App
I keep getting a message saying WARNING: An error occurred while requesting the API
This is a fresh install and not sure what I'm missing. It's working on localhost but not on Railway.
55 Replies
Project ID:
d6360c76-95aa-49e2-90db-62587e583b43
d6360c76-95aa-49e2-90db-62587e583b43
can you show me a screenshot of your service variables please
please make sure all database variables are variable references
https://docs.railway.app/develop/variables#reference-variables
Yes, I have done that. Not sure what else to do. I'm matching up with the other Strapi on Railway and everything aligned the same
please show me the screenshot again?
why are they all shared variables??
i never mentioned anything about shared variables, please undo all of that
Done
another screenshot please
please make sure all database variables are variable references
https://docs.railway.app/develop/variables#reference-variables
[2023-07-12 21:28:58.340] debug: ⛔️ Server wasn't able to start properly.
[2023-07-12 21:28:58.342] error: database "containers-us-west-203.railway.app" does not exist
another screenshot please
without cropping please
please make sure all database variables are variable references
https://docs.railway.app/develop/variables#reference-variables
What am I missing?
your database variables are not variable references
so I need to delete all the DATABASE_?
sure, whatever is easiest for you
it is highly advisable to use the standardized names
Okay, so I'll have to change it on Strapi's end?
one thing at a time
please use the standardized variable names for your reference variables
show me an example
the drop-down uses these variable names by default, you would have had to change them manually, don't do that please
It still doesn't work. I found my solution
DEV Community
How to create and deploy a Strapi project on Railway
Railway is a cloud platform based on Heroku that makes it easy to deploy you app on the cloud. You...
a lot of bad practices in that guide
all you needed to do was setup your variables correctly in railway and then we would have moved on to utilizing the variables correctly in strapi
The way you're explaining it, I'm not understanding
I'm sorry if I sound difficult
it just seems like you weren't trying
believe me, I am. I'm changing things and reading this over and over
well you said it works now?
No
so may we continue?
yes, please
your railway variables now look good
please send your database.js file
lots of stuff going on there that you don't need, just simply use this instead
https://github.com/railwayapp-templates/strapi/blob/main/config/database.js
done
waiting for build
Okay, the problem was never the variables. The problem was this
I don't know where that came from but that was the problem.
correction, the variables where a problem, but not the only problem
This is strapi@latest and that was new to me. All the other strapi doesn't have it. It was weird that I was able to connect on localhost but then not on serverside.
well, yes the variables was a problem too because I kept changing them LOL
✅
well finally solved 🥳
Sorry for the headache
you're forgiven ❤️