FreePBX | Register | Issues | Wiki | Portal | Support

RestApps not starting with error


(Cory Cook) #1

Hi all,

So, I moved a physical PBX to a virtualized solution by doing a full backup and restore. I’ve gotten everything up and running, with the exception of the restapps service, so no one’s voicemail is working at the moment (without dialing *97). I keep trying to start restapps, but I get this:

The command “runuser ‘asterisk’ -s ‘/bin/bash’ -c ‘cd /var/www/html/admin/modules/restapps && mkdir -p /home/asterisk/.pm2 && mkdir -p /var/www/html/admin/modules/restapps/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 start /var/www/html/admin/modules/restapps/restapps.php --update-env --name ‘’‘restapps’’’ -e ‘’’/var/log/asterisk/restapps_err.log’’’ -o ‘’’/var/log/asterisk/restapps_out.log’’’ --log ‘’’/dev/null’’’ --merge-logs --log-date-format ‘’‘YYYY-MM-DD HH:mm Z’’’’” failed.

I’ve tried to run this command, separately, but it fails also. Any ideas??

Any assistance would be very much appreciated.

Thanks!!


(Cory Cook) #2

Also, just in case, below the above mentioned is this:

Exit Code: 1(General error)

Working directory: /root

Output:

┌──────────┬────┬──────┬─────┬────────┬─────────┬────────┬─────┬─────┬──────┬──────────┐
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
└──────────┴────┴──────┴─────┴────────┴─────────┴────────┴─────┴─────┴──────┴──────────┘
Use pm2 show <id|name> to get more details about an app

Error Output:

/var/www/html/admin/modules/pm2/node/node_modules/pm2/node_modules/cron/lib/cron.js:244
`Something went wrong. cron reached maximum iterations.
^
Unexpected token ILLEGAL


(Cory Cook) #3

After running the command, I get:

HV [root@pbx asterisk]# runuser ‘asterisk’ -s ‘/bin/bash’ -c ‘cd /var/www/html/admin/modules/restapps && mkdir -p /home
/asterisk/.pm2 && mkdir -p /var/www/html/admin/modules/restapps/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:$MA
NPATH && /var/www/html/admin/modules/pm2/node/node_modules/pm2/bin/pm2 start /var/www/html/admin/modules/restapps/resta
pps.php --update-env --name ‘’‘restapps’’’ -e ‘’’/var/log/asterisk/restapps_err.log’’’ -o ‘’’/var/log/asterisk/re
stapps_out.log’’’ --log ‘’’/dev/null’’’ --merge-logs --log-date-format ‘’‘YYYY-MM-DD HH:mm Z’’’’
/var/www/html/admin/modules/pm2/node/node_modules/pm2/node_modules/cron/lib/cron.js:244
Something went wrong. cron reached maximum iterations. ^ Unexpected token ILLEGAL ┌──────────┬────┬──────┬─────┬────────┬─────────┬────────┬─────┬─────┬──────┬──────────┐ │ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │ └──────────┴────┴──────┴─────┴────────┴─────────┴────────┴─────┴─────┴──────┴──────────┘ Usepm2 show <id|name>` to get more details about an app


(Itzik) #4

To start restapps you need to run

fwconsole start restapps

or

fwconsole pm2 --restart restapps

Run the below to see whats stopped.

fwconsole pm2 --list

(Cory Cook) #5

The above errors are the errors I get when I do a ‘fwconsole start restapps’

fwconsole pm2 --restart restapps doesn’t do anything because restapps isn’t running. lol

fwconsole pm2 --list shows nothing under the Process Name/PID/Status/etc

I tried to reinstall restapps, using fwconsole ma downloadinstall restapps and it was successful, however I still get the same error as mentioned above.


(Dave Burgess) #6

This is an error from crond, so there’s something going wrongly in your crontab setup. The unexpected token error (IIRC) has recently been reported here, so there might be a bad module outsode of restapps.

Try killing all of the cron jobs that are running. Also, this might be one of those times where the short-term fix is to reboot the server (not just Asterisk, the entire server) and then watch your crond performance and troubleshoot from there.


(Andrew Nagy) #7
fwconsole ma upgrade pm2 --edge

[edited to fix command]


(Cory Cook) #8

Andrew,

Thanks for the replies! Running that command, however, does nothing. I get:

[Symfony\Component\Console\Exception\CommandNotFoundException]
Command “upgrade” is not defined.

How would I check/kill cron jobs? I looked in /var/log/asterisk/restapps_err.log, but that log doesn’t exist.
Also checked the code in cron@/var/www/html/admin/modules/pm2/node/node_modules/pm2/node_modules/cron/lib/cron.js, but I’m not a programmer and I don’t really understand what it’s looking for…there’s a bunch of code about time/date stuff.


(Lorne Gaetz) #9
fwconsole ma upgrade pm2 --edge

(Cory Cook) #10

Well, well, Lorne…that got restapps to start! Thank you so much!


(Cory Cook) #11

Please don’t close my ticket just yet :wink: