Pm2 install problems

for now im stuck using freepbx
cant upgrade to the latest version due to ongoing problems with pm2

/var/www/html/admin/modules/pm2/node/logs/install.log as follows:

Session terminated, killing shell...The process "runuser 'asterisk' -s '/bin/bash' -c 'cd /var/www/html/admin/modules/pm2/node && mkdir -p /home/asterisk/.pm2 && mkdir -p /var/www/html/admin/modules/pm2/node/logs && export HOME=/home/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 && npm install --only=production'" exceeded the timeout of 600 seconds.

Also,

fwconsole ma remove pm2
The following error(s) occured:
 - Failed to run un-installation scripts

And

fwconsole ma downloadinstall pm2
No repos specified, using: [standard,extended] from last GUI settings

Starting pm2 download..
Processing pm2
Verifying local module download...Verified
Extracting...Done
Module pm2 successfully downloaded
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..

Session terminated, killing shell...The process "runuser 'asterisk' -s '/bin/bash' -c 'cd /var/www/html/admin/modules/pm2/node && mkdir -p /home/asterisk/.pm2 && mkdir -p /var/www/html/admin/modules/pm2/node/logs && export HOME=/home/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 && npm install --only=production'" exceeded the timeout of 600 seconds.
Finished updating libraries!

There was an error installing. Please review the install log. (/var/www/html/admin/modules/pm2/node/logs/install.log)
Unable to install module pm2:
 - Failed to run installation scripts
Updating Hooks...Done

I’ve resintalled nodejs, no dice.

Runnign virtualised if that makes a difference, shmz 6.6

Thanks in advance for any help.

Having the same issues… fix would be nice as I can’t make any changes to the PBX now.

Found it was a network issue… somewhere upstream in one of the echanges (ours was seattle) the traffic wasn’t going through. Switched to our secondary provider and everything installed.

For us I couldnt reach these 2 IP addresses which were needed
151.101.52.162
163.172.101.189

Thanks for the suggestion. I have managed to ping both IP addresses from the machine in question. I’ll perform a packet capture on that IP, however, just in case and report back.

Okay, so, some follow-up. I’m running the latest version

cat /etc/schmooze/pbx-version
10.13.66-22

Current Asterisk Version: 13.19.1

FreePBX 13.0.194.5

