You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone,
I'm facing Unhandled Rejection when adding RedisAdapter to my socketIO server. Using this syntax : io.adapter(createAdapter(pubClient, subClient));
After many breakpoints through my own project and @socket.io >redis-adapter > dist > index.js file. It appears that the real problem is that my client has no permissions to perform subscribe, psubscribe and publish commands. The solution is then to add these commands in the white list of the redis server for the given user.
Yes but ... I can't let unhandled rejection occur in my project..
Off course I attached "error" listeners on both sub and pub clients but it still rejects out of them. I tried all the possible listeners on as many object that inherit from EventEmitter as I could find hoping that it would solve my problem but still nothing.
I don't think showing you block of code will be of any help for you since I would not know what to show.
Below, the trace of the process.on('unhandledRejection', ...) eventListener that just tells me what I already know
Unhandled Rejection at: Promise Promise { <rejected> [ErrorReply: NOPERM this user has no permissions to run the 'psubscribe' command], [Symbol(async_id_symbol)]: 2709, [Symbol(trigger_async_id_symbol)]: 2609, [Symbol(destroyed)]: { destroyed: false } } reason: [ErrorReply: NOPERM this user has no permissions to run the 'psubscribe' command] at process.<anonymous> (C:\Users\33778\Documents\Stage Ubikap\ubikap-back\src\main\js\server.js:154:17) at process.emit (events.js:400:28) at process.emit (domain.js:475:12) at processPromiseRejections (internal/process/promises.js:245:33) at processTicksAndRejections (internal/process/task_queues.js:96:32) Trace: Unhandled Rejection at: Promise Promise { <rejected> [ErrorReply: NOPERM this user has no permissions to run the 'subscribe' command], [Symbol(async_id_symbol)]: 2711, [Symbol(trigger_async_id_symbol)]: 2609, [Symbol(destroyed)]: { destroyed: false } } reason: [ErrorReply: NOPERM this user has no permissions to run the 'subscribe' command] at process.<anonymous> (C:\Users\33778\Documents\Stage Ubikap\ubikap-back\src\main\js\server.js:154:17) at process.emit (events.js:400:28) at process.emit (domain.js:475:12) at processPromiseRejections (internal/process/promises.js:245:33) at processTicksAndRejections (internal/process/task_queues.js:96:32)
I also checked inside the @socket.io >redis-adapter > dist > index.js and breakpointed the constructor where some of the "forbidden" commands are called. In this file, the client well and truely has "error" eventListener in its _events property.
The problem may be that in this file, it seems that there is no error handling of any kind.
Could the "error" eventListener of the client only be triggered when redis commands are called within the project files and therefore not in the redisAdapter initialization ?
Does anyone ever faced the same problem and found a solution ?
The text was updated successfully, but these errors were encountered:
Hi everyone,
I'm facing Unhandled Rejection when adding RedisAdapter to my socketIO server. Using this syntax :
io.adapter(createAdapter(pubClient, subClient));
After many breakpoints through my own project and
@socket.io >redis-adapter > dist > index.js
file. It appears that the real problem is that my client has no permissions to perform subscribe, psubscribe and publish commands. The solution is then to add these commands in the white list of the redis server for the given user.Yes but ... I can't let unhandled rejection occur in my project..
Off course I attached "error" listeners on both sub and pub clients but it still rejects out of them. I tried all the possible listeners on as many object that inherit from EventEmitter as I could find hoping that it would solve my problem but still nothing.
I don't think showing you block of code will be of any help for you since I would not know what to show.
Below, the trace of the process.on('unhandledRejection', ...) eventListener that just tells me what I already know
Unhandled Rejection at: Promise Promise { <rejected> [ErrorReply: NOPERM this user has no permissions to run the 'psubscribe' command], [Symbol(async_id_symbol)]: 2709, [Symbol(trigger_async_id_symbol)]: 2609, [Symbol(destroyed)]: { destroyed: false } } reason: [ErrorReply: NOPERM this user has no permissions to run the 'psubscribe' command] at process.<anonymous> (C:\Users\33778\Documents\Stage Ubikap\ubikap-back\src\main\js\server.js:154:17) at process.emit (events.js:400:28) at process.emit (domain.js:475:12) at processPromiseRejections (internal/process/promises.js:245:33) at processTicksAndRejections (internal/process/task_queues.js:96:32) Trace: Unhandled Rejection at: Promise Promise { <rejected> [ErrorReply: NOPERM this user has no permissions to run the 'subscribe' command], [Symbol(async_id_symbol)]: 2711, [Symbol(trigger_async_id_symbol)]: 2609, [Symbol(destroyed)]: { destroyed: false } } reason: [ErrorReply: NOPERM this user has no permissions to run the 'subscribe' command] at process.<anonymous> (C:\Users\33778\Documents\Stage Ubikap\ubikap-back\src\main\js\server.js:154:17) at process.emit (events.js:400:28) at process.emit (domain.js:475:12) at processPromiseRejections (internal/process/promises.js:245:33) at processTicksAndRejections (internal/process/task_queues.js:96:32)
I also checked inside the
@socket.io >redis-adapter > dist > index.js
and breakpointed the constructor where some of the "forbidden" commands are called. In this file, the client well and truely has "error" eventListener in its _events property.The problem may be that in this file, it seems that there is no error handling of any kind.
Could the "error" eventListener of the client only be triggered when redis commands are called within the project files and therefore not in the redisAdapter initialization ?
Does anyone ever faced the same problem and found a solution ?
The text was updated successfully, but these errors were encountered: