prisma:getConfig fails with "Could not parse migration engine response: SyntaxError: Unexpected end of JSON input"
See original GitHub issueBug description
When trying to run prisma migrate deploy
on a production server I get the following error.
2021-07-16T09:19:08.582Z prisma:getConfig Using Query Engine Binary at: /node_modules/.prisma/client/query-engine-linux-arm-openssl-1.1.x
Error: Error: Could not parse migration engine response: SyntaxError: Unexpected end of JSON input
at parseJsonFromStderr (/node_modules/prisma/build/index.js:40881:15)
at Object.canConnectToDatabase3 (/node_modules/prisma/build/index.js:40911:22)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.ensureDatabaseExists (/node_modules/prisma/build/index.js:61883:24)
at async MigrateDeploy2.parse (/node_modules/prisma/build/index.js:64375:28)
at async main (/node_modules/prisma/build/index.js:110386:18)
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
command terminated with exit code 1
How to reproduce
- Build a docker image using node:16.4-buster-slim.
- Specify the env variables
PRISMA_QUERY_ENGINE_BINARY
,PRISMA_MIGRATION_ENGINE_BINARY
,PRISMA_INTROSPECTION_ENGINE_BINARY
,PRISMA_FMT_BINARY
. This is because I ran into an issue withlinux-arm-openssl-undefined
. The application is running fine with those env variable now. - run
prisma migrate deploy
Expected behavior
The migration happens successfully
Prisma information
generator client {
provider = "prisma-client-js"
previewFeatures = ["filterJson"]
binaryTargets = ["native","linux-arm-openssl-1.1.x"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
Environment & setup
- OS: Debian
- Database: Postgresql
- Node.js version: v16.4.2
Prisma Version
prisma : 2.27.0
@prisma/client : 2.27.0
Current platform : linux-arm-openssl-undefined
Query Engine : query-engine cdba6ec525e0213cce26f8e4bb23cf556d1479bb (at node_modules/.prisma/client/query-engine-linux-arm-openssl-1.1.x, resolved by PRISMA_QUERY_ENGINE_BINARY)
Migration Engine : query-engine cdba6ec525e0213cce26f8e4bb23cf556d1479bb (at node_modules/.prisma/client/query-engine-linux-arm-openssl-1.1.x, resolved by PRISMA_MIGRATION_ENGINE_BINARY)
Introspection Engine : query-engine cdba6ec525e0213cce26f8e4bb23cf556d1479bb (at node_modules/.prisma/client/query-engine-linux-arm-openssl-1.1.x, resolved by PRISMA_INTROSPECTION_ENGINE_BINARY)
Format Binary : query-engine cdba6ec525e0213cce26f8e4bb23cf556d1479bb (at node_modules/.prisma/client/query-engine-linux-arm-openssl-1.1.x, resolved by PRISMA_FMT_BINARY)
Default Engines Hash : cdba6ec525e0213cce26f8e4bb23cf556d1479bb
Studio : 0.410.0
Preview Features : filterJson
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
SyntaxError: Unexpected end of JSON input when a fuction ...
-- The Unexpected end of JSON input error occurs when you try to parse an invalid JSON string or an empty array, like...
Read more >unexpected end of json input at json.parse (<anonymous>)
Under Node, HTTP/HTTPS request data can arrive in multiple chunks which need to be amalgamated before parsing the resultant JSON string. Essentially JSON...
Read more >Prometheus: unexpected end of JSON input - devopstales
In this blog post I will show you how I solwed the Prometheus: unexpected end of JSON input error. The current log shows...
Read more >Blog | ent
In our case, we couldn't just copy the data naively to the new column, since the ... state of the database schema is...
Read more >[SOLVED] Admin, Add or Edit Order - Unexpected end of input
SyntaxError : Unexpected end of input (Chrome) SyntaxError: Syntax Error (IE) Hi, I have searched high and low on this issue, as this...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
BTW - Changing the variables to point to the right engines worked. Thanks for your support.
@janpio I added a comment to the other issue that was closed ☝️
nevermind. I found them under
@prisma/engines
. I will try to update the paths to use those.