PM2 won't install -- how do I troubleshoot?

PM2 was showing disabled pending upgrade from nnnnn.13 to nnnnn.15

fwconsole would not update it, but didn’t really return any errors either. It just acted like it was already fine when I tried to do an install/upgrade.

So I attempted to perform an uninstall using fwconsole. I disabled all reported dependencies, and then ran the uninstall. It immediately reported a failure to run uninstallation scripts, but now shows that it is not installed under fwconsole ma list

However, if I attempt to install it, I get the following:

fwconsole ma install pm2

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.

That’s followed by a spinning cursor which never stops. It just hangs here…forever.

So I’m wondering how I go about determining what is going on behind the scenes. I don’t even have a starting point for this, and just dropped $1000 on commercial module licenses.

fwconsole ma remove pm2
fwconsole ma downloadinstall pm2

No dice.

Verifying local module download…Verified (about 1 second)
Extracting…Done (pretty instant)
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. (stays here forever with a spinning cursor below it).

Surely there is a logging facility to provide a clue as to where it it getting stuck?

The logs are echoed back out to the screen.

The “spinning cursor” is from npm which is probably having connection issues on your machine.

Update.(and question)…

(and Thanks) – Let’s start with the Thanks. I appreciate the time you are taking to attempt to help out here very much.

followed by the question: I am unfamiliar with npm. What would it be trying (and failing) to connect to?

…and the Update:

I shutdown everything with fwconsole stop, and then renamed my /tmp folder.
I then created a new /tmp folder, gave it 777 permissions.

Next, I issued the fwconsole ma remove pm2
followed by fwconsole ma downloadinstall pm2

The resulting output:

# fwconsole ma downloadinstall pm2
No repos specified, using: [standard,extended,commercial] 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'" 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
#

Unfortunately, reading the referenced logfile is not possible, because the structure /var/www/html/admin/modules/pm2 does not exist. There is no pm2 directory under /var/www/html/admin/modules, but the installer is expecting to see ./pm2/node pre-existing in this location.

Creating those two directories as the asterisk user, and then re-running results in what so-far appears to be the same output. (It’s just sitting there saying “Running Installation…”)

However, I noticed that HTOP shows a lot of CPU being used by PM2 /home/asterisk/.pm2

Looking in this folder, I can see a logfile named pm2.log. tailing this file shows me a rapid loop of activity as follows:

2017-11-28 21:11:58: App [ucpnode] with id [1] and pid [16280], exited with code [1] via signal [SIGINT]
2017-11-28 21:11:58: Starting execution sequence in -fork mode- for app name:ucpnode id:1
2017-11-28 21:11:58: App name:ucpnode id:1 online
2017-11-28 21:11:59: App [restapps] with id [0] and pid [16279], exited with code [2] via signal [SIGINT]
2017-11-28 21:11:59: Starting execution sequence in -fork mode- for app name:restapps id:0
2017-11-28 21:11:59: App name:restapps id:0 online
2017-11-28 21:11:59: App [ucpnode] with id [1] and pid [16288], exited with code [1] via signal [SIGINT]
2017-11-28 21:11:59: Starting execution sequence in -fork mode- for app name:ucpnode id:1
2017-11-28 21:11:59: App name:ucpnode id:1 online
2017-11-28 21:11:59: App [restapps] with id [0] and pid [16293], exited with code [2] via signal [SIGINT]
2017-11-28 21:11:59: Starting execution sequence in -fork mode- for app name:restapps id:0
2017-11-28 21:11:59: App name:restapps id:0 online
2017-11-28 21:11:59: App [ucpnode] with id [1] and pid [16295], exited with code [1] via signal [SIGINT]
2017-11-28 21:11:59: Starting execution sequence in -fork mode- for app name:ucpnode id:1
2017-11-28 21:11:59: App name:ucpnode id:1 online
2017-11-28 21:11:59: App [ucpnode] with id [1] and pid [16303], exited with code [1] via signal [SIGINT]
2017-11-28 21:11:59: Starting execution sequence in -fork mode- for app name:ucpnode id:1
2017-11-28 21:11:59: App name:ucpnode id:1 online
2017-11-28 21:11:59: App [restapps] with id [0] and pid [16302], exited with code [2] via signal [SIGINT]
2017-11-28 21:11:59: Starting execution sequence in -fork mode- for app name:restapps id:0
2017-11-28 21:11:59: App name:restapps id:0 online
2017-11-28 21:11:59: App [ucpnode] with id [1] and pid [16311], exited with code [1] via signal [SIGINT]
2017-11-28 21:11:59: Starting execution sequence in -fork mode- for app name:ucpnode id:1
2017-11-28 21:11:59: App name:ucpnode id:1 online

