-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError when "DENIED Redis is running in protected mode ..." #2417
Comments
@JohnnyRacer as far as I can tell, this error means that the client got a reply from
If you want, I'll be happy to debug it with you, let me know.. :) |
|
Seems like |
@JohnnyRacer thanks for the information, I'll investigate that. Glad you found a workaround :) |
@leibale I ran into this issue as well. The Redis server will send I think the library should be able to handle this. |
@dtikhonov-iex the library should be able to handle these errors, that's why the issue is still open.. :) |
I have found another instance of this happening when using When using pub/subs in legacy mode, be sure to use the In legacyMode, this will throw the same error as OP. const heartbeat = redis_client.duplicate();
heartbeat.on('error', err => handleError(err));
heartbeat.connect()
.then(() => {
const listener = (incoming) => {
doListenerThings(incoming)
}
heartbeat.subscribe('key:key:key', listener);
})
.catch(err => handleError(err)) This works fine. const heartbeat = redis_client.duplicate();
heartbeat.on('error', err => handleError(err));
heartbeat.connect()
.then(() => {
const listener = (incoming) => {
doListenerThings(incoming)
}
//THIS IS THE DIFFERENCE
heartbeat.v4.subscribe('key:key:key', listener);
})
.catch(err => handleError(err)) |
Adding this here incase more information is wanted: Running this using the latest version of node 18 seems to resolve the issue, where as the latest LTS seems to cause issue. Recently migrated a program using this package to node 20 and we started finding this issue everytime we tried to start it. After reverting it back to node 18, it was fine again. Also using redis-stack-server in a docker container |
Hi, same issue with nodejs version 18.17.1 TypeError: Cannot destructure property 'resolve' of '__classPrivateFieldGet(...).shift(...)' as it is undefined.
at Object.onReply (/opt/def/def-puresocial-services/node_modules/@redis/client/dist/lib/client/commands-queue.js:62:25)
at RESP2Decoder.write (/opt/def/def-puresocial-services/node_modules/@redis/client/dist/lib/client/RESP2/decoder.js:119:26)
at RedisCommandsQueue.onReplyChunk (/opt/def/def-puresocial-services/node_modules/@redis/client/dist/lib/client/commands-queue.js:154:72)
at RedisSocket.<anonymous> (/opt/def/def-puresocial-services/node_modules/@redis/client/dist/lib/client/index.js:394:84)
at RedisSocket.emit (node:events:514:28)
at Socket.<anonymous> (/opt/def/def-puresocial-services/node_modules/@redis/client/dist/lib/client/socket.js:201:42)
at Socket.emit (node:events:514:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Readable.push (node:internal/streams/readable:234:10)
Node.js v18.17.1 Version of redis package is 4.6.10 |
i got this problem. then i found this only happens when connect to remote redis. i try redis-cli, got so this problem may not be this package's issue, but it is still makes people confuse. |
node 18.15.0, "cache-manager-redis-store": "^3.0.1", It happens when using remote redis while local development. After a couple of minutes this error appears: Error: Socket closed unexpectedly |
Thanks for your response, 🙌 it's work for me ❤️ |
I have the same issue, using it as described on the socket.io Redis adapter page. |
This occurs in my case when the client is waiting for the server to start up for the first time. As the queue returns undefined because there is nothing on the queue yet. Hacking in a solution into the transpiled javascript code, I've come to the following fix. I replace const { resolve, reject } = __classPrivateFieldGet(this, _RedisCommandsQueue_waitingForReply, "f").shift() with const { resolve, reject } = __classPrivateFieldGet(this, _RedisCommandsQueue_waitingForReply, "f").shift() || {resolve:()=>{}, reject:()=>{}}; and this solves my issue. Again this is a hack. The real issue stems from the non-null assertion operator found here in the source code.
UPDATELooks like this PR has a fix for the issue #2549 |
Had to hack this also. Would be great to have lib support. |
Redis Reinstallation Process
sudo apt-get purge --auto-remove redis-server redis
ps aux | grep redis
sudo nano /etc/redis/redis.conf Add the following lines, replacing
sudo apt install redis-tools
sudo systemctl restart redis This should help clarify the steps involved in the Redis reinstallation process! |
Description
I am getting a very strange type error everytime I try to use
docker compose up
to launch any script that connects to redis with the following error message:This error does not happen when I connect to redis using the node.js REPL without docker.
This is the docker-compose.yml file I am using to create the redis container:
And the code I am using in node.js to connect to redis
Node.js Version
19.6.1
Redis Server Version
6.2.8
Node Redis Version
4.6.4
Platform
Linux
Logs
No response
The text was updated successfully, but these errors were encountered: