R
Railway13mo ago
Terry

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
Percy
Percy13mo ago
Project ID: d6360c76-95aa-49e2-90db-62587e583b43
Terry
Terry13mo ago
d6360c76-95aa-49e2-90db-62587e583b43
Brody
Brody13mo ago
can you show me a screenshot of your service variables please
Terry
Terry13mo ago
Brody
Brody13mo ago
please make sure all database variables are variable references https://docs.railway.app/develop/variables#reference-variables
Terry
Terry13mo ago
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
Brody
Brody13mo ago
please show me the screenshot again?
Terry
Terry13mo ago
2023-07-12 19:07:08.019 UTC [1] LOG: starting PostgreSQL 13.2 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.2.1_pre1) 10.2.1 20201203, 64-bit
2023-07-12 19:07:08.019 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2023-07-12 19:07:08.019 UTC [1] LOG: listening on IPv6 address "::", port 5432
2023-07-12 19:07:08.023 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-07-12 19:07:08.029 UTC [62] LOG: database system was shut down at 2023-07-12 19:07:07 UTC
2023-07-12 19:07:08.034 UTC [1] LOG: database system is ready to accept connections
2023-07-12 19:07:08.036 UTC [68] LOG: TimescaleDB background worker launcher connected to shared catalogs
2023-07-12 19:07:08.454 UTC [72] LOG: the "timescaledb" extension is not up-to-date
2023-07-12 19:07:08.454 UTC [72] HINT: The most up-to-date version is 2.11.1, the installed version is 2.1.1.
2023-07-12 19:10:09.872 UTC [99] LOG: could not accept SSL connection: No error information
2023-07-12 20:07:07.994 UTC [468] LOG: the "timescaledb" extension is not up-to-date
2023-07-12 20:07:07.994 UTC [468] HINT: The most up-to-date version is 2.11.1, the installed version is 2.1.1.
2023-07-12 20:07:08.386 UTC [469] LOG: the "timescaledb" extension is not up-to-date
2023-07-12 20:07:08.386 UTC [469] HINT: The most up-to-date version is 2.11.1, the installed version is 2.1.1.
2023-07-12 21:07:07.634 UTC [836] LOG: the "timescaledb" extension is not up-to-date
2023-07-12 21:07:07.634 UTC [836] HINT: The most up-to-date version is 2.11.1, the installed version is 2.1.1.
2023-07-12 21:07:08.377 UTC [837] LOG: the "timescaledb" extension is not up-to-date
2023-07-12 21:07:08.377 UTC [837] HINT: The most up-to-date version is 2.11.1, the installed version is 2.1.1.
2023-07-12 19:07:08.019 UTC [1] LOG: starting PostgreSQL 13.2 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.2.1_pre1) 10.2.1 20201203, 64-bit
2023-07-12 19:07:08.019 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2023-07-12 19:07:08.019 UTC [1] LOG: listening on IPv6 address "::", port 5432
2023-07-12 19:07:08.023 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-07-12 19:07:08.029 UTC [62] LOG: database system was shut down at 2023-07-12 19:07:07 UTC
2023-07-12 19:07:08.034 UTC [1] LOG: database system is ready to accept connections
2023-07-12 19:07:08.036 UTC [68] LOG: TimescaleDB background worker launcher connected to shared catalogs
2023-07-12 19:07:08.454 UTC [72] LOG: the "timescaledb" extension is not up-to-date
2023-07-12 19:07:08.454 UTC [72] HINT: The most up-to-date version is 2.11.1, the installed version is 2.1.1.
2023-07-12 19:10:09.872 UTC [99] LOG: could not accept SSL connection: No error information
2023-07-12 20:07:07.994 UTC [468] LOG: the "timescaledb" extension is not up-to-date
2023-07-12 20:07:07.994 UTC [468] HINT: The most up-to-date version is 2.11.1, the installed version is 2.1.1.
2023-07-12 20:07:08.386 UTC [469] LOG: the "timescaledb" extension is not up-to-date
2023-07-12 20:07:08.386 UTC [469] HINT: The most up-to-date version is 2.11.1, the installed version is 2.1.1.
2023-07-12 21:07:07.634 UTC [836] LOG: the "timescaledb" extension is not up-to-date
2023-07-12 21:07:07.634 UTC [836] HINT: The most up-to-date version is 2.11.1, the installed version is 2.1.1.
2023-07-12 21:07:08.377 UTC [837] LOG: the "timescaledb" extension is not up-to-date
2023-07-12 21:07:08.377 UTC [837] HINT: The most up-to-date version is 2.11.1, the installed version is 2.1.1.
Terry
Terry13mo ago
Terry
Terry13mo ago
Brody
Brody13mo ago
why are they all shared variables?? i never mentioned anything about shared variables, please undo all of that
Terry
Terry13mo ago
Done
Brody
Brody13mo ago
another screenshot please
Terry
Terry13mo ago
Brody
Brody13mo ago
please make sure all database variables are variable references https://docs.railway.app/develop/variables#reference-variables
Terry
Terry13mo ago
[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
DATABASE_URL=${{DATABASE_HOST}}
PGDATABASE=${{DATABASE_NAME}}
PGHOST=${{DATABASE_HOST}}
PGPASSWORD=${{DATABASE_PASSWORD}}
PGPORT=${{DATABASE_PORT}}
PGUSER=${{DATABASE_USERNAME}}
DATABASE_URL=${{DATABASE_HOST}}
PGDATABASE=${{DATABASE_NAME}}
PGHOST=${{DATABASE_HOST}}
PGPASSWORD=${{DATABASE_PASSWORD}}
PGPORT=${{DATABASE_PORT}}
PGUSER=${{DATABASE_USERNAME}}
Brody
Brody13mo ago
another screenshot please
Terry
Terry13mo ago
Brody
Brody13mo ago
without cropping please
Terry
Terry13mo ago
Brody
Brody13mo ago
please make sure all database variables are variable references https://docs.railway.app/develop/variables#reference-variables
Terry
Terry13mo ago
What am I missing?
Brody
Brody13mo ago
your database variables are not variable references
Terry
Terry13mo ago
so I need to delete all the DATABASE_?
Brody
Brody13mo ago
sure, whatever is easiest for you
Terry
Terry13mo ago
Brody
Brody13mo ago
it is highly advisable to use the standardized names
Brody
Brody13mo ago
Terry
Terry13mo ago
Okay, so I'll have to change it on Strapi's end?
Brody
Brody13mo ago
one thing at a time please use the standardized variable names for your reference variables
Terry
Terry13mo ago
show me an example
Brody
Brody13mo ago
Brody
Brody13mo ago
the drop-down uses these variable names by default, you would have had to change them manually, don't do that please
Terry
Terry13mo ago
It still doesn't work. I found my solution
Terry
Terry13mo ago
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...
Brody
Brody13mo ago
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
Terry
Terry13mo ago
The way you're explaining it, I'm not understanding I'm sorry if I sound difficult
Brody
Brody13mo ago
it just seems like you weren't trying
Terry
Terry13mo ago
Terry
Terry13mo ago
believe me, I am. I'm changing things and reading this over and over
Brody
Brody13mo ago
well you said it works now?
Terry
Terry13mo ago
No
Brody
Brody13mo ago
so may we continue?
Terry
Terry13mo ago
yes, please
Brody
Brody13mo ago
your railway variables now look good please send your database.js file
Terry
Terry13mo ago
Brody
Brody13mo ago
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
Terry
Terry13mo ago
done waiting for build Okay, the problem was never the variables. The problem was this
Terry
Terry13mo ago
Terry
Terry13mo ago
I don't know where that came from but that was the problem.
Brody
Brody13mo ago
correction, the variables where a problem, but not the only problem
Terry
Terry13mo ago
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 ✅
Brody
Brody13mo ago
well finally solved 🥳
Terry
Terry13mo ago
Sorry for the headache
Brody
Brody13mo ago
you're forgiven ❤️