I’m hoping this helps…

There has to be a pm2 folder somewhere. That is where the code is executed from.

The fact that you had to create this folder is a big issue.

Please run

fwconsole ma list

and

ls /var/www/html/admin/modules

The fwconsole ma list output was created while a fwconsole ma downloadinstall pm2 was running. Otherwise it would be showing it as missing – because I’ve done a fwconsole ma remove pm2.

Also, since my last message, I attempted to resolve the rapidly looping activity by issuing a fwconsole ma remove of ucpnode and restapps. The looping issue disappeared, but now it’s back to the original behavior of just spinning forever.
Clearing the /tmp folder doesn’t help it.

fwconsole ma list

No repos specified, using: [standard,extended,commercial] from last GUI settings

+---------------------+-------------+-----------------------------------+------------+
| Module              | Version     | Status                            | License    |
+---------------------+-------------+-----------------------------------+------------+
| accountcodepreserve | 13.0.2      | Enabled                           | GPLv2      |
| announcement        | 13.0.7.1    | Enabled                           | GPLv3+     |
| areminder           | 13.0.10.6   | Enabled                           | Commercial |
| arimanager          | 13.0.4      | Enabled                           | GPLv3+     |
| asterisk-cli        | 13.0.4      | Enabled                           | GPLv3+     |
| asteriskinfo        | 13.0.7.1    | Enabled                           | GPLv3+     |
| backup              | 13.0.27.3   | Enabled                           | GPLv3+     |
| blacklist           | 13.0.14.3   | Enabled                           | GPLv3+     |
| broadcast           | 13.0.12.7   | Enabled                           | Commercial |
| builtin             |             | Enabled                           |            |
| bulkhandler         | 13.0.14.4   | Enabled                           | GPLv3+     |
| callback            | 13.0.5.2    | Enabled                           | GPLv3+     |
| callerid            | 13.0.8.4    | Enabled                           | Commercial |
| callforward         | 13.0.4.1    | Enabled                           | AGPLv3+    |
| calllimit           | 13.0.5.5    | Enabled                           | Commercial |
| callrecording       | 13.0.11.5   | Enabled                           | AGPLv3+    |
| callwaiting         | 13.0.4.1    | Enabled                           | GPLv3+     |
| campon              | 13.0.4.1    | Enabled                           | GPLv3+     |
| cdr                 | 13.0.31     | Enabled                           | GPLv3+     |
| cel                 | 13.0.26.2   | Enabled                           | GPLv3+     |
| certman             | 13.0.36.10  | Enabled                           | AGPLv3+    |
| cidlookup           | 13.0.12.1   | Enabled                           | GPLv3+     |
| conferences         | 13.0.23.7   | Enabled                           | GPLv3+     |
| conferencespro      | 13.0.27.7   | Enabled                           | Commercial |
| configedit          | 13.0.7      | Enabled                           | AGPLv3+    |
| contactmanager      | 13.0.42.9   | Enabled                           | GPLv3+     |
| core                | 13.0.120.20 | Enabled                           | GPLv3+     |
| cos                 | 13.0.11.7   | Enabled                           | Commercial |
| customappsreg       | 13.0.5.2    | Enabled                           | GPLv3+     |
| cxpanel             | 13.0.4.3    | Enabled                           | GPLv3      |
| dahdiconfig         | 13.0.33.12  | 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.3    | Enabled                           | GPLv2      |
| directory           | 13.0.19.5   | Enabled                           | GPLv3+     |
| disa                | 13.0.6.1    | Enabled                           | AGPLv3+    |
| donotdisturb        | 13.0.3.1    | Enabled                           | GPLv3+     |
| endpoint            | 13.0.110    | Enabled                           | Commercial |
| extensionroutes     | 13.0.10.5   | Enabled                           | Commercial |
| fax                 | 13.0.40.4   | Enabled                           | GPLv3+     |
| faxpro              | 13.0.38.7   | Enabled                           | Commercial |
| featurecodeadmin    | 13.0.6.4    | Enabled                           | GPLv3+     |
| findmefollow        | 13.0.38.11  | Enabled                           | GPLv3+     |
| firewall            | 13.0.46.1   | Enabled                           | AGPLv3+    |
| framework           | 13.0.192.19 | Enabled                           | GPLv2+     |
| fw_langpacks        | 12.0.7      | Enabled                           | GPLv3+     |
| hotelwakeup         | 13.0.17.1   | Enabled                           | GPLv2      |
| iaxsettings         | 13.0.6.3    | Enabled                           | AGPLv3     |
| infoservices        | 13.0.1.1    | 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.3   | Enabled                           | GPLv3+     |
| manager             | 13.0.2.5    | Enabled                           | GPLv2+     |
| miscapps            | 13.0.3.1    | Enabled                           | GPLv3+     |
| miscdests           | 13.0.5      | Enabled                           | GPLv3+     |
| music               | 13.0.22.3   | Enabled                           | GPLv3+     |
| outroutemsg         | 13.0.2.1    | Enabled                           | GPLv3+     |
| paging              | 13.0.26.3   | Enabled                           | GPLv3+     |
| pagingpro           | 13.0.19.6   | Enabled                           | Commercial |
| parking             | 13.0.19.7   | Enabled                           | GPLv3+     |
| parkpro             | 13.0.30.9   | Enabled                           | Commercial |
| pbdirectory         | 2.11.0.6    | Enabled                           | GPLv3+     |
| phonebook           | 13.0.5.7    | Enabled                           | GPLv3+     |
| phpinfo             | 13.0.2      | Enabled                           | GPLv2+     |
| pinsets             | 13.0.8      | Enabled                           | GPLv3+     |
| pinsetspro          | 13.0.9.3    | Enabled                           | Commercial |
| pm2                 |             | Not Installed (Locally available) | AGPLv3+    |
| presencestate       | 13.0.7      | Enabled                           | GPLv3+     |
| printextensions     | 13.0.3.1    | Enabled                           | GPLv3+     |
| queueprio           | 13.0.2      | Enabled                           | GPLv3+     |
| queues              | 13.0.33     | Enabled                           | GPLv2+     |
| qxact_reports       | 13.0.15.2   | Enabled                           | Commercial |
| recording_report    | 13.0.24.6   | Enabled                           | Commercial |
| recordings          | 13.0.30.11  | Enabled                           | GPLv3+     |
| restapi             | 13.0.21.1   | Enabled                           | AGPLv3     |
| ringgroups          | 13.0.23     | Enabled                           | GPLv3+     |
| rmsadmin            | 13.0.14.1   | Enabled                           | Commercial |
| sangomacrm          | 13.0.1.22   | Disabled                          | Commercial |
| setcid              | 13.0.6      | Enabled                           | GPLv3+     |
| sipsettings         | 13.0.24.7   | Enabled                           | AGPLv3+    |
| sipstation          | 13.0.13.19  | Enabled                           | Commercial |
| sms                 | 13.0.11.1   | Enabled                           | Commercial |
| sng_mcu             | 13.0.5      | Enabled                           | Commercial |
| soundlang           | 13.0.24.3   | Enabled                           | GPLv3+     |
| speeddial           | 2.11.0.4    | Enabled                           | GPLv3+     |
| superfecta          | 13.0.4.1    | Enabled                           | GPLv2+     |
| sysadmin            | 13.0.74.4   | Enabled                           | Commercial |
| timeconditions      | 13.0.34.3   | Enabled                           | GPLv3+     |
| tts                 | 13.0.10     | Enabled                           | GPLv3+     |
| ttsengines          | 13.0.7      | Enabled                           | AGPLv3     |
| ucp                 | 13.0.42     | Enabled                           | AGPLv3+    |
| userman             | 13.0.76.25  | Enabled                           | AGPLv3+    |
| vmblast             | 13.0.8      | Enabled                           | GPLv3+     |
| vmnotify            | 13.0.18.2   | Enabled                           | Commercial |
| voicemail           | 13.0.54.8   | Enabled                           | GPLv3+     |
| voicemail_report    | 13.0.13.1   | Enabled                           | Commercial |
| vqplus              | 13.0.26.9   | Disabled                          | Commercial |
| weakpasswords       | 13.0.2      | Enabled                           | GPLv3+     |
| webcallback         | 13.0.11.2   | Enabled                           | Commercial |
| webrtc              | 13.0.32.5   | Enabled                           | GPLv3+     |
| xmpp                | 13.0.16.9   | Disabled                          | AGPLv3     |
| zulu                | 13.0.52.9   | Disabled                          | Commercial |
+---------------------+-------------+-----------------------------------+------------+

