A co-worker has encountered a strange issue where their containerized app, which is running under lowered privileges, sometimes crashes at startup with a mysterious EPERM: operation not permitted, open
operation. Something is trying to write to a file under node_modules
(node_modules/winston/lib/winston.js
to be exact). That file exists but only with read permissions. Sadly this is intermittent, and I cannot reproduce locally. Given that winston
is a popular logging library, I can't help but suspect malware is at play here.
Is there a way to find the source of failed FS write attempts? I would love to see a stack trace, for example. We've already tried NODE_DEBUG=fs
, but that outputs no additional information.
Full and only output before the process exits:
Error: EPERM: operation not permitted, open '/src/node_modules/winston/lib/winston.js'
Code: EPERM