RMko
RMko
DDeno
Created by RMko on 3/18/2024 in #help
PermissionDenied while using ioredis npm package
When it comes to the code: I have simple Singleton redis client:
import { Redis } from "npm:ioredis@5.3.2";

export class RedisClient {
private static instance: RedisClient;
private readonly client: Redis;

private constructor() {
// this client initialization is causing the issue
this.client = new Redis({
port: 6379,
host: "172.17.0.1",
db: 0,
});
}

public static getInstance(): RedisClient {
if (!RedisClient.instance) {
RedisClient.instance = new RedisClient();
}
return RedisClient.instance;
}
}
import { Redis } from "npm:ioredis@5.3.2";

export class RedisClient {
private static instance: RedisClient;
private readonly client: Redis;

private constructor() {
// this client initialization is causing the issue
this.client = new Redis({
port: 6379,
host: "172.17.0.1",
db: 0,
});
}

public static getInstance(): RedisClient {
if (!RedisClient.instance) {
RedisClient.instance = new RedisClient();
}
return RedisClient.instance;
}
}
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
7 replies
DDeno
Created by RMko on 3/18/2024 in #help
PermissionDenied while using ioredis npm package
Sure, here is the command:
deno run \
--allow-env=REDIS_PORT,NODES,PORT,KEYS,NODES,redisPort,redisEndpoint,redisUsername,redisPW,ITERATIONS,BATCH_SIZE,DEBUG,DENOAPP_PORT \
--allow-net \
denoapp/app.ts
deno run \
--allow-env=REDIS_PORT,NODES,PORT,KEYS,NODES,redisPort,redisEndpoint,redisUsername,redisPW,ITERATIONS,BATCH_SIZE,DEBUG,DENOAPP_PORT \
--allow-net \
denoapp/app.ts
7 replies
DDeno
Created by RMko on 3/18/2024 in #help
PermissionDenied while using ioredis npm package
@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
7 replies