but it seems to have broken mid-update because of this ^(&*^%( pm2 module

I have uninstalled npm and nodejs, and then reinstalled

node --version
v0.12.18

npm --version
2.15.11

fwconsole ma list
No repos specified, using: [standard] from last GUI settings

+---------------------+-------------+-----------------------------------+------------+
| Module              | Version     | Status                            | License    |
+---------------------+-------------+-----------------------------------+------------+
| accountcodepreserve | 13.0.2.2    | Enabled                           | GPLv2      |
| announcement        | 13.0.7.1    | Enabled                           | GPLv3+     |
| arimanager          | 13.0.4      | Enabled                           | GPLv3+     |
| asterisk-cli        | 13.0.4      | Enabled                           | GPLv3+     |
| asteriskinfo        | 13.0.7.1    | Enabled                           | GPLv3+     |
| backup              | 13.0.27.17  | Enabled                           | GPLv3+     |
| blacklist           | 13.0.14.9   | Enabled                           | GPLv3+     |
| builtin             |             | Enabled                           |            |
| bulkhandler         | 13.0.14.5   | Enabled                           | GPLv3+     |
| callback            | 13.0.5.2    | Enabled                           | GPLv3+     |
| callforward         | 13.0.4.2    | Enabled                           | AGPLv3+    |
| callrecording       | 13.0.11.5   | Enabled                           | AGPLv3+    |
| callwaiting         | 13.0.4.1    | Enabled                           | GPLv3+     |
| campon              | 13.0.4.1    | Enabled                           | GPLv3+     |
| cdr                 | 13.0.32     | Enabled                           | GPLv3+     |
| cel                 | 13.0.26.2   | Enabled                           | GPLv3+     |
| certman             | 13.0.37     | Enabled                           | AGPLv3+    |
| cidlookup           | 13.0.12.2   | Enabled                           | GPLv3+     |
| conferences         | 13.0.23.9   | Enabled                           | GPLv3+     |
| configedit          | 13.0.7.1    | Enabled                           | AGPLv3+    |
| contactmanager      | 13.0.42.12  | Enabled                           | GPLv3+     |
| core                | 13.0.122.13 | Enabled                           | GPLv3+     |
| cos                 | 13.0.12.1   | Enabled                           | Commercial |
| customappsreg       | 13.0.5.4    | Enabled                           | GPLv3+     |
| customcontexts      | 13.0.3      | Enabled                           | GPLv2+     |
| cxpanel             | 13.0.3.3    | Disabled                          | GPLv3      |
| dahdiconfig         | 13.0.33.13  | Enabled                           | GPLv3+     |
| dashboard           | 13.0.25.3   | Enabled                           | AGPLv3+    |
| daynight            | 13.0.15     | Enabled                           | GPLv3+     |
| dictate             | 13.0.5      | Enabled                           | GPLv3+     |
| digium_phones       | 13.0.7.4    | Enabled                           | GPLv2      |
| directory           | 13.0.19.5   | Enabled                           | GPLv3+     |
| disa                | 13.0.6.1    | Enabled                           | AGPLv3+    |
| donotdisturb        | 13.0.3.1    | Enabled                           | GPLv3+     |
| dundicheck          | 2.11.0.3    | Enabled                           | GPLv3+     |
| extensionsettings   | 13.0.4      | Enabled                           | GPLv3+     |
| fax                 | 13.0.40.5   | Enabled                           | GPLv3+     |
| featurecodeadmin    | 13.0.6.4    | Enabled                           | GPLv3+     |
| findmefollow        | 13.0.38.11  | Enabled                           | GPLv3+     |
| firewall            | 13.0.50     | Enabled                           | AGPLv3+    |
| framework           | 13.0.194.5  | Enabled                           | GPLv2+     |
| fw_langpacks        | 12.0.7      | Enabled                           | GPLv3+     |
| hotelwakeup         | 13.0.17.1   | Enabled                           | GPLv2      |
| iaxsettings         | 13.0.6.6    | Enabled                           | AGPLv3     |
| infoservices        | 13.0.1.2    | Enabled                           | GPLv2+     |
| irc                 | 2.11.0.7    | Enabled                           | GPLv3+     |
| ivr                 | 13.0.27.6   | Enabled                           | GPLv3+     |
| languages           | 13.0.6      | Enabled                           | GPLv3+     |
| logfiles            | 13.0.10.4   | Enabled                           | GPLv3+     |
| manager             | 13.0.2.5    | Enabled                           | GPLv2+     |
| miscapps            | 13.0.3.1    | Enabled                           | GPLv3+     |
| miscdests           | 13.0.5      | Enabled                           | GPLv3+     |
| motif               | 13.0.4      | Enabled                           | GPLv3+     |
| music               | 13.0.22.3   | Enabled                           | GPLv3+     |
| outroutemsg         | 13.0.2.1    | Enabled                           | GPLv3+     |
| paging              | 13.0.26.5   | Enabled                           | GPLv3+     |
| parking             | 13.0.19.8   | Enabled                           | GPLv3+     |
| pbdirectory         | 2.11.0.6    | Enabled                           | GPLv3+     |
| phonebook           | 13.0.6.1    | Enabled                           | GPLv3+     |
| phpagiconf          | 2.11.0.2    | Enabled                           | GPLv3+     |
| phpinfo             | 13.0.2      | Enabled                           | GPLv2+     |
| pinsets             | 13.0.8      | Enabled                           | GPLv3+     |
| pm2                 |             | Not Installed (Locally available) | AGPLv3+    |
| pms                 | 13.0.2.10   | Enabled                           | Commercial |
| presencestate       | 13.0.8      | Enabled                           | GPLv3+     |
| printextensions     | 13.0.3.1    | Enabled                           | GPLv3+     |
| queuemetrics        | 2.11.0.3    | Enabled                           | GPLv3+     |
| queueprio           | 13.0.2      | Enabled                           | GPLv3+     |
| queues              | 13.0.34.9   | Enabled                           | GPLv2+     |
| recordings          | 13.0.30.12  | Enabled                           | GPLv3+     |
| restapi             | 13.0.21.1   | Enabled                           | AGPLv3     |
| restapps            |             | Not Installed (Locally available) | Commercial |
| ringgroups          | 13.0.23.2   | Enabled                           | GPLv3+     |
| setcid              | 13.0.6.2    | Enabled                           | GPLv3+     |
| sipsettings         | 13.0.27.1   | Enabled                           | AGPLv3+    |
| sipstation          | 13.0.14.8   | Enabled                           | Commercial |
| sms                 | 13.0.12.3   | Enabled                           | Commercial |
| soundlang           | 13.0.24.5   | Enabled                           | GPLv3+     |
| speeddial           | 2.11.0.4    | Enabled                           | GPLv3+     |
| superfecta          | 13.0.4.5    | Enabled                           | GPLv2+     |
| sysadmin            | 13.0.76.3   | Enabled                           | Commercial |
| timeconditions      | 13.0.34.9   | Enabled                           | GPLv3+     |
| tts                 | 13.0.10     | Enabled                           | GPLv3+     |
| ttsengines          | 13.0.7.3    | Enabled                           | AGPLv3     |
| ucp                 | 13.0.42.6   | Enabled                           | AGPLv3+    |
| ucpnode             |             | Not Installed (Locally available) | Commercial |
| userman             | 13.0.76.38  | Enabled                           | AGPLv3+    |
| versionupgrade      | 13.0.1.2    | Enabled                           | Commercial |
| vmblast             | 13.0.8      | Enabled                           | GPLv3+     |
| voicemail           | 13.0.54.20  | Enabled                           | GPLv3+     |
| weakpasswords       | 13.0.2      | Enabled                           | GPLv3+     |
| webrtc              | 13.0.32.8   | Enabled                           | GPLv3+     |
| xmpp                |             | Not Installed (Locally available) | AGPLv3     |
+---------------------+-------------+-----------------------------------+------------+

then I

fwconsole ma remove pm2
fwconsole ma remove restapps
fwconsole ma remove ucpnode
fwconsole ma remove xmpp

then once again with the upgrade script (it should install what it needs automatically, right?)

./upgrade-10.13.66-22.sh 
Check to make sure this is a FreePBX Distro system before executing
This appears to be a FreePBX Distro system as it has a Distro Version of 10.13.66-22

Your FreePBX Distro System is being upgraded to 10.13.66-22. Please standby...


STAGE 1 STARTING - GUI Modules

Machine not activated
Loaded plugins: fastestmirror, kmod
Setting up Update Process
Loading mirror speeds from cached hostfile
No Packages marked for Update

 Upgrade All FreePBX GUI Modules

[AMPSBIN] changed from previous value: [/usr/local/sbin] to new value: [/usr/sbin]

Taking too long? Customize the chown command, See http://wiki.freepbx.org/display/FOP/FreePBX+Chown+Conf
Setting Permissions...
Setting base permissions...Done
Setting specific permissions...
 18341 [============================]
Finished setting permissions
No repos specified, using: [standard] from last GUI settings

Up to date.
Installing: pm2, ucpnode, xmpp
Downloading & Installing pm2...
Starting pm2 download..
Processing pm2
Verifying local module download...Verified
Extracting...Done
Module pm2 successfully downloaded
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..

Session terminated, killing shell...The process "runuser 'asterisk' -s '/bin/bash' -c 'cd /var/www/html/admin/modules/pm2/node && mkdir -p /home/asterisk/.pm2 && mkdir -p /var/www/html/admin/modules/pm2/node/logs && export HOME=/home/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 && npm install --only=production'" exceeded the timeout of 600 seconds.
Finished updating libraries!


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
  [Symfony\Component\Process\Exception\ProcessFailedException]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
  The command "runuser 'asterisk' -s '/bin/bash' -c 'cd /var/www/html/admin/modules/pm2/node && mkdir -p /home/asterisk/.pm2 && mkdir -p /var/www/html/admin/modules/pm2/node/logs && export HOME=/home/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 ping'" failed.  
  Exit Code: 1(General error)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
  Output:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
  ================                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
  Error Output:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
  ================                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
  module.js:338                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
      throw err;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
            ^                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
  Error: Cannot find module 'debug'                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
      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/pm2/node/node_modules/pm2/constants.js:7:14)                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
      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)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

