Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?]: During deployment to Netlify, it seems like Prisma is failing on deployment #9652

Closed
1 task done
mantzuri opened this issue Dec 8, 2023 · 1 comment
Closed
1 task done
Labels
bug/needs-info More information is needed for reproduction

Comments

@mantzuri
Copy link

mantzuri commented Dec 8, 2023

What's not working?

During deployment to Netlify, it seems like Prisma is failing on deployment.

As the message suggests, I have tried to update schema.prisma to:

generator client {
  provider      = "prisma-client-js"
  binaryTargets = ["native", "rhel-openssl-3.0.x"]
}

This is the error message that appears on Netlify functions:

Dec 7, 03:46:35 PM: cc580190 ERROR Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x".\n\nThis is likely caused by tooling that has not copied "libquery_engine-rhel-openssl-3.0.x.so.node" to the deployment folder.\nEnsure that you ran prisma generate and that "libquery_engine-rhel-openssl-3.0.x.so.node" has been copied to "node_modules/.prisma/client".\n\nWe would appreciate if you could take the time to share some information with us.\nPlease help us by answering a few questions: https://pris.ly/engine-not-found-tooling-investigation\n\nThe following locations have been searched:\n /var/task/node_modules/.prisma/client\n /var/task/node_modules/@prisma/client\n /opt/build/repo/node_modules/@prisma/client\n /tmp/prisma-engines","reason":{"errorType":"PrismaClientInitializationError","errorMessage":"Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x".\n\nThis is likely caused by tooling that has not copied "libquery_engine-rhel-openssl-3.0.x.so.node" to the deployment folder.\nEnsure that you ran prisma generate and that "libquery_engine-rhel-openssl-3.0.x.so.node" has been copied to "node_modules/.prisma/client".\n\nWe would appreciate if you could take the time to share some information with us.\nPlease help us by answering a few questions: https://pris.ly/engine-not-found-tooling-investigation\n\nThe following locations have been searched:\n /var/task/node_modules/.prisma/client\n /var/task/node_modules/@prisma/client\n /opt/build/repo/node_modules/@prisma/client\n /tmp/prisma-engines","name":"PrismaClientInitializationError","clientVersion":"5.6.0","stack":["PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x".","","This is likely caused by tooling that has not copied "libquery_engine-rhel-openssl-3.0.x.so.node" to the deployment folder.","Ensure that you ran prisma generate and that "libquery_engine-rhel-openssl-3.0.x.so.node" has been copied to "node_modules/.prisma/client".","","We would appreciate if you could take the time to share some information with us.","Please help us by answering a few questions: https://pris.ly/engine-not-found-tooling-investigation","","The following locations have been searched:"," /var/task/node_modules/.prisma/client"," /var/task/node_modules/@prisma/client"," /opt/build/repo/node_modules/@prisma/client"," /tmp/prisma-engines"," at il (/var/task/node_modules/@prisma/client/runtime/library.js:67:805)"," at async Object.loadLibrary (/var/task/node_modules/@prisma/client/runtime/library.js:114:9816)"," at async Wt.loadEngine (/var/task/node_modules/@prisma/client/runtime/library.js:115:448)"," at async Wt.instantiateLibrary (/var/task/node_modules/@prisma/client/runtime/library.js:114:19579)"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x".","","This is likely caused by tooling that has not copied "libquery_engine-rhel-openssl-3.0.x.so.node" to the deployment folder.","Ensure that you ran prisma generate and that "libquery_engine-rhel-openssl-3.0.x.so.node" has been copied to "node_modules/.prisma/client".","","We would appreciate if you could take the time to share some information with us.","Please help us by answering a few questions: https://pris.ly/engine-not-found-tooling-investigation","","The following locations have been searched:"," /var/task/node_modules/.prisma/client"," /var/task/node_modules/@prisma/client"," /opt/build/repo/node_modules/@prisma/client"," /tmp/prisma-engines"," at process. (file:///var/runtime/index.mjs:1276:17)"," at process.emit (node:events:514:28)"," at emit (node:internal/process/promises:150:20)"," at processPromiseRejections (node:internal/process/promises:284:27)"," at process.processTicksAndRejections (node:internal/process/task_queues:96:32)"]}

  • This does not happen in local environment.

Issue is also reported here: prisma/prisma#19498

How do we reproduce the bug?

The issue happens on my portfolio webpage, more then welcome to inspect https://mantzor.com

This is my schema.prisma: https://github.com/mantzuri/redwoodmantzor/blob/270cb0a583d3493e55febedd86e88bb1645796e8/api/db/schema.prisma

What's your environment? (If it applies)

System:
    OS: macOS 13.0
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 19.2.0 - /private/var/folders/65/p2043sjn1rd3mv4tt25cd6pm0000gn/T/xfs-70d5e096/node
    Yarn: 3.6.3 - /private/var/folders/65/p2043sjn1rd3mv4tt25cd6pm0000gn/T/xfs-70d5e096/yarn
  Databases:
    SQLite: 3.39.4 - /usr/bin/sqlite3
  Browsers:
    Chrome: 117.0.5938.149
    Edge: 92.0.902.67
    Safari: 16.1
  npmPackages:
    @redwoodjs/auth-dbauth-setup: 6.5.0 => 6.5.0 
    @redwoodjs/cli-data-migrate: 6.5.0 => 6.5.0 
    @redwoodjs/cli-storybook: 6.5.0 => 6.5.0 
    @redwoodjs/core: 6.5.0 => 6.5.0

Are you interested in working on this?

  • I'm interested in working on this
@mantzuri mantzuri added the bug/needs-info More information is needed for reproduction label Dec 8, 2023
@Tobbe
Copy link
Member

Tobbe commented Dec 8, 2023

Sorry you ran into this issue @mantzuri

You can try forcing Node 18. See here: #9614
Or you can try the latest patch release of Redwood that includes the latest version of Prisma that fixes the issue: https://github.com/redwoodjs/redwood/releases/tag/v6.5.1

I suggest pinning Node to version 18 as Redwood doesn't officially support Node 20 yet.

@Tobbe Tobbe closed this as completed Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/needs-info More information is needed for reproduction
Projects
None yet
Development

No branches or pull requests

2 participants