ls -alh

total 432K
drwxrwxr-x. 106 asterisk asterisk 4.0K Nov 28 22:02 .
drwxrwxr-x.  10 asterisk asterisk 4.0K Nov 27 22:57 ..
drwxrwxr-x.   3 asterisk asterisk 4.0K May 24  2017 accountcodepreserve
drwxrwxr-x    5 asterisk asterisk 4.0K Jun 23 10:12 announcement
drwxrwxr-x    9 asterisk asterisk 4.0K Jul 18 17:50 areminder
drwxrwxr-x.   6 asterisk asterisk 4.0K May 24  2017 arimanager
drwxrwxr-x.   4 asterisk asterisk 4.0K May 24  2017 asterisk-cli
drwxrwxr-x    4 asterisk asterisk 4.0K Jul 18 17:23 asteriskinfo
drwxrwxr-x    8 asterisk asterisk 4.0K Aug 22 18:54 backup
drwxrwxr-x    5 asterisk asterisk 4.0K Jun 28 13:38 blacklist
drwxrwxr-x    9 asterisk asterisk 4.0K May 16  2017 broadcast
drwxrwxr-x.   7 asterisk asterisk 4.0K May 24  2017 bulkhandler
drwxrwxr-x.   2 asterisk asterisk  12K Nov 28 22:02 _cache
drwxrwxr-x    6 asterisk asterisk 4.0K Jun 28 13:41 callback
drwxrwxr-x    8 asterisk asterisk 4.0K Jul 18 13:11 callerid
drwxrwxr-x    4 asterisk asterisk 4.0K Mar 16  2017 callforward
drwxrwxr-x    8 asterisk asterisk 4.0K May 23  2017 calllimit
drwxrwxr-x    6 asterisk asterisk 4.0K Aug 22 18:50 callrecording
drwxrwxr-x.   4 asterisk asterisk 4.0K May 24  2017 callwaiting
drwxrwxr-x.   4 asterisk asterisk 4.0K May 24  2017 campon
drwxrwxr-x    7 asterisk asterisk 4.0K Nov 22 19:38 cdr
drwxrwxr-x    7 asterisk asterisk 4.0K Feb  7  2017 cel
drwxrwxr-x    9 asterisk asterisk 4.0K Jun 28 13:46 certman
drwxrwxr-x.   6 asterisk asterisk 4.0K May 24  2017 cidlookup
drwxrwxr-x    6 asterisk asterisk 4.0K Jun 28 13:48 conferences
drwxrwxr-x    8 asterisk asterisk 4.0K Jun 19 14:42 conferencespro
drwxrwxr-x.   5 asterisk asterisk 4.0K May 24  2017 configedit
drwxrwxr-x    6 asterisk asterisk 4.0K Aug 14 14:50 contactmanager
drwxrwxr-x   12 asterisk asterisk 4.0K Nov 13 16:14 core
drwxrwxr-x    7 asterisk asterisk 4.0K Sep 20 13:44 cos
drwxrwxr-x    5 asterisk asterisk 4.0K Aug 14 14:48 customappsreg
drwxrwxr-x    5 asterisk asterisk 4.0K Nov 27 22:57 cxpanel
drwxrwxr-x.   9 asterisk asterisk 4.0K May 24  2017 dahdiconfig
drwxrwxr-x    8 asterisk asterisk 4.0K Aug 23 12:30 dashboard
drwxrwxr-x    6 asterisk asterisk 4.0K Oct 25 16:23 daynight
drwxrwxr-x.   5 asterisk asterisk 4.0K May 24  2017 dictate
drwxrwxr-x   10 asterisk asterisk 4.0K Aug  7 15:31 digium_phones
drwxrwxr-x    7 asterisk asterisk 4.0K Oct 24 15:59 directory
drwxrwxr-x    4 asterisk asterisk 4.0K Jun 28 13:55 disa
drwxrwxr-x    4 asterisk asterisk 4.0K Jun  1 19:27 donotdisturb
drwxrwxr-x   11 asterisk asterisk 4.0K Nov 27 22:57 endpoint
drwxrwxr-x    5 asterisk asterisk 4.0K Sep 20 13:49 extensionroutes
drwxrwxr-x    6 asterisk asterisk 4.0K Aug 22 19:38 fax
drwxrwxr-x    9 asterisk asterisk 4.0K Jul 27 18:55 faxpro
drwxrwxr-x    5 asterisk asterisk 4.0K Mar  7  2017 featurecodeadmin
drwxrwxr-x    7 asterisk asterisk 4.0K Aug 14 14:32 findmefollow
drwxrwxr-x   11 asterisk asterisk 4.0K Nov 21 16:44 firewall
drwxrwxr-x    3 asterisk asterisk 4.0K Nov 27 22:57 framework
drwxrwxr-x.   3 asterisk asterisk 4.0K May 24  2017 fw_langpacks
drwxrwxr-x    6 asterisk asterisk 4.0K Aug  7 15:31 hotelwakeup
drwxrwxr-x    5 asterisk asterisk 4.0K Mar 17  2017 iaxsettings
drwxrwxr-x    3 asterisk asterisk 4.0K Mar 16  2017 infoservices
drwxrwxr-x.   3 asterisk asterisk 4.0K May 24  2017 irc
drwxrwxr-x    6 asterisk asterisk 4.0K Sep 20 15:17 ivr
drwxrwxr-x.   5 asterisk asterisk 4.0K May 24  2017 languages
drwxrwxr-x    6 asterisk asterisk 4.0K Jun 28 14:37 logfiles
drwxrwxr-x.   4 asterisk asterisk 4.0K May 24  2017 manager
drwxrwxr-x    5 asterisk asterisk 4.0K Jul 24 17:45 miscapps
drwxrwxr-x    5 asterisk asterisk 4.0K May  1  2017 miscdests
drwxrwxr-x    5 asterisk asterisk 4.0K Apr  6  2017 music
drwxrwxr-x    4 asterisk asterisk 4.0K Mar 16  2017 outroutemsg
drwxrwxr-x    7 asterisk asterisk 4.0K Sep 19 20:52 paging
drwxrwxr-x   10 asterisk asterisk 4.0K Jul 24 15:00 pagingpro
drwxrwxr-x    7 asterisk asterisk 4.0K Oct 16 13:29 parking
drwxrwxr-x    7 asterisk asterisk 4.0K Jun 28 14:42 parkpro
drwxrwxr-x    5 asterisk asterisk 4.0K Aug 22 19:08 pbdirectory
drwxrwxr-x    3 asterisk asterisk 4.0K Oct 31 19:58 phonebook
drwxrwxr-x.   4 asterisk asterisk 4.0K May 24  2017 phpinfo
drwxrwxr-x.   5 asterisk asterisk 4.0K May 24  2017 pinsets
drwxrwxr-x    7 asterisk asterisk 4.0K Jun 28 14:47 pinsetspro
drwxrwxr-x    5 asterisk asterisk 4.0K Oct  3 11:30 pm2
drwxrwxr-x.   6 asterisk asterisk 4.0K May 24  2017 presencestate
drwxrwxr-x    5 asterisk asterisk 4.0K May 16  2017 printextensions
drwxrwxr-x.   4 asterisk asterisk 4.0K May 24  2017 queueprio
drwxrwxr-x    8 asterisk asterisk 4.0K May  1  2017 queues
drwxrwxr-x.   7 asterisk asterisk 4.0K May 24  2017 qxact_reports
drwxrwxr-x    8 asterisk asterisk 4.0K Mar 30  2017 recording_report
drwxrwxr-x    6 asterisk asterisk 4.0K Jun  5 17:58 recordings
drwxrwxr-x    9 asterisk asterisk 4.0K Mar 30  2017 restapi
drwxrwxr-x    5 asterisk asterisk 4.0K May  1  2017 ringgroups
drwxrwxr-x    6 asterisk asterisk 4.0K Jun 27 15:37 rmsadmin
drwxrwxr-x   12 asterisk asterisk 4.0K May 29  2017 sangomacrm
drwxrwxr-x    4 asterisk asterisk 4.0K May  1  2017 setcid
drwxrwxr-x    5 asterisk asterisk 4.0K Jun 29 16:28 sipsettings
drwxrwxr-x    8 asterisk asterisk 4.0K Jun 12 18:33 sipstation
drwxrwxr-x    6 asterisk asterisk 4.0K Mar  8  2017 sms
drwxrwxr-x.   7 asterisk asterisk 4.0K May 24  2017 sng_mcu
drwxrwxr-x    7 asterisk asterisk 4.0K Mar  6  2017 soundlang
drwxrwxr-x.   4 asterisk asterisk 4.0K May 24  2017 speeddial
drwxrwxr-x    9 asterisk asterisk 4.0K Jun 28 16:03 superfecta
drwxrwxr-x   14 asterisk asterisk 4.0K Jun  5 13:54 sysadmin
drwxrwxr-x    8 asterisk asterisk 4.0K Jun  1 12:42 timeconditions
drwxrwxr-x    5 asterisk asterisk 4.0K Jun  5 13:24 tts
drwxrwxr-x.   5 asterisk asterisk 4.0K May 24  2017 ttsengines
drwxrwxr-x    7 asterisk asterisk 4.0K Jan 25  2017 ucp
drwxrwxr-x    8 asterisk asterisk 4.0K Jun 30 15:07 userman
drwxrwxr-x.   5 asterisk asterisk 4.0K May 24  2017 vmblast
drwxrwxr-x.   9 asterisk asterisk 4.0K May 24  2017 vmnotify
drwxrwxr-x    6 asterisk asterisk 4.0K May 23  2017 voicemail
drwxrwxr-x.   6 asterisk asterisk 4.0K May 24  2017 voicemail_report
drwxrwxr-x   12 asterisk asterisk 4.0K Jun 28 17:08 vqplus
drwxrwxr-x.   3 asterisk asterisk 4.0K May 24  2017 weakpasswords
drwxrwxr-x    7 asterisk asterisk 4.0K Jun 23 20:05 webcallback
drwxrwxr-x    8 asterisk asterisk 4.0K Apr 20  2017 webrtc
drwxrwxr-x   10 asterisk asterisk 4.0K Apr 24  2017 xmpp
drwxrwxr-x   11 asterisk asterisk 4.0K May 31 14:37 zulu

