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
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).
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 installedWohooo @beatdown_kai, you just became a Waspeteer level 1!
is there like a verbose option for the db-migrate?
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:
This will build the SDK directly. Let's see if that hangs
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 😦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
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 lolWohooo @beatdown_kai, you just became a Waspeteer level 2!
should there be two migrate dev commands running??
I have a feeling the old migrate dev commands are still running or something? idk
followed these instructions and it seems like we made some progress, but now I'm running into this ...
needed to change vite config so it doesnt open on startup
sickk, its kinda working!
thanks for all ur help
@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
.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 timeHey, 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...
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?