Database error: error parsing response from server: `S` field missing
Hello everyone, I'm trying to use Xata for an app (Umami) I'm trying to deploy to Vercel. Vercel seems to be able to connect to the database (according to logs), but then I get this error:
and I have no idea how to work around it. I don't have another PostgreSQL instance I can use to test if it's a specific database issue or an app problem. I have already reported the issue to Umami but I haven't got a reply yet. Do you know if this could be related to some Xata limitation? Thanks
47 Replies
Hi, the failed command is "prisma migrate deploy". Does that work when run locally?
Prisma migrate requires a shadow database, in addition to the target xata database. You can read more about it here: https://xata.io/docs/integrations/prisma#shadow-database-for-migrations
Have you set up the shadow database?
hi and thanks for your reply. I'm new to Vercel to be honest and very little experience with NodeJS stuff (I'm a Python backend dev as a daily job). Coming to your quesiton: I haven't tried
prisma migrate deploy
locally because I don't run the app locally, I'm trying to deploy directly to Vercel, following these instructions https://umami.is/docs/guides/running-on-vercel I'm also not aware of what a "shadow" db is but I'm going to read that document in a moment...
going to create it now, hold on
ok, umami-migrations
created and added the SHADOW_DATABASE url to Vercel. Retrying deploy...
I just don't get this step: configure this database's Postgres connection string as the shadowDatabaseUrl in the Prisma datasourceYou can see a more complete example in the Prisma docs here: https://www.prisma.io/docs/orm/prisma-migrate/understanding-prisma-migrate/shadow-database#cloud-hosted-shadow-databases-must-be-created-manually
Basically, you need the Postgres endpoint of the Xata database in the "url", and the Postgres endpoint of the additional shadow database (which is used by Prisma to store migration information) in "shadowDatabaseUrl"
I did set both env variables and rerun the deployment. But now I got a different error in Vercel:
and on Xata dashboard I see this:
uhm...no well the error is the same as before, sorry
The fact that it created a _prisma_migrations table means that it did pick up the shadow db which is good
but it was creating that table even before
and it created it on
umami
not on umami-migrations
Ah then it didn't pick it up
I even tried to apply this, previously
Adapting isn't going to help, this is to make the tables render in Xata
and it does some changes as it says... then if I re-run, a row is written to the table, but it cannot complete the migration. So I was deleting that row every time to make it clean
what is your workspace id so I can check logs on our end?
Andrea-Grandi-s-workspace-5jfka8
(and yes, I checked Allow support to view your workspace
)
thanks 🙏🏻It is failing on this step:
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
never used/heard