Node.js socketio.js subscribe/publish error!

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.

I don’t think anyone else is reporting it. Could be a change you did in your redis config?

Hi.

I still get the same error, but you are right in my other mac i don’t get the same error (but my other mac has a fresh installation of frappe and the mac that report the problem have been upgrading from older frappe since frappe 4). But the problem is not because redis.conf for celery (port 6389) because i copy redis.conf from one mac to the other and i also generate with bench the others redis configs (async and cache) and no luck.

And in the same computer (where the error happen) i get the same error in vagrant environment (and this environment have been upgrading since version 6).

Any ideias?

Thanks.

It is very weird no one report this error. But here it is the solution:

I just issue npm update in frappe-bench folder. It seem the problem was with socket.io module.

Thanks any way.

1 Like

I guess in the node world, things change faster than frappe :smile:

But in the frappe world we live in the edge! :construction: