Upgrade/Clean Install issues with FPBX 12 and 13

Hey folks. I’ve had a bit of a nightmare trying to upgrade my 2.11 FreePBX install. I originally had it running very nicely on my Gentoo serverbox, a dozen phones and softphones or so. I tried running the GUI-based upgrader when the option was presented and it pretty much destroyed the entire installation. Not a big deal, this is mostly something I run for fun at my home and I don’t actually use it for much. I figured it’d be a good opportunity to be a good community member and run the beta.

So, I completely nuked the entire freepbx and asterisk install, installed asterisk clean, and tried to install FreePBX 13. I seem to be running into the problem described in bug FREEPBX-9898 (can’t link directly as I’m a new user) as my log is pretty much identical - it fails to set AMPBIN and AMPSBIN and blows up in several clever ways. With php5.5 I get “PHP Fatal error: Call to a member function connected() on a non-object in /usr/local/freepbx/amp_conf/htdocs/admin/libraries/utility.functions.php on line 1304”. I’ve tried a couple different versions of DB, not sure if that’s related or not.

Decided to try FreePBX 12, since it should be stable. I can get it to install, but only with issues. When I do an amportal chown, it decides to chown all of /tmp and all its contents to the asterisk user and group… This breaks screen and several other things that can no longer write to /tmp. Perhaps the bigger issue is on the main status screen I just get “Welcome to FreePBX” with “Frobulating” with nothing else on it. I also had some issues with it not properly importing the gpg keys, but I was able to fix that fine. It actually does seem to work - I can set up my GV trunks and extensions and it all registers and works, but any restart rebreaks /tmp and causes lots of trouble. php5.5 works the same.

At this point, since I’d been having some other minor issues with the server that should have been unrelated I went ahead and completely rebuilt it and reinstalled everything, trying not to completely reuse the configs in case there was something weird in my package setup, but everything’s gone the same. I can’t get a good stable install of 12 or 13 going. 2.11 was great, but I’m trying to resist the temptation to go back to it and get this working.

The only thing I’ve been able to dig up on here that could be a problem is that I’m running php 5.6. Gentoo no longer has 5.3 in its repos at all, and dislikes installing anything less than 5.5. I’ve found mixed information on whether newer versions of php break it entirely, or just throw deprecation warnings.

Any thoughts? Thanks in advance!

I ran into the same issue, it seems its a bug that was introduced in commit bbe755f of github.com/FreePBX/framework. I solved it by undo-ing the changes in the amp_conf/htdocs/admin/libraries/utility.functions.php file. Specifically, changing line 1304, and removing lines 1314-1323.

Hope that helps.

The commit you mention: https://github.com/FreePBX/framework/commit/bbe755f

Was a commit that fixed Asterisk Manager issues. Your revert forces a connection even if Asterisk Manager can’t connect.

On another note our Marketing lead just installed FreePBX manually on a C.H.I.P four days ago.

Edit: Also I had to verify the function “fpbx_ami_update” is never referenced during install. So commit bbe755f has nothing to do with installation issues.

I installed on a clean install of ubuntu 14.04.3 (in a chroot jail), following the instructions here: wiki.freepbx.org/display/FOP/Installing+FreePBX+13+on+Ubuntu+Server+14.04.2+LTS (with the exception of install asterisk 11 from ubuntu universe). Based on the information in the exception, the commit I referenced was the last time the file that the exception is caused in was touched, and reverting the changes to file, was the only modifications I made, after which I was able to cleanly install.

That’s all great except that function you modified is never referenced during install (it’s only referenced when a change is made in advanced settings in the gui) so your changes wouldn’t do anything.

You never quoted an exception (it would be nice to know what the exception was instead of you just blindly saying change z,y,z lines). In fact the OP talks about having issues during Beta. The commit you referenced was done 21 days ago. Well after beta was over.

The OP Lists this exception: “PHP Fatal error: Call to a member function connected() on a non-object in /usr/local/freepbx/amp_conf/htdocs/admin/libraries/utility.functions.php on line 1304”

I seen this exact exception running the install from the install package downloaded here: mirror.freepbx.org/modules/packages/freepbx/freepbx-13.0-latest.tgz, yesterday (Jan 9/16)

To get the exact install log, I would have to create another clean install, but if it helps you to debug it, I can. From memory, just after the installer populates the database tables, it attempts to store a few of the environment vars and throws the exception stated above. Reverting the changes I referenced above, allows it to install cleanly.

Ah I missed that. Looking more closely it is referenced because it’s a “special” variable and thus any update or add triggers the call. Argh.

Fixed in FreePBX 13.0.49 which is released right now.


However that still doesn’t explain the OP stating his log is the same as FREEPBX-9898 which dies way before the ami error.

Well, the latest version definitely made an impact! With php5.5 and FreePBX 13 I still got the issues with AMPSBIN and AMPBIN not being set, but once I cleaned everything up and switched back to 5.6 it seems to have installed and is running successfully!

I did get a couple errors that went:
Creating missing #include files…PHP Warning: touch(): Unable to create file /etc/asterisk/"/etc/asterisk/aliases" because No such file or directory in /usr/local/freepbx/installlib/installcommand.class.php on line 554

Warning: touch(): Unable to create file /etc/asterisk/"/etc/asterisk/aliases" because No such file or directory in /usr/local/freepbx/installlib/installcommand.class.php on line 554

and then later:
Unable to continue. Cron line added didn’t remain in crontab on final check in /var/www/ast/admin/libraries/BMO/Cron.class.php on line 99

but so far it seems to be working ok. I’m running into an issue running the Apply Config, but I believe it’s a permissions issue that may be related to the Cron issue above. Still poking at that.
[2016-Jan-10 09:18:54] [CRITICAL] (BMO/Notifications.class.php:487) - [NOTIFICATION]-[freepbx]-[RCONFFAIL] - retrieve_conf failed, config not applied (Reload failed because retrieve_conf encountered an error: 255)

Thanks for the response!

That is probably because you dont have crontab installed.

Figured I’d give a final followup in case anyone else has these problems. In general, I can’t recommend using Gentoo for this.

It looks like it did create a crontab, but because the asterisk home dir is not in the usual spot, the permissions were wonky. Once I fixed that, had no problems Applying Settings.

Beyond that the asterisk compile that Gentoo creates doesn’t seem to support pjsip properly. FreePBX exposed it, let me set up extensions as pjsip, but try as I might asterisk itself never showed any ports open for it (as per netstat) nor showed any response to login. Old chan_sip did work… but for whatever reason I couldn’t get ICE support to work for google voice as I kept getting the “Unable to add Google ICE candidates as ICE support not available or no candidates available” no matter the options I set anywhere.

Once I compiled my own version of asterisk, with pjproject and pjsip set up and ICE properly selected, everything Just Worked. So I’m good to go now, but Gentoo definitely has some extra steps involved that sort of defeat the purpose of Gentoo by having to manually compile several things. Thank you for the fixed version though; that did at least get FreePBX going!