prisma: Segmentation Fault in Postgres

I am studying prisma to use it. But I haven’t been able to use it since my first attemp is showing me this error.

[1] 6655 segmentation fault node src/seed.js

[1] 5817 segmentation fault ts-node src/seed.ts

I made the models, I run the migration but I can’t use prismaClient.

import { PrismaClient } from '@prisma/client'

const prisma = new PrismaClient()

async function seed () {
  await prisma.$connect()
  console.log('Seeding database...', prisma.$connect)
}

seed()
  .then(async () => {
    await prisma.$disconnect()
  })
  .catch(async (e) => {
    console.error(e)
    await prisma.$disconnect()
    process.exit(1)
  })

Adding package.json and tsconfig

{ ...
"prisma": {
    "seed": "ts-node prisma/seed.ts"
  },
  "dependencies": {
    "@prisma/client": "^4.10.1",
    "@trpc/server": "^10.9.1",
    "cors": "^2.8.5",
    "debug": "^4.3.4",
    "express": "^4.18.2",
    "http-errors": "^2.0.0",
    "morgan": "^1.10.0",
    "zod": "^3.20.2"
  },
  "devDependencies": {
    "@types/cors": "^2.8.13",
    "@types/debug": "^4.1.7",
    "@types/express": "^4.17.16",
    "@types/http-errors": "^2.0.1",
    "@types/morgan": "^1.9.4",
    "@types/node": "^18.11.18",
    "@typescript-eslint/eslint-plugin": "^5.50.0",
    "@typescript-eslint/parser": "^5.50.0",
    "eslint": "^8.33.0",
    "eslint-config-standard": "^17.0.0",
    "eslint-plugin-import": "^2.27.5",
    "eslint-plugin-n": "^15.6.1",
    "eslint-plugin-promise": "^6.1.1",
    "prisma": "^4.10.1",
    "ts-node": "^10.9.1",
    "ts-node-dev": "^2.0.0",
    "typescript": "^4.9.5"
  }
}

{
  "compilerOptions": {
    "target": "es2016",                                  /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
    "lib": ["es2016", "esnext.asynciterable"],           /* Specify a set of bundled library declaration files that describe the target runtime environment. */
    "module": "commonjs",                                /* Specify what module code is generated. */
    "esModuleInterop": true,                             /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
    "forceConsistentCasingInFileNames": true,            /* Ensure that casing is correct in imports. */
    "strict": true,                                      /* Enable all strict type-checking options. */
    "skipLibCheck": true,   
}

POSTGRES VERSION

psql (15.1 (Debian 15.1-1.pgdg110+1), servidor 14.6 (Debian 14.6-1.pgdg110+1))
Conexión SSL (protocolo: TLSv1.3, cifrado: TLS_AES_256_GCM_SHA384, compresión: desactivado)

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 16 (6 by maintainers)

Commits related to this issue

Most upvoted comments

@josejaviersanahuja no worries, given the information in your previous message I’m pretty sure it was the same problem as https://github.com/prisma/prisma/issues/10649.


@TenkoSpirit could you check if updating prisma and @prisma/client to 4.12.0-integration-rtld-deepbind.3 fixes the issue for you? It does in the cases that I tested, but it would be very helpful to test this on more different systems.

This is an experimental dev version not intended for production but if it works as expected, we’ll work on making this land in a stable release. Thank you!

This issue is fixed in Prisma 4.13.0 which will be released tomorrow, on Tuesday, Apr 18. If you need to temporarily use a pre-release version until then, you can use 4.13.0-dev.33.

Note that this GitHub issue is about a specific bug that occurs when using Node.js 17+ on a system with OpenSSL 1.1 on x86-64 CPUs when using TLS to connect to database. Please do not post comments here if you encounter a segfault under different circumstances, and open a new issue instead.

If you are facing segfaults on ARM, please leave a comment in https://github.com/prisma/prisma/issues/18510 or open a new issue.

You’re missing the other package, @prisma/client. The one you pinned to the dev version is just the CLI, not the client, it doesn’t use the Query Engine.

Oops… Thanks.

I confirm it works now. Or at least, I didn’t get the segfault since I’ve upgraded.

@TenkoSpirit hi, no worries. Regarding the versions, looks like you’re using the stable 4.12.0 here too:

prisma                  : 4.12.0
@prisma/client          : 4.12.0

I think this might have happened if you used a non-exact version (^4.12.0-integration-rtld-deepbind.3) and the package manager (in this case incorrectly, though reasonably from the point of view of semver) updated it to 4.12.0.

Here’s a newer integration version as a pre-release of 4.13: 4.13.0-integration-rtld-deepbind.6. I’d still recommend to specify it as exact version as using ^ with dev versions may lead to unexpected results sometimes.

@josejaviersanahuja no worries, given the information in your previous message I’m pretty sure it was the same problem as #10649.

@TenkoSpirit could you check if updating prisma and @prisma/client to 4.12.0-integration-rtld-deepbind.3 fixes the issue for you? It does in the cases that I tested, but it would be very helpful to test this on more different systems.

This is an experimental dev version not intended for production but if it works as expected, we’ll work on making this land in a stable release. Thank you!

Ah, sorry for the late reply. I had to switch from Debian to Ubuntu, since it was basically production deployment of some project, so yeah, can’t really do that now. I’ll try tomorrow on my own VPS tho 👍

@aqrln Hello I had the same segmentation fault problem (node v18.15.0, Ubuntu WSL) and updating prisma, @prisma/client to 4.12.0-integration-rtld-deepbind.3 fixed it. Thanks!