intermittent: write EPIPE + Cannot read property 'onError' of undefined
See original GitHub issueBug description
These two exceptions happen in the same flow:
ERROR Invoke Error {"errorType":"Error","errorMessage":"write EPIPE","code":"EPIPE","clientVersion":"2.12.1","stack":["Error: write EPIPE"," at PrismaClientFetcher.request (/var/task/dist/webpack:/mnt/ramdisk/project/node_modules/@prisma/client/runtime/index.js:79355:15)"," at processTicksAndRejections (internal/process/task_queues.js:97:5)"]}
2 milliseconds later:
ERROR Uncaught Exception {"errorType":"TypeError","errorMessage":"Cannot read property 'onError' of undefined","stack":["TypeError: Cannot read property 'onError' of undefined"," at Socket.ce (/var/task/dist/webpack:/mnt/ramdisk/project/node_modules/@prisma/client/runtime/index.js:25673:45)"," at Socket.emit (events.js:314:20)"," at Socket.EventEmitter.emit (domain.js:483:12)"," at Pipe.<anonymous> (net.js:676:12)"]}
This was previously masked by #4117, which was fixed by this commit; now the real error is visible.
Possibly related to #4400
How to reproduce
This is an intermittent error on AWS Lambda, could not reproduce it on a dev machine.
Expected behavior
- No exception (duh)
- It would be nice to have source mapping to link the stack trace into a specific spot in the code (instead of
@prisma/client/runtime/index.js:25673:45
). - It would be nice to have more logs from the Rust process; IIUC there’s no way to set
RUST_LOG
to something other thaninfo
Environment & setup
- OS: AWS Lambda (linux-musl), node 12.x
- Database: PostgreSQL 12 on RDS
- Node.js version: 12.18
- Prisma version: 2.12.1
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:12 (3 by maintainers)
Top Results From Across the Web
RedwoodJS 22.1 and Prisma 12.1 Workaround for Intermittent
intermittent : write EPIPE + Cannot read property 'onError' of undefined ... What they suspect happened is: that lambda is cleaning up the...
Read more >events.js:288 Error: write EPIPE when executing tests with Jest
For me it was a matter of installing the correct version. I know it doesn't sound very logical, but keep trying until you...
Read more >Changelog - Cypress Documentation
Added the mimeType property so you can explicitly set the mime type on ... the error "cannot read property split of undefined" in...
Read more >what is a "write EPIPE" error? - Google Groups
resProx.on 'error', (err) ->. log 'dba: uploadAttachment res err event ' + compDoc._id + ' ' + resProx.statusCode, {err}. cb false.
Read more >Parse Server Error: Uncaught Internal Server Error. {Stack: - ADocLib
... throw errors in situations where Apollo Server doesn't do so automatically. ... intermittent: write EPIPE + Cannot read property 'onError' of undefined....
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 FreeTop 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
Top GitHub Comments
I have a theory that lambda is cleaning up the
/tmp
directory and cleaning up our unix domain socket which we use now in the latest version(we were using a TCP port before for Rust <-> communication).Can you all try installing the dev channel and turning off UDS and see if this shows up again:
Similar bug report about uds: https://github.com/prisma/prisma/issues/4744
Looks like prisma itself is deleting its socket file on the
beforeExit
event of the node process. According to this blog post:If this is true, it explains the intermittent error:
beforeHook
is calledReverting to tcp socket is a workaround, but the real fix could be unhooking from the
beforeExit
event.