Hi. I’am getting the following error when node.js starts:
Error: Connection in subscriber mode, only subscriber commands may be used
12:37:46 socketio.1 | at RedisClient.send_command (/Users/saguas/erpnext4/erpnext/frappe_v5/frappe-bench/node_modules/redis/index.js:834:15)
12:37:46 socketio.1 | at RedisClient.(anonymous function) (/Users/saguas/erpnext4/erpnext/frappe_v5/frappe-bench/node_modules/redis/index.js:991:25)
12:37:46 socketio.1 | at send_existing_lines (/Users/saguas/erpnext4/erpnext/frappe_v5/frappe-bench/apps/frappe/socketio.js:125:13)
12:37:46 socketio.1 | at Socket.<anonymous> (/Users/saguas/erpnext4/erpnext/frappe_v5/frappe-bench/apps/frappe/socketio.js:64:3)
12:37:46 socketio.1 | at Socket.emit (events.js:107:17)
12:37:46 socketio.1 | at Socket.onevent (/Users/saguas/erpnext4/erpnext/frappe_v5/frappe-bench/node_modules/socket.io/lib/socket.js:330:8)
12:37:46 socketio.1 | at Socket.onpacket (/Users/saguas/erpnext4/erpnext/frappe_v5/frappe-bench/node_modules/socket.io/lib/socket.js:290:12)
12:37:46 socketio.1 | at Client.ondecoded (/Users/saguas/erpnext4/erpnext/frappe_v5/frappe-bench/node_modules/socket.io/lib/client.js:193:14)
12:37:46 socketio.1 | at Decoder.Emitter.emit (/Users/saguas/erpnext4/erpnext/frappe_v5/frappe-bench/node_modules/socket.io/node_modules/socket.io-parser/node_modules/component-emitter/index.js:134:20)
12:37:46 socketio.1 | at Decoder.add (/Users/saguas/erpnext4/erpnext/frappe_v5/frappe-bench/node_modules/socket.io/node_modules/socket.io-parser/index.js:247:12)
I check in redis docs and they say:
Once the client enters the subscribed state it is not supposed to issue any other commands, except for additional SUBSCRIBE, PSUBSCRIBE, UNSUBSCRIBE and PUNSUBSCRIBE commands.
I check socketio.js file and if i create another client var r = redis.createClient(12311);
and in line 125 change subscriber to r.hgetall everything runs well again.
But if the problem is mine let me know how to solve it.
Thanks.