P
Prisma•2mo ago
Rob

Help with Error in Schema engine with Planetscale.

I've recently changed to schema folder structure and now can't push a new table to db... ? When I try and push npx prisma db push I get an error "Oops, an unexpected error occurred! Error in Schema engine. Reason: [schema-engine/sql-schema-describer/src/mysql... [more...]" Prisma generates correctly, types for the new table are generated with no errors, prisma Studio recognises the new table but I cann't push it. @prisma/client: 6.12 node: v22.11.0 Can anyone help me debug please?
15 Replies
Prisma AI Help
Prisma AI Help•2mo ago
You chose to debug with a human. They'll tinker with your query soon. If you get curious meanwhile, hop into #ask-ai for a quick spin!
Rob
RobOP•2mo ago
OK, update. I've just run format, generate , db push and it didn't error this time but just gave basic output in the terminal:
Environment variables loaded from .env
Prisma schema loaded from prisma/schema
Datasource "db": MySQL database "app" at "aws.connect.psdb.cloud"
Environment variables loaded from .env
Prisma schema loaded from prisma/schema
Datasource "db": MySQL database "app" at "aws.connect.psdb.cloud"
But db was not updated. If i restart my app which uses "npx prisma generate && next dev" with the prisma config :
"prisma": {
"schema": "./prisma/schema/"
},
"prisma": {
"schema": "./prisma/schema/"
},
The error returns...
Nurul
Nurul•2mo ago
Hey @Rob! Can you check if the error goes away if you downgrade to prisma 6.11?
Rob
RobOP•2mo ago
Thanks @Nurul - I have downgraded prisma and prisma/client to 6.11 and run format, generate, push and I do not see the error but the DB is not pushed (as above) I get:
Environment variables loaded from .env
Prisma schema loaded from prisma/schema
Datasource "db": MySQL database "app" at "aws.connect.psdb.cloud"
Environment variables loaded from .env
Prisma schema loaded from prisma/schema
Datasource "db": MySQL database "app" at "aws.connect.psdb.cloud"
But the db is not updated.
Nurul
Nurul•2mo ago
So the process gets completed without any errors but the new table is not created, right?
Rob
RobOP•2mo ago
Correct I think I used to see more output from a db push? I just tried a breaking change (making an optional field required) I don't see any warning output for that.
Nurul
Nurul•2mo ago
This is with PlanetScale, right?
Rob
RobOP•2mo ago
Yes
Nurul
Nurul•2mo ago
I am checking this with team internally. Let me get back to you.
Rob
RobOP•2mo ago
Thanks Nurul 🙂
Nurul
Nurul•2mo ago
Ok, so it seems that our team became aware of this issue yesterday and are in touch with PlanetScale team to get this resolved. Was your PlanetScale instance updated to a new version recently?
Nurul
Nurul•2mo ago
Check this issue: https://github.com/prisma/prisma/issues/27734 This is related to Vitess upgrade from version 21 to 22
GitHub
prisma db push panics on PlanetScale: **called Result::unwrap() o...
Bug description Running yarn prisma db push against a PlanetScale (Vitess) development branch crashes the schema engine with: Origin of the problem The very first command I ran was yarn prisma migr...
Nurul
Nurul•2mo ago
GitHub
prisma db push panics on PlanetScale: **called Result::unwrap() o...
Bug description Running yarn prisma db push against a PlanetScale (Vitess) development branch crashes the schema engine with: Origin of the problem The very first command I ran was yarn prisma migr...
Rob
RobOP•2mo ago
That's a great help - sorry I hadn't seen that issue previously. My changes can wait until Monday so hopefully we'll see a fix (or revert) before then. Thanks for your help 🙂 Added Planetscale for others searching out the same issue here.
Nurul
Nurul•2mo ago
All good! This is a very recent issue so not many were aware of this issue. This should be fixed hopefully very soon 🙂 Fix seems to be merged recently as well: https://github.com/vitessio/vitess/pull/18489 So, the issue should be resolved soon. @Rob You can ask PlanetScale support team to downgrade to Vitess 21, which should unblock you https://discord.com/channels/937751382725886062/1397683940399255593/1397729972877266954

Did you find this page helpful?