Whenever I run `wasp db migrate-dev` on my ec2 instance (micro free tier) it causes the box to hang

the free tier only has like 1gb of memory so that could be the issue. is there anyone else whos run into this problem?
16 Replies
Filip
Filip•9mo ago
Hm, I think that should be enough. Can you see the output? It might include clues to why it hangs (e.g., maybe it's waiting for a prompt).
beatdown_kai
beatdown_kaiOP•9mo ago
im not getting any error messages because the ssh connection closes, and I have to restart the instance to reconnect Im sshing into my instance, running wasp start db & then when i run wasp db migrate-dev it hangs when it starts building the sdk and btw thankyou for the quick response man but its doing work - like the first couple attempts it was still running npm install and I was just being impatient - i let it run for like 5 minutes and npm packages were installed
MEE6
MEE6•9mo ago
Wohooo @beatdown_kai, you just became a Waspeteer level 1!
beatdown_kai
beatdown_kaiOP•9mo ago
is there like a verbose option for the db-migrate?
Filip
Filip•9mo ago
Hmm, unfortunately, we don't have a verbose option, but if it hangs during "Building SDK", here's what we can do. After you get to the "Building SDK" stage, can you Ctrl+C and stay on the server with SSH? If so, do this:
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
This will build the SDK directly. Let's see if that hangs
beatdown_kai
beatdown_kaiOP•9mo ago
i cant ctrl+c when it gets to the "Building SDK stage" because it stops responding to my input, but Im gonna try rebooting the instance and running npx tsc directly.... one sec do i need wasp start db in the background to run npx tsc? and it ran, but I didn't get any output? should I rerun wasp db migrate-dev now or go ahead and start the app? oh man, wasp start is tryna build the SDK and its hanging again 😦
Filip
Filip•9mo ago
Hm, the problem is that the folder won't be there. Here's how it works: - wasp start or wasp db migrate-dev create the necessary folders in .wasp and then run commands inside them - One of this commands (npx tsc inside .wasp/out/sdk/wasp) hangs for you In other words, you need half of wasp start or wasp db migrate-dev to see the folder you need Let's try this. You can't Ctrl+C wasp db migrate-dev because it stops reading your input But you can still interrput it by sending the Ctrl+C signal from a different terminal. Here's how: 1. Open terminal 1, ssh into the machine 2. Start wasp db migrate-dev 3. When it hangs, open a different terminal 2, and again ssh into the machine 4. 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
beatdown_kai
beatdown_kaiOP•9mo ago
for some reason I cant ssh in from terminal 2 after running wasp db migrate-dev.... terminal 2 hangs if I'm already ssh'd in, and I cant ssh in after running wasp db migrate-dev on terimal 1 oh wait it works now lol well too early to say it works, but for some reason the terminal is actually getting my input now while wasp db migrate-dev is working in another terminal? im gonna do a screen recording at this point lol
MEE6
MEE6•9mo ago
Wohooo @beatdown_kai, you just became a Waspeteer level 2!
beatdown_kai
beatdown_kaiOP•9mo ago
should there be two migrate dev commands running??
No description
beatdown_kai
beatdown_kaiOP•9mo ago
I have a feeling the old migrate dev commands are still running or something? idk
No description
beatdown_kai
beatdown_kaiOP•9mo ago
followed these instructions and it seems like we made some progress, but now I'm running into this ...
...stuff...
[ Client!] Error: spawn xdg-open ENOENT
[ Client!] at ChildProcess._handle.onexit (node:internal/child_process:284:19)
[ Client!] at onErrorNT (node:internal/child_process:477:16)
[ Client!] at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
[ Client!] Emitted 'error' event on ChildProcess instance at:
[ Client!] at ChildProcess._handle.onexit (node:internal/child_process:290:12)
[ Client!] at onErrorNT (node:internal/child_process:477:16)
[ Client!] at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
[ Client!] errno: -2,
[ Client!] code: 'ENOENT',
[ Client!] syscall: 'spawn xdg-open',
[ Client!] path: 'xdg-open',
[ Client!] spawnargs: [ 'http://localhost:3000/' ]
[ Client!] }
[ Client!]
[ Client!] Node.js v18.18.2
...stuff...
[ Client!] Error: spawn xdg-open ENOENT
[ Client!] at ChildProcess._handle.onexit (node:internal/child_process:284:19)
[ Client!] at onErrorNT (node:internal/child_process:477:16)
[ Client!] at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
[ Client!] Emitted 'error' event on ChildProcess instance at:
[ Client!] at ChildProcess._handle.onexit (node:internal/child_process:290:12)
[ Client!] at onErrorNT (node:internal/child_process:477:16)
[ Client!] at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
[ Client!] errno: -2,
[ Client!] code: 'ENOENT',
[ Client!] syscall: 'spawn xdg-open',
[ Client!] path: 'xdg-open',
[ Client!] spawnargs: [ 'http://localhost:3000/' ]
[ Client!] }
[ Client!]
[ Client!] Node.js v18.18.2
needed to change vite config so it doesnt open on startup sickk, its kinda working! thanks for all ur help
Filip
Filip•9mo ago
@beatdown_kai Glad to hear it! What was the issue in the end? tsc taking too long? Just to make sure we're all on the same page - How come you're running wasp start in your container? That should be for development only, deployed apps (which I'm assuming this is) should use wasp build.
martinsos
martinsos•9mo ago
Error: spawn xdg-open ENOENT is due to the fact that your server doesn't have an X server, and Vite is trying to open a browser tab for you. You can avoid that by modifying vite config with an option that tells it not to do that 1GB might not be enough in general though, Wasp runs quite a few things at the same time
TylerBastian
TylerBastian•7mo ago
Hey, face the same problem... may i ask, how to modify the vite config to avoid it? Not so familiar with code... but have tried to change the status of open from true to false in vite.config.ts. After the modify, eventhough i can get access via ip:port to the app, but get a error message...
[nodemon] app crashed - waiting for file changes before starting
[nodemon] app crashed - waiting for file changes before starting
martinsos
martinsos•7mo ago
Hm so that sounds like your server is crashing! Any more details you can share regarding that? More logs from the server? Did it work at any point? Is this in development or in production?
Want results from more Discord servers?
Add your server