Windows 10 Pro v1909.
node v12.14.1
yarn v1.21.1
Using Git Bash.
I've been running through the example blog tutorial, and have run into this issue at every step that requires yarn rw db up. After successfully running yarn rw db save, the call to yarn rw db up will hang (forever?) at the step with prisma2 generate. I can kill the process with Ctrl+C, and I think that it finished doing all the work, but I'm not positive. It consistently hangs for me every time, even if I run it multiple times without changing the schema.
$ C:\code\redwoodblog\node_modules\.bin\prisma2 migrate up --experimental --create-db
migrate up
All migrations are already applied
Migrate database up... [completed]
Generating the Prisma client... [started]
$ C:\code\redwoodblog\node_modules\.bin\prisma2 generate
(hangs)
I plan to dig in and see if there are any --debug or --verbose options I can add to provide more useful output for this investigation. If anyone can give me pointers on that, I'd appreciate it.
I see that there is an open issue for updating Prisma to preview24 #279, would it be worthwhile to wait for that first to see if it fixes my issue?
We released an update yesterday 0.2.5 that should help Windows folks, have you tried that? You'll want to create a new app from scratch yarn create redwood-app in order to get some updates to schema.prisma and .env.defaults. Several people have reported that this fixes similar issues for them!
I just tried it with 0.2.5, and can confirm that yarn rw db up will successfully complete on the first run, and successfully do nothing on subsequent runs. 👍
However, just before I got to yarn rw db up, I found that my first run of yarn rw db save on 0.2.5 never exited, although it completed successfully. After I killed it with ctrl+c, the second run of yarn rw db save was a successful no-op.
Great! Closing for now but let us know if anything else comes up!
Further details on the new issue with yarn rw db save:
My first run of yarn rw db save asks if I want to create a new Sqlite database at /dev.db.
I hit enter to say yes, it creates the database and then hangs with no further output. If I kill the command with ctrl+c, I can see that there is a new dev.db file.
A second run of yarn rw db save will ask how I want to name the migration, and will finish successfully.
Re-openning per comment above and this one:
However, just before I got to yarn rw db up, I found that my first run of yarn rw db save on 0.2.5 never exited, although it completed successfully. After I killed it with ctrl+c, the second run of yarn rw db save was a successful no-op.
Strange one indeed. We’ll see what we can do to diagnose. And, to make sure, even though there’s a hiccup you _are_ still able to proceed, correct?
Strange one indeed. We’ll see what we can do to diagnose. And, to make sure, even though there’s a hiccup you _are_ still able to proceed, correct?
Correct. I've reproduced this situation several times, both with fresh directories from yarn create redwood-app and by manually deleting the dev.db file. Each run of yarn rw db save without a pre-existing dev.db file hangs after successfully creating the dev.db file. Ctrl+c and re-running the command is a functioning workaround.
Now that I think about it, this might have been an existing issue before upgrading to 0.2.5. I may have hit Ctrl+c and re-run without thinking about it before.
I saw this myself yesterday 🤦♂, but thought it was my super slow vm.
I also have experienced this bug. Same deal, hangs up on yarn rw db up.
I’ll try to prioritize upgrading Prisma today so we have that as a baseline to test against #279
Has anyone experienced this issue with Redwood v0.3.2 (which is running Prisma2 preview024)?
FYI: we have upgraded to Prisma preview025 in ‘master’ — expect to release new packages in next few days.
Just to let you know that on using Redwoodjs I just experienced a hang while running redwood db save. The db was created but no migrations folder was created. On terminating it with Ctrl-C and running it again it ran successfully, asking me to name the migration and it appears to have completed the remaining steps.
@bpenno Thanks for reporting this and apologies for the snag!
Curious if you're on Windows. If so, this open issue is likely the same #575
It's the same command but a different cause of failure. And we're working on it!
Sorry, I meant to mention I was using Windows. I had a look at the issue you mentioned and it does appear to be the same. It might be handy to add to the tutorial that Windows users might have to terminate the command and re-run for it to work. It might be perceived as a bit clunky but at least it will allow people trying out Redwood for the first time to continue.
@bpenno thanks and agreed! We'd assumed this was an error on our end but just pieced together the Prisma aspect. Definitely going to add the note to the Tutorial for the near-term.