R
Railway2y ago
Seb

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
Percy
Percy2y ago
Project ID: N/A
Seb
SebOP2y ago
N/A
Percy
Percy2y ago
You might find these helpful: - Noco DB - 500 error on api call nextjs - laravel api broken
⚠️ experimental feature
Seb
SebOP2y ago
Some modules in build are even throwing errors.
Adam
Adam2y ago
Going to need to see those errors + the repo if public + the project ID
Seb
SebOP2y ago
Well the weird thing is that there are no errors in deploy logs.
Seb
SebOP2y ago
In the xx.com, the Strapi is running ok
Seb
SebOP2y ago
Seb
SebOP2y ago
But when opening the /admin route, I get this error.
Seb
SebOP2y ago
Seb
SebOP2y ago
... even though it literally says 200... 😄
Seb
SebOP2y ago
The repo, there's not much to see, it's the forked (autogenerated) template from Railway when you select Strapi.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Seb
SebOP2y ago
Happy to hear I'm not the only one.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Seb
SebOP2y ago
Alright, that looks okay But still... 😄 so you just manually create a service from a Github repo?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Seb
SebOP2y ago
@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 ? :D
Seb
SebOP2y ago
Finn
Finn2y ago
NODE_ENV is probably set to production
Seb
SebOP2y ago
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.
Finn
Finn2y ago
are you using sqlite
Seb
SebOP2y ago
No, PostgreSQL
Finn
Finn2y ago
not sure then it shouldnt be getting wiped maybe your migrations are nuking everything?
Seb
SebOP2y ago
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
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Seb
SebOP2y ago
Yes, thank you, I managed to get it working... but what a hassle, argh!
endymion1818
endymion18182y ago
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
endymion1818
endymion18182y ago
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/7
Strapi Community Forum
Could not load js config file config/database.js: Cannot read prope...
@akramaskar You saved my life maaaaan! 💙
Want results from more Discord servers?
Add your server