This is an official FreePBX installation.

 `find . -name 'pm2'`  (from the root mountpoint)
./home/asterisk/.npm/registry.npmjs.org/pm2
./home/asterisk/.npm/pm2
./var/www/html/admin/modules/pm2
./usr/src/freepbx-13.0.192.8/amp_conf/htdocs/admin/modules/pm2

PM2 is right there. Created October 3.

Okay… so I may have been an idiot.

The install never actually made any progress on the target server. It only spun in circles.
I accidentally ran it on the wrong machine during this testing. I’m very sorry – I know how frustrating it can be to get bad information during troubleshooting.

This means that the only actual symptom is the spinning symbol that runs forever with no timeout, ever.
Basically, the post with Update / Question / Thanks is completely bogus. The rest should be accurate.
What is the proper protocol for when someone does this on accident?

cd /var/www/html/admin/modules/pm2/node
rm -Rf node_modules
npm install

changed directory, removed the node_modules directory recursively.
executed npm install while still in that directory.

Result:
cursor has been spinning for over 10 minutes.
opening a separate ssh session, I can see that the node_modules folder has been recreated with a pm2 subdirectory inside of it. Contents of that folder are:

# ls
ADVANCED_README.md  bin  CHANGELOG.md  constants.js  CONTRIBUTING.md  GNU-AGPL-3.0.txt  index.js  lib  LICENSE  Makefile  package.json  paths.js  README.md

