PermissionDenied while using ioredis npm package
Hello, I'm facing an issue with an npm library ioredis (https://github.com/redis/ioredis). For some reason, when I tried to initialize a new Redis client using this package, I received an
error: error: Uncaught PermissionDenied: Requires env access, run again with the --allow-env flag
. No exact env variable is specified in the log. Yes, it works when I allow env globally, but for my system, I would like to avoid allowing all env variables. So, the question is, how can I check which env variables are accessed by this package, if any? How can I debug this issue and what should i put as allow env ?6 Replies
These are all the environment variables the
ioredis
package reads from (including intests and other files not published to npm) https://github.com/search?q=repo%3Aredis%2Fioredis%20process.env&type=code@marvinh. Thank you for your suggestion. After trying list all env variables into
--allow-env
, it didn't resolve the issue.
Adding stacktrace maybe can help:
at Object.toObject (ext:runtime/30_os.js:97:16)
at Object.ownKeys (ext:deno_node/_process/process.ts:59:41)
at Function.keys (<anonymous>)
at Object.<anonymous> (file:///deno-dir/npm/registry.npmjs.org/debug/4.3.4/src/node.js:124:30)
at Object.<anonymous> (file:///deno-dir/npm/registry.npmjs.org/debug/4.3.4/src/node.js:265:4)
at Module._compile (node:module:733:34)
at Object.Module._extensions..js (node:module:747:10)
at Module.load (node:module:658:32)
at Function.Module._load (node:module:539:12)
at Module.require (node:module:677:19)
Error 1
Can you share the full command including the
--allow-env
bit?Sure, here is the command:
The command looks correct, even if that list of environment variables seems a bit excessive if I may say so 😄 Is there an error message thrown or is
Error 1
all there is? Do you have a code snippet that reproduces the error? I'm not entirely sure why it's failing yet. I would've assumed there to be an error message as wellWhen it comes to the code:
I have simple Singleton redis client:
Regarding the error, there is only the i'm executiing line in the Makefile I'm using for my project:
make: *** [Makefile:42: dev-denoapp] Error 1