Ucp node not starting after last update


FWIW, you’re not the only one experiencing this issue. It’s 100% reproducible here using the latest modules available.

[email protected]:~# fwconsole restart
Running FreePBX shutdown…

UCP Node Server is not running
Shutting down Asterisk Gracefully. Will forcefully kill after 30 seconds.
Press C to Cancel
Press N to shut down NOW
[============================] < 1 sec
Running FreePBX startup…
Starting Asterisk…
[============================] 8 secs
Asterisk Started
Starting UCP Node Server…

The command “runuser -l ‘asterisk’ -c 'cd /var/www/html/admin/modules/ucp/node && mkdir -p /home/asterisk/.pm2 && mkdir -p /var/www/html/admin/modules/ucp/node/logs && export HOME=”/hom
e/asterisk" && export PM2_HOME="/home/asterisk/.pm2" && export ASTLOGDIR="/var/log/asterisk" && export ASTVARLIBDIR="/var/lib/asterisk" && export PATH="$HOME/.node/bin:$PATH" && export
NODE_PATH="$HOME/.node/lib/node_modules:$NODE_PATH" && export MANPATH="$HOME/.node/share/man:$MANPATH" && /var/www/html/admin/modules/pm2/node/node_modules/pm2/bin/pm2 start /var/www/ht
ml/admin/modules/ucp/node/index.js --name ‘’‘ucp’’’ -e ‘’’/var/log/asterisk/ucp_err.log’’’ -o ‘’’/var/log/asterisk/ucp_out.log’’’ --merge-logs --log-date-format ‘’‘YYYY-MM-DD HH
:mm Z’’’’" failed.
Exit Code: 1(General error)
Working directory: /root


¦ App name ¦ id ¦ mode ¦ pid ¦ status ¦ restart ¦ uptime ¦ cpu ¦ mem ¦ watching ¦
¦ ucp ¦ 0 ¦ fork ¦ 17452 ¦ online ¦ 5 ¦ 12s ¦ 0% ¦ 46.6 MB ¦ disabled ¦
Use pm2 show <id|name> to get more details about an app
Error Output:

[PM2][ERROR] Script already launched, add -f option to force re-execution

(Tony Guadagno) #22

reraikes, sorry to hear you are having issues, but I am glad its not just me! hope something comes along soon to fix this.

(Andrew Nagy) #23

Thats not the same error Ron. Thanks for participating but your error is not what Tony experienced.

Sorry but these issues are completely separate.

Tony, your issue is this "Error: Cannot find module ‘…/build/Debug/sqlclient’"
Ron, your issue is permissions/startup based. you said it’s 100% reproducible but that’s not what Tony is experiencing at all. No where are you experiencing “Error: Cannot find module ‘…/build/Debug/sqlclient’”

Guys it’s really frustrating when you come into a thread with different information saying something like “FWIW, you’re not the only one experiencing this issue. It’s 100% reproducible here using the latest modules available.” when the issues are completely and utterly different (One is about missing modules the other is about startup issues, which look it did start so the module is not missing). Let’s try to stay focused and on topic. It’s exhausting if not and eventually it wears me out and I just sort of ‘give up’

On that note. Our QA team has full passed this with no issues.

I will investigate Tony’s issue when I have more time. I am currently investigating Ron’s issues but they are separate so a fix would not fix both of them (if this is a bug to begin with)

Thanks for your understanding.


Last week you told me userman had passed QA approval, but we both know how that turned out. :slight_smile:

(Andrew Nagy) #25


Tested with RC1.24 release and the issue is resolved in latest ISO.Closing the ticket.

Considering your issue is not related to this thread perhaps you should start your own thread for your own issue.

(Tony Guadagno) #26

fyi, i noticed that there were a boat load of edge updates and I applied them all (including ucp and core). after this, ucp is now starting!!! I am not sure which update did the trick, but all seems good now, thanks for all your efforts!

(Andrew Nagy) #27

Just so you are aware we made zero changes to this.

(Tony Guadagno) #28

andrew, judging by the errors in the ucp log, i was betting it was an issue with a dependency…is it possible that one of the other updates “righted” everything?..just wondering.

(Andrew Nagy) #29

Nope. None of the updates had anything to do with node.

(Infraestrutura Morphus) #30

Hello all.

I’m also running FreePBX 14 and I’m experiencing the same problem tonyg was before. Here’s the output from ucp_err.log:

2017-07-07 19:29 -03:00: Error: Cannot find module '../build/Debug/sqlclient'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/var/www/html/admin/modules/ucp/node/node_modules/mariasql/lib/Client.js:13:11)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

Upgrading modules using the edge repository did not fix the issue:

Module(s) requiring upgrades: core, findmefollow, firewall, sangomacrm, setcid, userman

I guess there’s something wrong with npm’s mariasql build process.

(Andrew Nagy) #31
rm -Rf /home/asterisk/{.npm,.npmrc,.node-gyp,.package_cache}
rm -Rf /var/www/html/admin/modules/pm2/node/node_modules
fwconsole ma install pm2
rm -Rf /var/www/html/admin/modules/ucp/node/node_modules
fwconsole ma install ucp

(Infraestrutura Morphus) #32

Hello Andrew,

Thank you for taking the time to reply. I got rid of the errors on ucp_err.log, but i’m still having issues. I get this when logged to UCP:

Unable to connect to the UCP Node Server because: ‘Error: xhr poll error’

Here’s the output from ucp_out.log:

2017-07-11 18:25 -03:00: Starting FreePBX…2017-07-11 18:25 -03:00: FreePBX is Ready!
2017-07-11 18:25 -03:00: Asterisk version is: 13.16.0
2017-07-11 18:25 -03:00: Loading all UCP Modules…
2017-07-11 18:25 -03:00: Loading…conferencespro.js
2017-07-11 18:25 -03:00: Loading…ucphelloworld.js
2017-07-11 18:25 -03:00: Loading…xmpp.js
2017-07-11 18:25 -03:00: Done!
2017-07-11 18:25 -03:00: Server up and running at 8001 port
2017-07-11 18:25 -03:00: Secure Server up and running at 8003 port

(Infraestrutura Morphus) #33

Actually, just found out this: using UCP over http does not generate this error and the control panel can be used without the constant nagging. Is that the expected behavior?

(Andrew Nagy) #34

UCP over http needs to have port 8001 opened up from the PBX. HTTPS needs 8003.

(Infraestrutura Morphus) #35

I see. I can that telnet to those ports from the host i was trying to use UCP via HTTPS, though. Still, if that’s the case, i got point that this was a default installation of the FreePBX Beta Distro, so the UCP link should probably be changed to HTTP. Thanks for the help.


These commands were handy when there was an update to php recently. I didn’t want to reboot the system to see if that would fix it. These steps did.