So its definitely doing SOMETHING, but it’s still spinning forever and not completing.
Additional steps taken since last post:

fwconsole ma remove pm2
fwconsole ma remove (two other modules that I noticed were installed but disabled and dependent upon pm2)

Also, used FreePBX GUI module admin to update all other modules successfully.
Then attempted to do so with pm2, but it just hung forever.
Followed the failed attempt with another fwconsole ma remove pm2
(then saw your updated post, and followed your instructions)

You have a network problem. NPM is unable to reliably connect to npmjs.org. NPM is not written by FreePBX nor is it written by Sangoma. But let’s try some helper utilities

rm -Rf /home/asterisk/{.npm,.npmrc,.node-gyp,.package_cache}
rm -Rf /var/www/html/admin/modules/pm2/node/node_modules
fwconsole setting PM2USEPROXY 1
fwconsole ma install pm2

Thank you Andrew. You definitely got me on the right track. It’s frustrating to find out that the issue was network related. Now I’m going to have to spend some time on the line with FiOS business (who will probably insist they are not filtering anything).

Fortunately, I have two ISPs setup at this site. So my resolution was as follows:

  1. Flush the cache on my DNS server.
  2. Execute the installer on FreePBX
  3. Note all DNS requests that were made.
  4. Create static routes for these addresses on my default (FiOS) gateway – re-routing them out the Comcast gateway.
  5. Re-Run the installer (repeated a couple times to catch all addresses)

This was with Proxy set to 0, not 1. It would not work with Proxy set to 1.

Doing this appears to have resulted in a successful install of PM2. And just in time for the 100 DIDs that are porting in tomorrow!!

For the record – the following were the addresses that appeared to make the difference:

registry.npmjs.org was a CNAME for a.sni.fastly.net
a.sni.fastly.net resolved to four IP addresses. 151.101.n.162 where n is 0, 64, 128, and 192.

Routing those four IPs through Comcast and not FiOS was the magic bullet for me.

I too resolved my identical issue by bypassing fios to another carrier. Thanks, Guys!

Not sure which state you are in, but in NY i would recommend using FiOS. Stable and reliable speeds, we have plenty clients on FiOS.