you can imagine what happens when it tries the other modules which require pm2

fping -C 10 151.101.52.162 163.172.101.189
151.101.52.162  : [0], 84 bytes, 174 ms (174 avg, 0% loss)
163.172.101.189 : [0], 84 bytes, 316 ms (316 avg, 0% loss)
151.101.52.162  : [1], 84 bytes, 176 ms (175 avg, 0% loss)
163.172.101.189 : [1], 84 bytes, 317 ms (317 avg, 0% loss)
151.101.52.162  : [2], 84 bytes, 174 ms (175 avg, 0% loss)
163.172.101.189 : [2], 84 bytes, 317 ms (317 avg, 0% loss)
151.101.52.162  : [3], 84 bytes, 174 ms (175 avg, 0% loss)
163.172.101.189 : [3], 84 bytes, 318 ms (317 avg, 0% loss)
151.101.52.162  : [4], 84 bytes, 175 ms (175 avg, 0% loss)
163.172.101.189 : [4], 84 bytes, 317 ms (317 avg, 0% loss)
151.101.52.162  : [5], 84 bytes, 175 ms (175 avg, 0% loss)
163.172.101.189 : [5], 84 bytes, 317 ms (317 avg, 0% loss)
151.101.52.162  : [6], 84 bytes, 175 ms (175 avg, 0% loss)
163.172.101.189 : [6], 84 bytes, 317 ms (317 avg, 0% loss)
151.101.52.162  : [7], 84 bytes, 175 ms (175 avg, 0% loss)
163.172.101.189 : [7], 84 bytes, 317 ms (317 avg, 0% loss)
151.101.52.162  : [8], 84 bytes, 174 ms (175 avg, 0% loss)
163.172.101.189 : [8], 84 bytes, 317 ms (317 avg, 0% loss)
151.101.52.162  : [9], 84 bytes, 174 ms (175 avg, 0% loss)
163.172.101.189 : [9], 84 bytes, 317 ms (317 avg, 0% loss)

