Redis-queue FATAL and node-socketio FATAL

One symptom: I cannot seem to receive emails that are sent via documents such as invoices. looking at supervisorctl status i can see the following:

frappe-bench-redis:frappe-bench-redis-cache RUNNING    pid 1358, uptime 0:00:15
frappe-bench-redis:frappe-bench-redis-queue FATAL      Exited too quickly (proce                                                                           ss log may have details)
frappe-bench-redis:frappe-bench-redis-socketio RUNNING    pid 1359, uptime 0:00:                                                                           15
frappe-bench-web:frappe-bench-frappe-web RUNNING    pid 1353, uptime 0:00:15
frappe-bench-web:frappe-bench-node-socketio FATAL      Exited too quickly (proce                                                                           ss log may have details)
frappe-bench-workers:frappe-bench-frappe-default-worker-0 STARTING
frappe-bench-workers:frappe-bench-frappe-long-worker-0 STARTING
frappe-bench-workers:frappe-bench-frappe-schedule RUNNING    pid 1346, uptime 0:                                                                           00:15
frappe-bench-workers:frappe-bench-frappe-short-worker-0 STARTING

This is after the latest update. Dev.

1 Like

Can you try running :

bench setup socketio
bench setup redis
bench restart

@vjFaLk thanks but it still doesnt work

bench restart
frappe-bench-frappe-web: stopped
frappe-bench-frappe-schedule: stopped
frappe-bench-node-socketio: started
frappe-bench-frappe-web: started
frappe-bench-frappe-schedule: started
frappe-bench-frappe-default-worker-0: ERROR (abnormal termination)
frappe-bench-frappe-long-worker-0: ERROR (abnormal termination)
frappe-bench-frappe-short-worker-0: ERROR (abnormal termination) 

any ideas?

in redis-queue.log i see this:

[15306] 11 May 23:19:06.864 # Unable to set the max number of files limit to 10032 (Operation not permitted), setting the max clients configuration to 3984.
[15306] 11 May 23:19:06.864 # Creating Server TCP listening socket 127.0.0.1:6379: bind: Address already in use

Core Devs, any chance you can help on this? Really need some help here. Not sure why redis is acting up and im really not sure where to look.

Core Devs, can you provide some guidance on this?

frappe-bench-redis:frappe-bench-redis-cache RUNNING pid 1358, uptime 0:13:50 frappe-bench-redis:frappe-bench-redis-queue RUNNING pid 1355, uptime 0:13:50 frappe-bench-redis:frappe-bench-redis-socketio RUNNING pid 1359, uptime 0:13:50 frappe-bench-web:frappe-bench-frappe-web RUNNING pid 1353, uptime 0:13:50 frappe-bench-web:frappe-bench-node-socketio RUNNING pid 1354, uptime 0:13:50 frappe-bench-workers:frappe-bench-frappe-default-worker-0 FATAL Exited too quickly (process log may have details) frappe-bench-workers:frappe-bench-frappe-long-worker-0 FATAL Exited too quickly (process log may have details) frappe-bench-workers:frappe-bench-frappe-schedule RUNNING pid 1349, uptime 0:13:50 frappe-bench-workers:frappe-bench-frappe-short-worker-0 FATAL Exited too quickly (process log may have details)

Which logs would indicate the problem with the workers? I changed the port for redis to avoid it conflicting with something else in the redis conf file. Do I need to update then elsewhere?

I have this warning
Redis cache server not running. Please contact Administrator / Tech support

and this in bench start

08:46:55 redis_socketio.1 | [5287] 25 Jul 08:46:55.490 # Unable to set the max number of files limit to 10032 (Operation not permitted), setting the max clients configuration to 3984.

and the socketio doent work

any chance?

@mostafa try $ bench setup socketio
and then run $ bench start

Having same problem as well… ran the above commands but not working still for socketio

Check that if your some process is occupying port for socketio,

Find Processes and PID:

$ ps -aux | grep socketio
AND
$ ps -aux | grep redis

Kill all zombie processes one by one with

$ kill -9 PID

replace PID with actual process ID

and then restart

$ bench start

dear all,

my consoleis getting flooded with the following error message from node-socketio: libs.min.js:3684 GET http://domain.com/socket.io/?EIO=3&transport=polling&t=1470597122656-10 502 (Bad Gateway)

Upon inspection of the logs and supervisorctl status, my node node-socketio keeps on starting after every 4 05 5 seconds. Looks like its terminating and supervisord is restarting it. Is anyone fcing the same issue?

ERPNext: 7.0.20
Frappe: 7.0.16

Hello,

  1. Use sudo killall -9 node from the commandline to kill any zombie processes that might be lingering and bound to your port. this sometimes happens with socket.io when it fails to shutdown properly.
  2. Check if web socket connections disabled in the firewall of the server?
  3. In my case It turned out to be SELinux permission issue and solved by running this command: sudo semanage port --add --type httpportt --proto tcp 9000 (Port number should match to as that of socketio)
  4. make sure that your domain points to your server.
  5. make sure that an nginx server block is running for your domain with ssl or w/o ssl enabled as per your setup.
  6. Check by any chance your are using CDN / CloudFlare (proxy mode on for domain), if so disabling it will solve the problem.

Thank you

Thanks @yashodhan for the response. I have my firewall and selinux disabled, running nginx and not using CDN/CloudFare. It is also not leaving any zombie processes behind when it terminates.

If it helps, I am using CentOS release 7.2.1511 and node v6.3.1

Have you even checked your socket.io is installed or not / nodejs installed/running?
You need to check both node-socketio.error.log and node-socketio.log
As well as You need to check both redis-socketio.error.log & redis-socketio.log under /home/frappe/frappe-bench/logs

$ bench doctor
$ bench update --requirements
$ bench setup socketio 
$ bench setup redis
$ bench retry-upgrade
$ sudo supervisorctl restart
$ sudo service nginx restart

You need minimum 1GB RAM, Check If your system is low on memory, because we seriously can’t help anything about it.

Dear @yashodhan,

I did everything you mentioned and my system has 60GB free memory. While checking the node-socketio.error.log log file, the following exception is causing the node to terminate. I tried to start node from commandline too, and it exits after encountering the exception below. When I comment out the responsible code block, node runs without issue.

 TypeError: Cannot read property 'user' of undefined
    at /home/frappe/emines/apps/frappe/socketio.js:48:54
    at Request.callback (/home/frappe/node_modules/superagent/lib/node/index.js:591:12)
    at IncomingMessage.<anonymous> (/home/frappe/node_modules/superagent/lib/node/index.js:766:18)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:975:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

@vjFaLk [v7] Node Socketio: TypeError: Cannot read property 'user' of undefined · Issue #5852 · frappe/erpnext · GitHub is closed but issue still persists, any clue?

@yashodhan @vjFaLk Any clues on this issue?

restart your os

reboot your server then it solve.

Running all the commands and restarting the server solves the problem

1 Like