Bug wasp db studio

I have very often this when I run wasp db 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/estellejacot/Library/Caches/checkpoint-nodejs/.81644.0' -> '/Users/estellejacot/Library/Caches/checkpoint-nodejs/prisma-studio-default'] { [ Db !] errno: -2, [ Db !] code: 'ENOENT', [ Db !] syscall: 'rename', [ Db !] path: '/Users/estellejacot/Library/Caches/checkpoint-nodejs/.81644.0', [ Db !] dest: '/Users/estellejacot/Library/Caches/checkpoint-nodejs/prisma-studio-default' [ Db !] } [ Db !] [ Db !] Node.js v18.18.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.12.1-inplace-cli-lib:Wasp.Cli.Command.Db.Studio Most of the time, I re-run exactly the same few times and it works again, but if you could fix it it would be nice! Thanks
19 Replies
kapa.ai
kapa.ai7mo ago
Hi @Estelle. 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 experiencing issues with the wasp db studio command. Based on the error message you provided, it seems like there's an issue with renaming a file in your cache directory. This could be due to a variety of reasons such as file permissions or the file being in use by another process. However, without more information, it's hard to provide a definitive solution. I recommend checking the following: 1. Ensure you're using the latest version of Wasp. There have been several issues related to the wasp db studio command that have been resolved in recent updates. For example, this issue (https://github.com/wasp-lang/wasp/issues/228) was resolved by updating Prisma. 2. Check if the issue persists when using a different Node.js version. Wasp depends on the latest Node.js LTS version, which is Node.js 18 at the moment. You can read more about this here (https://github.com/wasp-lang/wasp/issues/1396). 3. Try clearing your cache directory. The error message indicates that the issue is related to a file in your cache directory. Clearing this might resolve the issue. If none of these suggestions work, I recommend opening a new issue on the Wasp Github page (https://github.com/wasp-lang/wasp/issues). Be sure to include the error message and any other relevant information. The Wasp team is very active and should be able to help you resolve the issue. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Estelle, 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?
Estelle
EstelleOP7mo ago
sorry I'm not using the last version of wasp, maybe it will solve the problem long term
martinsos
martinsos7mo ago
Hm interesting and thanks for reporting! It mentions checkpoint-nodejs that is quite specific. The best thing is if we can replicate this somehow. If you are not on latest Wasp that makes it a bit harder, but still, we can give it a try! Any info you can give us that would help? Your OS, Wasp version, node/npm version, anything else you think might be relevant. Maybe a minimal project that you get this on, that you can share? For example if you do wasp new MyApp -t todo-ts to create a new app, would you also get this issue with this app? If so, then we can try to replicate on it.
Estelle
EstelleOP7mo ago
I think I have the problem when I switch from local, preprod, prod db in my env node: v18.18.0 wasp: 0.12.1 mac: Apple M2 Pro, 16 Go
martinsos
martinsos7mo ago
The error message is telling us that this /Users/estellejacot/Library/Caches/checkpoint-nodejs/.81644.0 does not exist, that is peculiar. Why could that be happening? I found that this file is used/created by "Checkpoint" client. That is this library https://www.npmjs.com/package/checkpoint-client . It is basically Prisma's telemetry. So, Pisma is trying to do telemetry, but somehow it messes itself up in the process and that file isn't there when it expects it hm.
npm
checkpoint-client
javascript checkpoint client. Latest version: 1.1.33, last published: 5 months ago. Start using checkpoint-client in your project by running npm i checkpoint-client. There are 6 other projects in the npm registry using checkpoint-client.
Estelle
EstelleOP7mo ago
idk, and that is strange that I just re-run the commands a certain amount of time until it works and... it finally works
martinsos
martinsos7mo ago
Interesting enough, prisma's checkpoint repo is not visible anymore on github, I don't know if they made it private, deleted it, renamed it or sometihng What is your prisma version? did you keep it as it came with Wasp?
Estelle
EstelleOP7mo ago
Yes I didn't change anything, 4.16.2 in my package.json
martinsos
martinsos7mo ago
Ok that sounds right
Estelle
EstelleOP7mo ago
I think the bug occurs only on real db, not locally (not the "wasp" db)
martinsos
martinsos7mo ago
Aha! So when you say real db, you mean when you connect to the production database? How do you do that: set DATABASE_URL to production database and then it happens?
Estelle
EstelleOP7mo ago
yes and specially when I switch from db to another db
martinsos
martinsos7mo ago
And then it keeps happening until you go back to local database?
Estelle
EstelleOP7mo ago
no, I just run "wasp db studio" until it works on the db I want (sometimes 2 times, sometimes 10...) I tried to delete the folder .wasp but it doesnt seem to have any effect on the number of times so now I just try until it works but it's pretty annoying
martinsos
martinsos7mo ago
and once you go back to local database, there is no issue anymore? So we actually have quite some information here now, the problem is, there is no obviuos thing that sticks out as a possible problem. Sounds very much to me like Prisma problem hm, not Wasp problem. The tricky thing is that Prisma moved to version 5 in the meantime, so we won't get best support from them because 4 is old version. Wasp will also be moving to 5 soon, so that will help. What if you do export CHECKPOINT_DISABLE=1 in your terminal? And you can persist it via .bashrc or something like that. This should tell Prisma to not do the telemetry thing with Checkpoint, and hopefully it would stop hitting this issue.
Estelle
EstelleOP7mo ago
I will try thanks, and come back to update
martinsos
martinsos7mo ago
Awesome, let us know!
Estelle
EstelleOP7mo ago
It seems to work, I don't have the problem anymore, thank you very much
martinsos
martinsos7mo ago
Awesome! I wonder what cause the Checkpoint functionality in Prisma to fail though. Once Wasp upgrades to Prisma 5, you can try again without that env var and see if it works.
Want results from more Discord servers?
Add your server