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.

EACCES error when deploying to Lambda functions

See original GitHub issue

Bug description

Using Prisma with NestJS and PlanetScale, which is deployed to a Lambda. I have made the query engine binary available as a layer. The location of this layer is:

/opt/prisma-binary

I have set the above value as PRISMA_QUERY_ENGINE_BINARY. When I try to run a create request, I get the following error:

Invalid `this.prisma.user.create()` invocation in
/var/task/src/lambda.js:482655:43

  482652     throw new Error("Not found. Proceeding to create!");
  482653   }
  482654 } catch (_a4) {
→ 482655   user = await this.prisma.user.create(
  spawn /opt/prisma-binary EACCES
    at RequestHandler.request (/var/task/src/lambda.js:123709:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async PrismaService._request (/var/task/src/lambda.js:124590:22)
    at async AuthService.verifyOTP (/var/task/src/lambda.js:482655:20) {
  code: 'EACCES',
  clientVersion: '3.15.2',
  meta: undefined
}

This works locally, but gives the above error on lambda.

Running it on ARM and not the x86 machines.

How to reproduce

Source Code: core-feat-serverless.zip

Execute: yarn install

Change the serverless.yml file to any dummy org you create in your Serverless Dashboard. then run

yarn sls deploy

Expected behavior

Lambda function should be deployed.

Prisma information

Environment & setup

  • OS:
  • Database:
  • Node.js version:

Prisma Version

Prisma version 3.15.2

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
samrith-scommented, Sep 12, 2022

@janpio Here is the PR for it #3767

1reaction
samrith-scommented, Sep 12, 2022

Will do. Here is the feature request #15289

Read more comments on GitHub >

github_iconTop Results From Across the Web

Permission denied on function Lamda - node.js - Stack Overflow
Have run through this twice now and still get same error as below so any help is appreciated. { "errorMessage": "EACCES: permission denied,...
Read more >
Troubleshoot deployment issues in Lambda
When you deploy updates to your function directly with the Lambda API or with a client such ... Error: EACCES: permission denied, open...
Read more >
aws-lambda: Missing `cdk.out` directory causes EACCES ...
Describe the bug When deploying a lambda.Function that uses lambda.Code.fromAsset to include an external .zip file, if the cdk.out directory ...
Read more >
Top 10 Serverless Deployment Errors (and How to Fix Them)
When deploying a function whose Lambda Layer is referenced as an environment parameter, AWS SAM CLI returns a message saying the function's ......
Read more >
How do I troubleshoot Invalid Permissions on Lambda ...
How do I troubleshoot Invalid Permissions on Lambda function errors from API Gateway REST APIs?
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