prisma: ENV-based binary variables broken on preview022

I rebuilt the prisma engine binaries for ARM64 against the latest repo code, and am getting a strange issue when attempting to run a migration against a postgresql database: Error: Can't parse migration engine response: undefined. It works fine on the stock binaries provided for amd64, and if I purposely mess up the connection string I get a reasonable error back, but if the connection string is valid, then the above mentioned error occurs.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks @timsuchanek , I can confirm alpha has finally fixed the issue for me. I was able to launch my image using my alpine binaries and migrate ran properly as does the query engine. I think we’re good to close this out!

Certainly: Specifically - prisma2 migrate up --experimental . It may only be related to migration-engine, but I haven’t had a chance to look at the others.

Yes, all alpha changes will bet in beta.2 of course.

Just in case it helps, here’s a quick and dirty reproduction anyone can do that shows it’s ignoring the ENV for the migration engine binary. Ignore the P1001 error, that’s expected if it’s working. The end where it shows undefined is when the binary is not present, but it should also give this behavior once the ENV variable is set to a bad path as well, but doesn’t.

❯ npx prisma2 migrate up --experimental
Error: P1001: Can't reach database server at `localhost`:`5432`

Please make sure your database server is running at `localhost`:`5432`.

❯ export PRISMA_MIGRATION_ENGINE_BINARY=node_modules/prisma2/migration-engine-darwin-bad

❯ npx prisma2 migrate up --experimental
Error: P1001: Can't reach database server at `localhost`:`5432`

Please make sure your database server is running at `localhost`:`5432`.

❯ rm node_modules/prisma2/migration-engine-darwin

❯ npx prisma2 migrate up --experimental
Error: Can't parse migration engine response:
undefined

Maybe also important, but if I do npm i after this charade, I get the below. The ENV variable set isn’t actually undefined, but the error message seems to indicate it’s being perceived that way.

❯ npm i

> graphql-auth@ postinstall /Users/npappas/Desktop/projects/cookbook/server
> npm -s run generate

Error: Env var PRISMA_MIGRATION_ENGINE_BINARY is provided but provided path undefined can't be resolved.