FreePBX 13 BETA GUI Updater

Happy to do that, but what do you mean by, “proceed manually”? I’m probably sounding dim here …

fwconsole moduleadmin upgrade core
fwconsole moduleadmin upgrade backup
fwconsole moduleadmin upgradeall

Thanks, will do, I’ll report issues (if any) here.

This might help. First command (moduleadmin upgrade core) output:

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

Starting core download…
Processing core
2287402/2287402 [============================] 100%
Finished downloading
Module core successfully downloaded
PHP Fatal error: Cannot redeclare superfecta_hook_core() (previously declared in /home/neil/git/Caller-ID-Superfecta/ in /home/neil/git/Caller-ID-Superfecta/ on line 47
Whoops\Exception\ErrorException: Cannot redeclare superfecta_hook_core() (previously declared in /home/neil/git/Caller-ID-Superfecta/ in file /home/neil/git/Caller-ID-Superfecta/ on line 47
Stack trace:

  1. () /home/neil/git/Caller-ID-Superfecta/

For reference, although the path is different, I’m pretty sure that is an in sync version of Superfecta/ - I’ll check.

That’s your issue. You have an unsupported dev version of superfecta loaded. So the functions are all being loaded twice. This isn’t something we can account for.

No. The issue is that you have superfecta files in AMPWEBROOT that are referenced to /home and are being loaded twice.

Really? I thought that the error said that both declarations were in the same file (lines 3 and 47 of /home/neil/…/

They are in the same file. This is how PHP works it has to do with paths for include, basically it’s saying include from /var/www AND /home, they are the same file but PHP doesnt know that. You have file symlinked and they are being loaded twice. Doesn’t matter if they are the same file. They are being loaded twice. save your changes into superfecta git and checkout superfecta git into /var/www/html/admin/modules and you won’t have this problem.

Wow - learn something new every day. I’ll unpick this and press on, thanks for your help,

This is why include_once and require_once are unreliable as they work based on paths.

1 Like

Got it. Knew there was a reason not to like them.

Interesting that it works in normal use though - I’ve done all my development work this way so far!

There are only two supported ways to do development on FreePBX. Using devtools or checking out directly into /var/www/html/admin/modules

Anything else is unsupported and will have issues.

Learning point #2. Sorry I missed that until now.

I post with a bit of trepidation now, but

a) module admin upgrade worked.

b) module admin backup resulted in:

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

Starting backup download…
Processing backup
336904/336904 [============================] 100%
Finished downloading
Module backup successfully downloaded

Missing argument 2 for Backup::__construct(), called in /var/www/html/admin/libraries/BMO/Self_Helper.class.php on line 125 and defined

ma [-f|–force] [-d|–debug] [–format="…"] [-R|–repo="…"] [args1] … [argsN]

ls -al in /var/…/libraries/BMO/Self_Helper.class.php gives:

-rwxrwxr-x 1 asterisk asterisk 8162 Aug 19 11:01 Self_Helper.class.php

so I’m guessing that that is v.13 code?

No self_helper is part of 12. Sorry the upgrader does this for you automatically. I forgot you have to first disable backup then upgrade it.


[email protected]:~# /var/lib/asterisk/bin/fwconsole moduleadmin disable backup
The following error(s) occured:

  • Module not enabled: cannot disable

but then …

[email protected]:~# /var/lib/asterisk/bin/fwconsole moduleadmin upgrade backup
No repos specified, using: [standard,extended,unsupported] from last GUI settings

Starting backup download…
Processing backup
Verifying local module download…Verified
Module backup successfully downloaded
Generating CSS…Done
Module backup successfully installed
Updating Hooks…Done

So, somehow in the process of failing it had disabled backup, which meant it then worked!

OK, all done. I presume that I can now go to the web interface? Or are there more commands or perhaps a reboot needed?

@tm1000 This may well be due to the rather messy process I’ve got this far, but when I try to take the next obvious step, fwconsole r, I get the following failure message:

[email protected]:~# /var/lib/asterisk/bin/fwconsole r
Reloading FreePBX
Error(s) have occured, the following is the retrieve_conf output:
exit: 1
Whoops\Exception\ErrorException: Invalid argument supplied for foreach() in file /var/www/html/admin/modules/featurecodeadmin/ on line 100
Stack trace:

  1. Whoops\Exception\ErrorException->() /var/www/html/admin/modules/featurecodeadmin/
  2. Whoops\Run->handleError() /var/www/html/admin/modules/featurecodeadmin/
  3. featurecodeadmin_check_destinations() /var/www/html/admin/libraries/usage_registry.functions.php:145
  4. framework_check_destination_usage() /var/www/html/admin/libraries/usage_registry.functions.php:340
  5. framework_list_problem_destinations() /var/lib/asterisk/bin/retrieve_conf:733

Looking at the code, I would guess at the following sequence:

  1. featurecodeadmin_check_destinations() has been called with dest=true
  2. (line 82 of featurecodeadmin/ it calls featurecodeadmin_destinations() and that function returns not an array (null, at a guess).
  3. (line 91) $results it set to that value
  4. (line 100) $results is used to seed foreach, which then fails

Obviously this is my hypothesis, but if I re-run with a var_dump($results), it says that $results is NULL at line 100.

If I disable the featurecodeadmin module, the reload works fine, if I enable it again the error returns.

Happy for you tell me this is all due to my earlier errors, but thought you should know of this possible failure route.

Fixed in featurecodeadmin v13.0.3

1 Like