How to reinstall Asterisk 16 and FreePBX 15 but not from image

Back last 28th November 19 I installed Asterisk 16.6.1 & FreePBX 15.0.16.22 using a pre-built image which I burned to an SD card on a Rasp Pi 4 under Buster. This still seems to be the current image. After configuring, including setting – Advanced Settings “Set Module Admin to Edge Mode” to Yes, I downloaded about 25 modules. This all went OK and I left it while I concentrated on Home Automation on the Pi 4 during which I moved the system to a SSD.

Recently I decided to focus on the Asterisk/FreePBX system so the first thing was to go to PBX Admin/Updates and update over 25 modules. This produced numerous errors that there was no such file in the var/www/html/admin/modules/cache

I deleted all the files in the cache directory and on restart got file /etc/dahdi/modules does not exist . So I created that and ran fwconsole chown I still had errors and from a similar issue noted in another forum I ran cd /var/lib/asterisk/bin then ./fwconsole ma upgrade framework --tag 14.0.13.23 This brought most modules up-to-date and a little later I update the final 3.

However, I still have a Apply Config - error

Reload failed because retrieve_conf encountered an error: 1 exit: 1
Unknown Error. Please Run /var/lib/asterisk/bin/retrieve_conf

I ran this but got
Unable to continue. Methods with the same name as their class will not be constructors in a future version of PHP; digium_phones has a deprecated constructor in /var/www/html/admin/modules/digium_phones/classes/digium_phones.php on line 31

Looks like the whole system is damaged. So the best solution might be to start again BUT I cannot restore the whole image/partition as I have the home automation developments.

I do have a backup of the partition on SD card. Which folders do I need to copy in order to restore Asterisk 16.6.1 & FreePBX 15.0.16.22 and how to I then avoid getting the same errors when updating the modules?

Sorry this is a bit long. Thanks for reading
Alan

from a shell use the ‘fwconsole’ command, with ma (module administration) you can

fwconsole ma --help
fwconsole ma list
fwconsole ma delete (module name)

if you dont have digium phones then . . .

You dont have a need for anything dahdi so delete any and also the /etc/dahdi directory

eventually

fwconsole ma upgrade all

will stop bitching and

fwconsole restart --verbose

will similarly behave

Many thanks dicko in helping. I only found 1 dahdi module: dahdiconfig and deleted it and I removed the directory: rm -r /etc/dahdi

I ran fwconsole ma upgradeall and got:

No repos specified, using: [standard,extended] from last GUI settings
Up to date.
Updating Hooks…Done

In FreePBX I still have the Apply Config (in red) outstanding so clicked but got:

Reload failed because retrieve_conf encountered an error: 1

exit: 1
Unknown Error. Please Run /var/lib/asterisk/bin/retrieve_conf

I ran that but got:

Unable to continue. Call to undefined method FreePBX\Modules::deprecated Function() in /var/www/html/admin/modules/languages/functions.inc.php on line 89
#0 /var/www/html/admin/modules/languages/functions.inc.php(49): languages_list()
#1 /var/www/html/admin/libraries/BMO/DialplanHooks.class.php(95): languages_get_config(‘asterisk’)
#2 /var/lib/asterisk/bin/retrieve_conf(860): FreePBX\DialplanHooks->processHooks(‘asterisk’, Array)
#3 {main}

I found this thread Reload Error and ran fwconsole ma upgrade framework --edge
This updated modules Updating tables admin, ampusers, cronmanager, featurecodes, freepbx_log, freepbx_settings, globals, module_xml, modules, notifications, cron_jobs…
but then gave:
In Hooks.class.php line 254: Cant find FreePBX\modules\Api x2

whereas other users of that post got success.

I also noticed that in FreePBX/Module Admin many of my modules are at v15 but after checking the online status report "Newer than online version (13/.x14.x) " This is despite only Standard and Extended repositories selected. E.g. Asterisk API 15.0.7 Stable Sangoma Technologies Corporation GPLv2+ Newer than online version (13.0.2.7)

What do you suggest?
Many thanks
Alan

Well you got the “newer than” because you ran

fwconsole ma upgrade all --edge

I would delete the “REST API” module for now

I’ve decided this is not going to be fixed. I did look at restoring folders but not convinced I would be 100% accurate/complete.

I will restore the whole system from a rsync backup a month ago and then restore my home automation. The HA is Docker based so it’s quick and reliable to rerun the compose files to rebuild the containers and then restore the user data files from more recent folder backups.

I note that the Raspbian FreePBX 15 is still in beta (at 2019-11-11) so I think I will only update modules that have critical fixes in order to minimise the risk of repeating the update corruption. If there is a way to roll back module updates then that would be nice to know.

Thank you dicko for helping.
Alan

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.