UCP Failed updating libraries!

Hi,
I have issue after freepbx modules updates. After update not starting UCP NODE daemon. I try to install it from CLI and got a many errors:

# fwconsole ma install ucp
Updating tables ucp_sessions...Done
System : sangoma
Installing/Updating Required Libraries. This may take a while...The following messages are ONLY FOR DEBUGGING. Ignore anything that says 'WARN' or is just a warning
Running installation..

> [email protected] install /var/www/html/admin/modules/ucp/node/node_modules/mariasql
> node-gyp rebuild

gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: tunneling socket could not be established, statusCode=403
gyp ERR! stack     at ClientRequest.onConnect (/usr/lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js:166:19)
gyp ERR! stack     at Object.onceWrapper (events.js:319:30)
gyp ERR! stack     at emitThree (events.js:136:13)
gyp ERR! stack     at ClientRequest.emit (events.js:217:7)
gyp ERR! stack     at Socket.socketOnData (_http_client.js:474:11)
gyp ERR! stack     at emitOne (events.js:116:13)
gyp ERR! stack     at Socket.emit (events.js:211:7)
gyp ERR! stack     at addChunk (_stream_readable.js:263:12)
gyp ERR! stack     at readableAddChunk (_stream_readable.js:250:11)
gyp ERR! stack     at Socket.Readable.push (_stream_readable.js:208:10)
gyp ERR! System Linux 3.10.0-957.21.3.el7.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /var/www/html/admin/modules/ucp/node/node_modules/mariasql
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


npm ERR! A complete log of this run can be found in:
npm ERR!     /home/asterisk/.npm/_logs/2020-05-13T11_49_11_693Z-debug.log

Failed updating libraries!
Stopping old running processes...Done
Refreshing all UCP Assets, this could take a while...
Generating Module Scripts...Done
Generating Module CSS...Done
Generating Main Scripts...Done
Generating Main CSS...Done
Done!
Generating CSS...Done
Module ucp version 15.0.6.14 successfully installed
Updating Hooks...Done
Chowning directories...Done

FreePBX version: FreePBX 15.0.16.49

Hi !
What do you see when running this command?

fwconsole pm2 --list

Try this: fwconsole start ucpnode

Also, on the GUI go to Admin > Advanced Settings > Search for NodeJS Server and be sure that is enabled there.

I see this modules:
# fwconsole pm2 --list
±-------------±-----±-------±---------±-----------------------±----±--------+
| Process Name | PID | Status | Restarts | Uptime | CPU | Mem |
±-------------±-----±-------±---------±-----------------------±----±--------+
| core-fastagi | 1711 | online | 0 | 16 minutes, 48 seconds | 0% | 22.37MB |
| xmpp | 2512 | online | 0 | 16 minutes, 41 seconds | 0% | 82.22MB |
| restapps | 7261 | online | 0 | 20 seconds | 0% | 40.19MB |
±-------------±-----±-------±---------±-----------------------±----±--------+

And when I try to run ucpnode:
# fwconsole start ucpnode
Running FreePBX startup…
Taking too long? Customize the chown command, See …
Setting Permissions…
Setting base permissions…Done
Setting specific permissions…
36401 [============================]
Finished setting permissions
Unable to run Pre-Asterisk hooks, because Asterisk is already running on PID 1491 and has been running for 17 minutes, 29 seconds

Did you take a look at Advanced Settings if NodeJS Server is enabled ?

Yes, it was enabled by default:

Try this: fwconsole start ucp
And after that see if it’s running with fwconsole pm2 --list | grep ucp

# fwconsole start ucp
Running FreePBX startup...
Taking too long? Customize the chown command, See 
Setting Permissions...
Setting base permissions...Done
Setting specific permissions...
 36433 [============================]
Finished setting permissions
Unable to run Pre-Asterisk hooks, because Asterisk is already running on PID 1491 and has been running for 42 minutes, 43 seconds
Running Asterisk post from Ucp module
Starting UCP Node Server...
[>---------------------------] < 1 sec
Started UCP Node Server. PID is 13044

