Asterisk won't start after upgrade to 13

So, as I mentioned in this post I’d previously followed the instructions I provided a link to (in that thread) and got a working version of freepbx12. The second time I tried I ended up posting here and you can see where that led (a fresh install of freepbx 13). That said, I used the PBX Upgrader to upgrade the previous install(12) to 13.x. It seemed to complete, but now asterisk isn’t being started. Any tips?

TLDR: I upgraded a working Freepbx 12 installation to 13 and asterisk doesn’t start.

what happens when you run:

amportal start

[[email protected] bin]# amportal start

Please wait…
FATAL: can not find freepbx_engine to start Asterisk

There’s part of your issue. See if you can locate “freepbx_engine”

locate freepbx_engine

Oracle Linux apparently doesn’t have the “locate” command.

[[email protected] /]# find . -print | grep freepbx_engine
[[email protected] /]# sh /var/lib/asterisk/bin/freepbx_engine

/var/lib/asterisk/bin/freepbx_engine: line 100: /var/lib/asterisk/bin/gen_amp_conf.php: Permission denied
astrundir in ‘/etc/asterisk’ is set to but the directory
does not exists. Attempting to create it with: 'mkdir -p ’

mkdir: missing operand
Try `mkdir --help’ for more information.
Attempt to execute 'mkdir -p ’ failed with an exit code of 1
You must create this directory and the try again.

[[email protected] bin]# ls -la g*
-rw-r–r-- 1 asterisk asterisk 982 Feb 2 10:09 gen_amp_conf.php

Does this need to be chmod’d

Normally “amportal chown” would fix you up. But you can’t run that. This is a non-standard install.

Try: “fwconsole chown”

chown fwconsole? (to whom do I ascribe ownership?)

No. Please run the command as I said to run it.

“fwconsole chown”

Actually, I ran that command as root. It’s not an ownership problem, but its permission bits are 644 (rw/r/r) on both gen_amp_conf.php and fwconsole.

Yes you would run “fwconsole chown” (where did I say or state anything else also never said this was an ownership problem). This command fixes ownership AND permissions on all freepbx assets, excluding itself. But it would also fix permissions on gen_amp_conf.php.

[[email protected] bin]# fwconsole chown
bash: /usr/sbin/fwconsole: Permission denied

^^This is why I thought that. Running fwconsole by itself says the same thing, hence the 644 talk above as well.

See above ^^. Just fix the permissions on fwconsole itself then run “fwconsole chown”

Seems as though your web user is different than your asterisk user.

Apparently I missed one of your replies, but I think I’m caught up now. When you say to fix the permissions on fwconsole, …what do they need to be?

if you SSH into your pbx, fwconsole should be in /usr/local/sbin/fwconsole - so:
cd /usr/local/sbin
chmod +x fwconsole
then as Nagy said:
fwconsole chown

chmod +x /usr/sbin/fwconsole && fwconsole chown
Taking too long? Customize the chown command, See
Setting Permissions…
33551/33551 [============================] 100%
Finished setting permissions

/etc/rc.d/init.d/freepbx restart brought things back up! Thanks for sticking with me.

Spoke too soon. I’m getting a retrieve_conf failed. I’ve seen that before. Hopefully I can remember how I got past that issue.

why jump to /etc/rc.d/init.d/freepbx restart? fwconsole is the command you should use to administer freepbx from the CLI. fwconsole restart, fwconsole reload, etc. They may be the same, but I am under the impression that fwconsole does additional checks, etc. You might be having a retrieve_conf error because of module issues. You might have to also do fwconsole ma upgradeall and watch for errors. If no errors, fwconsole reload and see what happens.

It looks like the freepbx restart script is a wrapper that makes calls to fwconsole.

I searched for other topics involving retrieve_conf errors and saw someone recommend issuing the command from the cli.

[[email protected] init.d]# cd /var/lib/asterisk/bin
[[email protected] bin]# ./retrieve_conf
Whoops\Exception\ErrorException: mkdir(): No such file or directory in file /var/www/html/admin/libraries/BMO/Media.class.php on line 34
Stack trace:

  1. Whoops\Exception\ErrorException->() /var/www/html/admin/libraries/BMO/Media.class.php:34
  2. Whoops\Run->handleError() :0
  3. mkdir() /var/www/html/admin/libraries/BMO/Media.class.php:34
  4. FreePBX\Media->__construct() /var/www/html/admin/libraries/BMO/Self_Helper.class.php:125
  5. FreePBX\Self_Helper->autoLoad() /var/www/html/admin/libraries/BMO/Self_Helper.class.php:37
  6. FreePBX\Self_Helper->__get() /var/lib/asterisk/bin/retrieve_conf:40

There is a bug on that currently that has been fixed