Error due to sockets file getting deleted
See original GitHub issueBug description
I use umami which uses prisma and I host the app on uberspace, a shared hosting provider.
The /tmp
folder on my server gets deleted from time to time, which also deletes the `prisma-*.sock file and leads to this error:
2020-12-10 14:38:23,082 DEBG 'umami' stderr output:
PrismaClientKnownRequestError2: connect ENOENT /tmp/prisma-395d4bbf364fd00bc58da2d3.sock
at PrismaClientFetcher.request (/home/simbo/umami/node_modules/@prisma/client/runtime/index.js:79355:15)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async getSession (/home/simbo/umami/.next/server/pages/api/auth/verify.js:198:19)
at async /home/simbo/umami/.next/server/pages/api/auth/verify.js:258:15 {
code: 'ENOENT',
clientVersion: '2.12.1',
meta: undefined
}
2020-12-10 14:38:30,493 DEBG 'umami' stderr output:
PrismaClientKnownRequestError2: connect ENOENT /tmp/prisma-395d4bbf364fd00bc58da2d3.sock
at PrismaClientFetcher.request (/home/simbo/umami/node_modules/@prisma/client/runtime/index.js:79355:15)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async module.exports.fJFN.__webpack_exports__.default (/home/simbo/umami/.next/server/pages/api/websites.js:1064:22)
at async apiResolver (/home/simbo/umami/node_modules/next/dist/next-server/server/api-utils.js:8:1)
at async Server.handleApiRequest (/home/simbo/umami/node_modules/next/dist/next-server/server/next-server.js:63:403)
at async Object.fn (/home/simbo/umami/node_modules/next/dist/next-server/server/next-server.js:55:530)
at async Router.execute (/home/simbo/umami/node_modules/next/dist/next-server/server/router.js:24:67)
at async Server.run (/home/simbo/umami/node_modules/next/dist/next-server/server/next-server.js:65:1023)
at async Server.handleRequest (/home/simbo/umami/node_modules/next/dist/next-server/server/next-server.js:33:450) {
code: 'ENOENT',
clientVersion: '2.12.1',
meta: undefined
}
How to reproduce
- use prisma client on linux
- delete
/tmp/prisma-*.sock
file - see error
Expected behavior
Prisma should handle deleted temporary files (e.g. recreate).
Prisma information
prisma 2.12.1 (as dependency of umami 1.10.0)
Environment & setup
- OS: Red Hat 4.8.5-39
- Database: mysql
- Node.js version: 14.15.0
- Prisma version: 2.12.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Unix domain socket file not removed on application crash
Problem: When main application is closed gracefully the UDS file is removed. But in case of an application crash, this UDS file is...
Read more >Socket Server raises error 8982 after the server-socket object ...
Socket Server raises error 8982 after the server-socket object is deleted. An OpenEdge application creates and deletes a server-socket. If ...
Read more >How to deal with high file descriptor usage due to orphaned ...
The recommended solution for the orphaned sockets, is to analyze at the deepest level possible, which condition is causing sockets to be abruptly...
Read more >option to remove socket/fifo when the socket unit is stopped
Not removing the socket/FIFO file from the filesystem is currently intentional. This comment is in socket_close_fds(): /* One little note: we should never ......
Read more >How to cleanup SSH reverse tunnel socket after connection ...
The reason this happens is because unix socket files are not automatically removed when the socket is closed. They need to be manually...
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 suggest introducing a parameter to the PrismaClient constructor like so:
or
In the future, if we introduce N-API bindings for the engine, we can then also have:
Thanks for the comments! @matthewmueller :
In Lambda
/tmp
is the only writeable path, that’s the main reason.According to Lambda docs, it shouldn’t, but is possible depending on OS. (It’s something we can’t count on)
Interesting direction, but I would wait a bit until we understand the situation better before we introduce such a new concept
@yoshuawuyts :
That is correct! I was just thinking about other possible values for such an enum, but it’s indeed unlikely that it would end up in there. Allowing both at the same time still sound desirable to me though, but that could e.g. be configured in the schema instead.
In a related issue, https://github.com/prisma/prisma/issues/4557 we got reports, that disabling UDS and enabling TCP again fixed their issue. That’s why we just changed the default back to TCP until we understand the UDS situation better.
Therefore this issue can be closed.