# fwconsole pm2 --list | grep ucp
| ucp          | 0     | errored | 15       | 0                      | 0%  | 0.00B   |

It is in errored state. :confused:

That’s weird, just to be sure, all system packages updated? what about modules?

yum update && fwconsole ma upgradeall

fwconsole ma downloadinstall ucp --force

And then again fwconsole pm2 --list | grep ucp

OS and Modules updates are installed latest. When I trying to install ucp, I’m getting this npm errors related to mariasql lib:

# fwconsole ma downloadinstall ucp --force
No repos specified, using: [standard] from last GUI settings

Downloading module 'ucp'
Processing ucp
Downloading...
 4267705/4267705 [============================] 100%
Finished downloading
Extracting...Done
Download completed in 5 seconds
Updating tables ucp_sessions...Done
System : sangoma
Installing/Updating Required Libraries. This may take a while...The following messages are ONLY FOR DEBUGGING. Ignore anything that says 'WARN' or is just a warning
Running installation..
npm WARN deprecated [email protected]: Use uuid module instead
npm WARN deprecated [email protected]: this package is deprecated please use https://www.npmjs.com/package/@xmpp/client
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this package is deprecated please use https://github.com/xmppjs/xmpp.js
npm WARN deprecated [email protected]: this package is deprecated please use https://github.com/xmppjs/xmpp.js
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha1-udryrcRbGabMX9LwSPjZQGzs5Jg= integrity checksum failed when using sha1: wanted sha1-udryrcRbGabMX9LwSPjZQGzs5Jg= but got sha512-wZK/v5ZaNaSUs2Wnwh2YSX/Jqv6bQHKNEwojdzV11tByKziR9ikOssf5tvUhx+8/oCBz6AakOFAjZuqPoiRHJQ==. (3717 bytes)
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.

> [email protected] install /var/www/html/admin/modules/ucp/node/node_modules/mariasql
> node-gyp rebuild

gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: tunneling socket could not be established, statusCode=403
gyp ERR! stack     at ClientRequest.onConnect (/usr/lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js:166:19)
gyp ERR! stack     at Object.onceWrapper (events.js:319:30)
gyp ERR! stack     at emitThree (events.js:136:13)
gyp ERR! stack     at ClientRequest.emit (events.js:217:7)
gyp ERR! stack     at Socket.socketOnData (_http_client.js:474:11)
gyp ERR! stack     at emitOne (events.js:116:13)
gyp ERR! stack     at Socket.emit (events.js:211:7)
gyp ERR! stack     at addChunk (_stream_readable.js:263:12)
gyp ERR! stack     at readableAddChunk (_stream_readable.js:250:11)
gyp ERR! stack     at Socket.Readable.push (_stream_readable.js:208:10)
gyp ERR! System Linux 3.10.0-957.21.3.el7.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /var/www/html/admin/modules/ucp/node/node_modules/mariasql
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/asterisk/.npm/_logs/2020-05-13T13_22_46_969Z-debug.log

Failed updating libraries!
Stopping old running processes...Done
Refreshing all UCP Assets, this could take a while...
Generating Module Scripts...Done
Generating Module CSS...Done
Generating Main Scripts...Done
Generating Main CSS...Done
Done!
Generating CSS...Done
Module ucp version 15.0.6.14 successfully installed
Updating Hooks...Done
Chowning directories...Done

In ucp_error log I see this errors:
2020-05-13 15:53 +03:00: Error: Cannot find module ‘mariasql’
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/var/www/html/admin/modules/ucp/node/lib/freepbx.js:11:15)
at Module._compile (module.js:652:30)
at Object.Module._extensions…js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)

I found issue! My proxy server not allowed connection to nodejs repos. After allowing connections to nodejs.org it installed witout errors and now UCP is running:

# fwconsole pm2 --list | grep ucp
| ucp          | 15410 | online | 0        | 12 seconds             | 0%  | 35.47MB  |

Kudos @ slobera for help :slight_smile:

Nice @hardsoda good catch!

Take care!

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.