Connection to Event Socket failed.

Status
Not open for further replies.

AIC2000

Member
Feb 15, 2018
162
3
18
35
I am playing with a brand new install of FusionPBX. It's a dedicated server and after rebooting, it sometimes shows on the FusionPBX server:

Connection to Event Socket failed.

(see attached screenshot: Screen Shot 2018-06-30 at 10.54.14.png)

When trying to load up fs_cli it throws out the error:

[ERROR] fs_cli.c:1659 main() Error Connecting [Socket Connection Error]

I've checked Fail2ban, and iptables and nothing is being blocked that shouldn't. FreeSWITCH service says it's running fine on service status, and also the freeswitch.log shows no difference than when it works.

Usually restarting the freeswitch service resolves the issue, but that's no good that over 75% of the time rebooting the server it throws this hiccup?

Has anyone else experienced this before and have any pointers on what to check next?
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,076
577
113
Look at the freeswitch logfile just after startup and see if you can see whats going on.
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,076
577
113
PS there is also the possiblity that freeswitch is up but not fully started, does it work if you leave if for 10 minutes? Is this Debian.
 

AIC2000

Member
Feb 15, 2018
162
3
18
35
Done that, shows up as it would when it works. Even service freeswitch status shows fine with no error.
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,076
577
113
Just check you have haveged installed, it could be a lack of entropy, I have definitely seen similar:
Code:
apt install haveged
 

AIC2000

Member
Feb 15, 2018
162
3
18
35
It is Debian, I'll check the 10 min when I'm home shortly. No idea why a service freeswitch restart resolves it instantly though. Wouldn't haveged missing mean it would never work?
 

AIC2000

Member
Feb 15, 2018
162
3
18
35
OK just checked it out.

FreeSwitch loads fine in the logs after literally a few seconds

Log ends in:

FreeSWITCH Version 1.6.20-37-987c9b9~64bit (-37-987c9b9 64bit)

FreeSWITCH Started
Max Sessions [1000]
Session Rate [30]
SQL [Enabled]

I allowed uptime to get over 12 minutes and it's still failing to connect via Fusion: Connection to Event Socket failed. and fs_cli: [ERROR] fs_cli.c:1659 main() Error Connecting [Socket Connection Error]


and finally:

which haveged
/usr/sbin/haveged

It's already installed.

A simple freeswitch service restart resolves the issue though - but rebooting the machine FreeSwitch does this most (but not all) of the time!
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,076
577
113
Is there any reference to the event socket in the startup log? Also is this Jessie?
 

AIC2000

Member
Feb 15, 2018
162
3
18
35
I even started FreeSWITCH from console and it doesn't spit out any errors - especially relating to any failures (there are a couple of generic debug messages regarding MoH bit rates etc) but nothing serious.

Yes, Jessie:

Distributor ID: Debian
Description: Debian GNU/Linux 8.11 (jessie)
Release: 8.11
Codename: jessie
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,076
577
113
Its no good looking at the log from a good startup you need to examine the log from one where it does not start.
 

AIC2000

Member
Feb 15, 2018
162
3
18
35
That's the thing - it always seems to start. It even says running when you check the services. But no connection via fs_cli and Fusion.

Doing a service restart allows the socket connections via fs_cli and fusion, however I've noticed it won't respond to any SIP Register messages when the issue occurs - even after a freeswitch restart.

When a successful reboot and startup commences, things register and work fine.
 

AIC2000

Member
Feb 15, 2018
162
3
18
35
# service freeswitch status
● freeswitch.service - freeswitch
Loaded: loaded (/lib/systemd/system/freeswitch.service; enabled)
Active: active (running) since Sat 2018-06-30 19:50:59 BST; 2min 21s ago
Process: 743 ExecStart=/usr/bin/freeswitch -u www-data -g www-data -ncwait $DAEMON_OPTS (code=exited, status=0/SUCCESS)
Process: 740 ExecStartPre=/bin/chown -R www-data:www-data /var/run/freeswitch/ (code=exited, status=0/SUCCESS)
Process: 737 ExecStartPre=/bin/mkdir -p /var/run/freeswitch/ (code=exited, status=0/SUCCESS)
Main PID: 746 (freeswitch)
CGroup: /system.slice/freeswitch.service
└─746 /usr/bin/freeswitch -u www-data -g www-data -ncwait -nonat -ncwait -u www-data -g www-data -run /var/run/freeswitch

Jun 30 19:50:56 connect freeswitch[743]: 746 Backgrounding.
Jun 30 19:50:59 connect freeswitch[743]: FreeSWITCH[743] Waiting for background process pid:746 to be ready.....
Jun 30 19:50:59 connect freeswitch[743]: FreeSWITCH[743] System Ready pid:746
Jun 30 19:50:59 connect systemd[1]: Started freeswitch.
 

AIC2000

Member
Feb 15, 2018
162
3
18
35
I have IPV6 configured by default by Debian, but the configs all point to 127.0.0.1
 
Status
Not open for further replies.