Hello!
I’m following the RedwoodJS Tutorial and I got stuck at:
I’m trying to change the Database from the local SQLite to Railway.
When I run “yarn rw prisma migrate dev” at the terminal to recreate the migration, I get:
“Error: P1001: Can’t reach database server at postgres.railway.internal:5432
Please make sure your database server is running at postgres.railway.internal:5432
.”
The steps I’ve taken so far in this chapter:
- Railway has been installed and its database server seems to be running; The psql shell, after having entered all the parameters and password, gives me a “postgres=#” prompt. Container seems to be up and running.
- “Started a New Project”, with “Provision PostgreSQL”.
- Updated the datasource db provider (= ‘postgresql’) at the schema.prisma file.
- Entered the value I copied from the DATABASE_URL variable (The Variables section) in the .env file:
DATABASE_URL=postgresql://postgres:wxiApHDCsVLQaPghUiiEpxLzPtQwmVrF@postgres.railway.internal:5432/railway (and uncommented)
- Deleted the api/db/migrations folder
Then, when I run “yarn rw prisma migrate dev” at the terminal to recreate the migration, I get:
“Error: P1001: Can’t reach database server at postgres.railway.internal:5432
Please make sure your database server is running at postgres.railway.internal:5432.”
I’ve tried wrapping the URI with single/double quotes ‘’/“”, and disabling the VPN with the same result.
The address stored at the Railway Postgre environment variable DATABASE_PUBLIC_URL CAN be reached, but if I use that instead, later on the Netlify deploy stops with error at the building section. The DATABASE_URL is the one required, according to the instructions, but that one cannot be reached during the migrate recreation.
I’m a noob on development, so I’m not really sure how to troubleshoot this, or what feedback info might pertain the most, but I’m very excited to look further into this if anyone is willing to give me a few pointers.
You can find my repo at:
VSCode 1.93.1 @win11 , Node.js 20.11.1, yarn 1.22.22.
Please, let me know if I could provide any logs or additional information that could be of more assistance.