W
Wasp-langβ€’4mo ago
Guerilla

DB wont setup

Man, anyone got some tips for getting my db up and running again. wasp db migrate-dev just hangs.
20 Replies
kapa.ai
kapa.aiβ€’4mo ago
Hi @Guerilla. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I'm sorry to hear that you're having trouble with setting up your database using wasp db migrate-dev. Here are a few steps you can try based on the information from the knowledge sources: 1. Check the output: If there's any output before it hangs, it might include clues as to why it's hanging. For example, it might be waiting for a prompt. 2. Try building the SDK directly: If it hangs during the "Building SDK" stage, you can try to build the SDK directly. Here's how you can do it:
wasp start db &
wasp db migrate-dev # cancel the command with Ctrl+C when it gets to building the SDK
cd .wasp/out/sdk/wasp
npx tsc
wasp start db &
wasp db migrate-dev # cancel the command with Ctrl+C when it gets to building the SDK
cd .wasp/out/sdk/wasp
npx tsc
3. Interrupt the hanging command: If you can't Ctrl+C wasp db migrate-dev because it stops reading your input, you can still interrupt it by sending the Ctrl+C signal from a different terminal. Here's how:
# Open terminal 1, ssh into the machine
# Start `wasp db migrate-dev`
# When it hangs, open a different terminal 2, and again ssh into the machine
# In terminal 2, execute `kill $(pgrep wasp)` and it should interrupt `wasp db migrate-dev` running in the first terminal
# Open terminal 1, ssh into the machine
# Start `wasp db migrate-dev`
# When it hangs, open a different terminal 2, and again ssh into the machine
# In terminal 2, execute `kill $(pgrep wasp)` and it should interrupt `wasp db migrate-dev` running in the first terminal
At this point, use any of the terminals to execute npx tsc in .wasp/out/sdk/wasp. If none of these steps work, there might be an issue with the Wasp framework itself. In that case, you might want to report the issue on the Wasp Github page (https://github.com/wasp-lang/wasp/issues). Please note that these steps are based on the information from the knowledge sources (https://discord.com/channels/686873244791210014/1217483832404611195) and might not solve your specific issue. If you're still having trouble, I recommend reaching out to the Wasp community for more specific help. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Guerilla, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
Guerilla
Guerillaβ€’4mo ago
(base) ➜ app git:(master) βœ— wasp db migrate-dev 🐝 --- Compiling wasp project... -------------------------------------------------- βœ… --- Successfully completed npm install. ---------------------------------------- 🐝 --- Setting up database... ----------------------------------------------------- It hangs here, should i delete the db entirely?
miho
mihoβ€’4mo ago
What kind of DB are you using, Postgres or Sqlite? Are you running the DB with the wasp start db?
Guerilla
Guerillaβ€’4mo ago
Postgres, and no - I am managing the DB myself as I have other psql dbs running :). Fedora 37 0.13.2 wasp psql 14.9
miho
mihoβ€’4mo ago
You've setup the DATABASE_URL in the .env.server correctly? With the host, username, pw and the db name?
Guerilla
Guerillaβ€’4mo ago
I had an issue with the schema possibly, so it asked me if I wanted to lose all my data etc..
MEE6
MEE6β€’4mo ago
Wohooo @Guerilla, you just became a Waspeteer level 1!
Guerilla
Guerillaβ€’4mo ago
So I said yes
miho
mihoβ€’4mo ago
IMHO if you can, drop the DB and delete the migrations folder and run wasp clean to clean up. Then see if it works with a clean start
Guerilla
Guerillaβ€’4mo ago
Ok, will it create the DB or no When its not managed
miho
mihoβ€’4mo ago
It won't create the DB if I recall correctly πŸ˜„ that's something @sodic discovered since he manages his DBs on Linux as well I'll let him chime in when he can, but try creating a DB and let's see what happens
Guerilla
Guerillaβ€’4mo ago
ERROR: database "wasp_recipes" is being accessed by other users DETAIL: There are X other sessions using the database. postgres=# Hmm. Thats probably the problem lmao LMfao.. yeeeerp Sorry, there was 25 Idk why I blanked that one out. Thanks πŸ˜„
miho
mihoβ€’4mo ago
there was 25 Idk why I blanked that one out.
25 active sessions? I didn't quite get this πŸ˜„ I'm glad it worked out
Filip
Filipβ€’4mo ago
It will by default, unless you do something weird with jobs. We have an edge case that manifests in some apps (e.g. Open Saas), but by design, Wasp should create a misaing database. So of that doesn't happen, please give us more details πŸ˜…
Guerilla
Guerillaβ€’4mo ago
Yeah, im using Open Saas πŸ˜›
Want results from more Discord servers?
Add your server