151.101.52.162  : 174.81 176.59 174.96 174.82 175.48 175.69 175.09 175.48 174.81 174.87
163.172.101.189 : 316.78 317.29 317.82 318.03 317.80 317.03 317.94 317.83 317.98 317.49

so there shouldn’t be any connectivity issues there.

npm i debug

this just sits at the loading rotating bar thing and does nothing for approximately forever
the firewall can see connectivity from the server to 151.101.28.162, which I assume is the alternative here, but this doesn’t have issues either.

Yet another day spent on this product that I really need to spend elsewhere in the business. Nothing should take this much administration effort and time just for simple updates. Unfortunately, I’m stuck with it for the forseeable future due to other infrastructure that requires it. Any help really appreciated so I can stop spending time on this &^%)&^*& thing.

You have connectivity issues with the npm registry. This is out of the control of freepbx

Thank you for confirming what the previous poster had mentioned.

This appears to be a well-documented issue in Google, so as you’re at the helm of the project is it possible to get the --verbose output (in FPBX itself) to show what the command is trying to connect to? If I can understand where it is failing, I can track down what the problem is (DNS, connectivity, routing, etc etc).

Currently diagnosis requires roundabout methods of research and posting on this forum. I will do some independent research on the registry and post back what I find.

Thanks in advance.

Didn’t you already get that by running npm i debug yourself

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