How to seed production database using fly proxy -a <app_name>
Hi! I've successfully deployed my app to fly.io. Now I'm trying to seed my production database following the guide in this PR: https://github.com/wasp-lang/wasp/pull/1524/commits/baa9c01ce240c94a088de7fba6ac682b7748c98d
But I'm stuck after (successfully) opening the tunnel. The tunnel command says
Proxying local port 5432 to remote
which looks ok. Problem is the tunnel stays open and I cant enter my next command. How do I open the tunnel in a headless way so I can run the actual seed? I've added the DATABASE_URL
to my .env.server
file.
It would be nice if the documentation could be updated to include a dedicated part for this. I feel the PR linked above should also be a bit improved with the headless part.
Thanks for all the work you've put in so far. I've really enjoyed using Wasp so far! πGitHub
Updated the database docs on seeding the production DB on Fly. by V...
Description
This PR aims to resolve the issue #1464 .
Select what type of change this PR introduces:
Just code/docs improvement (no functional change).
Bug fix (non-breaking change which fixes a...
12 Replies
Here are instructions that worked for me last time: https://github.com/wasp-lang/wasp/issues/1464
GitHub
Update the database docs on seeding the production DB on Fly Β· Issu...
We are looking to update this section of the docs to include instructions on how to seed a production db: https://wasp-lang.dev/docs/data-model/backends#seeding-the-database This is a tested workfl...
Opening the tunnel in one terminal and the in a different terminal running the seed command π
Thanks for responding!
I've followed your link and tried running the seed command in a second terminal but I'm getting this error:
The database needs to be running in order to execute this command. You can easily start a managed dev database with
wasp start db
.
Although the proxy tunnel is running π€
also 99% sure the DATABASE_URL
is correctWohooo @WWWillems, you just became a Waspeteer level 1!
Also pretty sure the production db is running, as I've managed to use social login to authenticate.
This error might mean the DB connection is not successful π¬
Did you try following the Github issue instructions one more time? Did you find your DB name and DB password?
Did you set the DATABASE_URL in .env.server? π
One other thing, maybe you have some other DB running locally on port 5432? Then I would advise trying to use a different port in all of the commands e.g. 5555
Yes
Yes
The dev DB was still running yes π€¦ββοΈ, ill try again in a bit. Thanks π
Wohooo @WWWillems, you just became a Waspeteer level 2!
Sure π you can always try connecting with a GUI for DB like https://dbeaver.io/ as a sanity check
I tried connecting w Postico bit that didnt work. Ill try again without dev DB this afternoon. Will keep you posted. Thanks for helping!
@miho Issue is resolved. My dev database was still running (in another terminal) so that's why the production seed couldn't run/connect to my Fly instance in production. Thanks again for helping π
glad it is resolved and can't wait to see the final result! π Also might be useful to mention this in our docs, so others don't fall into the same problem
Yep mentioning would be better. Perhaps also look into improving the error if possible. Wasn't clear now.
Still struggling to connect my Postico (DB GUI) though. Will look into it later.