W
Wasp-langβ€’8mo ago
WWWillems

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
miho
mihoβ€’8mo ago
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...
miho
mihoβ€’8mo ago
Opening the tunnel in one terminal and the in a different terminal running the seed command πŸ™‚
WWWillems
WWWillemsβ€’8mo ago
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 correct
MEE6
MEE6β€’8mo ago
Wohooo @WWWillems, you just became a Waspeteer level 1!
WWWillems
WWWillemsβ€’8mo ago
Also pretty sure the production db is running, as I've managed to use social login to authenticate.
miho
mihoβ€’8mo ago
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
WWWillems
WWWillemsβ€’8mo ago
Yes Yes The dev DB was still running yes πŸ€¦β€β™‚οΈ, ill try again in a bit. Thanks πŸ™
MEE6
MEE6β€’8mo ago
Wohooo @WWWillems, you just became a Waspeteer level 2!
miho
mihoβ€’8mo ago
Sure 😊 you can always try connecting with a GUI for DB like https://dbeaver.io/ as a sanity check
Serge
DBeaver Community
DBeaver
WWWillems
WWWillemsβ€’8mo ago
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 πŸ™
matijash
matijashβ€’8mo ago
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
WWWillems
WWWillemsβ€’8mo ago
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.