open-saas icon indicating copy to clipboard operation
open-saas copied to clipboard

wasp db studio failing to start after shutting it down

Open fantapop opened this issue 1 year ago • 2 comments

I went through the installation process shown here

As I stepped through I was able to run wasp db studio and have it work. I briefly clicked around but there was no data there so it was uninteresting. I continued to follow the installation instructions. I started the app and created a user and a todo item. Then I went back to run wasp db studio again and its failing to start up.

I see this:

➜  app git:(main) wasp db studio

🐝 --- Compiling wasp project... --------------------------------------------------


🐝 --- Setting up database... -----------------------------------------------------


✅ --- Database successfully set up. ----------------------------------------------


✅ --- Your wasp project has successfully compiled. -------------------------------


🐝 --- Running studio... ----------------------------------------------------------


[Db]      Environment variables loaded from .env
[Db]      Prisma schema loaded from ../db/schema.prisma
[Db]      Prisma Studio is up on http://localhost:5555
[Db!]     node:internal/process/promises:288
[Db!]                 triggerUncaughtException(err, true /* fromPromise */);
[Db!]                 ^
[Db!]
[Db!]     [Error: ENOENT: no such file or directory, rename '/Users/chris/Library/Caches/checkpoint-nodejs/.77865.0' -> '/Users/chris/Library/Caches/checkpoint-nodejs/prisma-studio-default'] {
[Db!]       errno: -2,
[Db!]       code: 'ENOENT',
[Db!]       syscall: 'rename',
[Db!]       path: '/Users/chris/Library/Caches/checkpoint-nodejs/.77865.0',
[Db!]       dest: '/Users/chris/Library/Caches/checkpoint-nodejs/prisma-studio-default'
[Db!]     }
[Db!]
[Db!]     Node.js v18.19.0
Internal Wasp error (bug in compiler):
  This should never happen, studio should never stop.
  CallStack (from HasCallStack):
    error, called at cli/src/Wasp/Cli/Command/Db/Studio.hs:29:3 in waspc-0.11.8-inplace-cli-lib:Wasp.Cli.Command.Db.Studio

Looking in that checkpoint-nodejs directory, I see that there is indeed not a file or directory named .77865.0. I see these:

➜  app git:(main) ls /Users/chris/Library/Caches/checkpoint-nodejs/.
prisma-a5a31701       prisma-f3929fa9       prisma-studio-default signature

Do you have any thoughts on what I need to do to get that working again?

fantapop avatar Feb 07 '24 07:02 fantapop

hey @fantapop. not sure what's going on here but since you've just started the app, try cancelling all the running processes and run wasp clean and then wasp start again. once everything is running correctly, try wasp db studio and let me know what happens :)

in the future, if this happens again, don't worry -- wasp db studio has failed on me at times. usually just restarting the dev server and trying it again fixes it

vincanger avatar Feb 07 '24 14:02 vincanger

Weird I also never saw this. If this becomes consistent let us know again @fantapop .

Martinsos avatar Feb 07 '24 15:02 Martinsos

huh, yeah. It's working now. Thanks for the tip. I'll open a new issue if it keeps happening.

fantapop avatar Feb 10 '24 08:02 fantapop