question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

prisma:getConfig fails with "Could not parse migration engine response: SyntaxError: Unexpected end of JSON input"

See original GitHub issue

Bug 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

  1. Build a docker image using node:16.4-buster-slim.
  2. 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 with linux-arm-openssl-undefined. The application is running fine with those env variable now.
  3. 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:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
mericano1commented, Jul 16, 2021

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 ☝️

1reaction
mericano1commented, Jul 16, 2021

nevermind. I found them under @prisma/engines. I will try to update the paths to use those.

ls -la /node_modules/@prisma/engines'
total 104544
drwxr-xr-x 4 root root      240 Jul 16 09:00 .
drwxr-xr-x 5 root root       58 Jul 16 08:59 ..
drwxr-xr-x 2 root root      123 Jul 16 08:59 dist
drwxr-xr-x 2 root root       42 Jul 16 08:59 download
-rwxr-xr-x 1 root root 21257704 Jul 16 08:59 introspection-engine-linux-arm-openssl-1.1.x
-rwxr-xr-x 1 root root 34354488 Jul 16 08:59 migration-engine-linux-arm-openssl-1.1.x
-rw-r--r-- 1 root root      651 Jul 16 08:59 package.json
-rwxr-xr-x 1 root root  8314016 Jul 16 08:59 prisma-fmt-linux-arm-openssl-1.1.x
-rwxr-xr-x 1 root root 43116168 Jul 16 08:59 query-engine-linux-arm-openssl-1.1.x
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found