Running FreePBX 13.0.191.11
ucpnode is not running and fails to start up.
I have already done the following:
ensured distro up to date
ensured all modules and framework up to date
uninstalled nodejs/npm
chowned permissions
reinstalled nodejs/npm
uninstalled and reinstalled ucpnode
here is the output from my ucpnode_err.log:
2017-05-31 11:55 -04:00: Error: Cannot find module '../build/Debug/sqlclient'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/var/www/html/admin/modules/ucpnode/node/node_modules/mariasql/lib/Client.js:13:11)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
[root@freepbx /]# cat /var/log/asterisk/ucpnode_err.log
I am open to suggestions as at this point I am completely stuck.
As a thought process, I am wondering if my self-signed certificate is screwing this up somehow (I did once try and failed to do a LetsEncrypt Certificate).
How long should the download install process take? In the past it was very quick, right now its just hanging out at
ā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ā
So this is NPM & NODEJS. We use nodejs primarily for realtime communications libraries. We need this over PHP because PHP isnāt well suited for what we call ānon-blocking tasksā what I mean by this is when i query the database in PHP it blocks the thread (the process) until it receives an event. This is fine in HTTP world. But in the world of realtime communications that block blocks the entire server so if you have 100 people connected and you are always blocking the server with requests nothing will be real time. Enter node and itās ānon-blockingā. High level overview.
Node has a package manager called NPM. During the install of modules we tell NPM to go out and and install a list of requirements. For ucpnode theres a list of about 6. Of those 6 they have dependencies and the list goes on. During their install process they go out and download requirements and/or they compile themselves locally against your system. In your case both of those things are happening. Which can make the process slow down.
On top of that some firewalls donāt like all of this network activity and they start to slow the connection down or timeout, which causes issues. Since we are using NPM this is sometimes hard to figure out when this has occurred, we are still working on it. This can also leave you in weird states where NPM says it installed everything but in reality it didnāt, hence ācannot find moduleāā¦
The process should eventually output something but it really depends on processor, ram, disk speed and bandwidth. Unfortunately these npm issues are out of our control, but we are trying to figure out how to make them better, itās just usually a result of network issues which makes them glitch out. Over PHP that is.
Sorry. To be more specific. I read your paragraph above and I understand that a lot of this is out of my control. What confuses me is that it was working when the deployment was initially rolled out (Jan. '17). It seems like over time upgrades and changes have caused this to no longer function. Will this be something I should just live with for the foreseeable future? Is there nothing else I can do? Will this functionality ever be restored?
Then you will have an option in Advanced Settings (you need to turn on read-only mode) that says āUse package caching for NPMā. Set this to false. Then try to install ucpnode. May or may not work.
I edged updated pm2 and then tried to edge update ucpnode. Everything goes fine for the pm2 upgrade but the ucpnode upgrade ends up hanging on Starting New UCP Node Processā¦