Strapi failing when deployed from the template
Is there possibly a bug? When I go to url.com/admin, it shows
An error occurred while requesting the API
Any idea what could be wrong? I did not change anything.29 Replies
Project ID:
N/A
N/A
⚠️ experimental feature
Some modules in build are even throwing errors.
Going to need to see those errors + the repo if public + the project ID
Well the weird thing is that there are no errors in deploy logs.
In the xx.com, the Strapi is running ok
But when opening the /admin route, I get this error.
... even though it literally says 200... 😄
The repo, there's not much to see, it's the forked (autogenerated) template from Railway when you select Strapi.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Happy to hear I'm not the only one.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Alright, that looks okay
But still... 😄
so you just manually create a service from a Github repo?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
@cq
connect ECONNREFUSED 0.0.0.0:5432
When starting the server, it's showing this, any idea why?
My PostgreSQL setup was apparently wrong.
It's up and running, but I need a develop env.
Why does it run in production when I literally started with npm run develop
? :DNODE_ENV is probably set to production
Yes, that was the reason, thanks.
Any idea why the whole database (all collections and everything) is wiped after redeploying?
When it's running on dev mode and I redeploy, (to dev again) for some reason, it deletes the created collection.
For this example, I want to be running dev env even in the final use, because of the collections creating and so on.
are you using sqlite
No, PostgreSQL
not sure then
it shouldnt be getting wiped
maybe your migrations are nuking everything?
I'm investigating it a bit more now
I don't know, but in case they might, I really don't want them to do that :D
Yes, when I redeploy the service, the postgresql table with the "Single type" I added in the Strapi admin panel suddenly disappears.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Yes, thank you, I managed to get it working... but what a hassle, argh!
Thanks everyone you also helped me to get my environment working, although I took a slightly different track because I wanted to continue to use the Railway template, and to dockerize it so I could also run it locally. So after deployment I cloned the repo, used https://github.com/strapi-community/strapi-tool-dockerize and added the environment variables that were generated in the Railway deployment. In this case I couldn't parse the connection string so I had to supply the environment variables to the config file directly as shown in the screenshot.
As an aside I do think I have an unused container running postgres somewhere but I'll sort that out.
GitHub
GitHub - strapi-community/strapi-tool-dockerize: Easy add support f...
Easy add support for docker to your strapi project - GitHub - strapi-community/strapi-tool-dockerize: Easy add support for docker to your strapi project
If anyone is bumping into an error that has something to do with
charAt
, the answer is here https://forum.strapi.io/t/could-not-load-js-config-file-config-database-js-cannot-read-property-charat-of-undefined/1630/7Strapi Community Forum
Could not load js config file config/database.js: Cannot read prope...
@akramaskar You saved my life maaaaan! 💙