Upgrade to 13 via GUI

Used the GUI to go from 12 to 13. At the end of the process the dashboard reported issues with extensions where Voicemail was the final target.

Often hitting an exception when trying to resolve this which is:

Whoops\Exception\ErrorException: explode() expects parameter 2 to be string, array given in file /var/www/html/admin/modules/voicemail/Voicemail.class.php on line 177
Stack trace:

  1. Whoops\Exception\ErrorException->() /var/www/html/admin/modules/voicemail/Voicemail.class.php:177
  2. Whoops\Run->handleError() :0
  3. explode() /var/www/html/admin/modules/voicemail/Voicemail.class.php:177
  4. FreePBX\modules\Voicemail->getVoicemail() /var/www/html/admin/modules/voicemail/Voicemail.class.php:203
  5. FreePBX\modules\Voicemail->getMailbox() /var/www/html/admin/modules/voicemail/functions.inc.php:871
  6. voicemail_mailbox_get() /var/www/html/admin/modules/core/functions.inc.php:970
  7. core_getdestinfo() /var/www/html/admin/libraries/usage_registry.functions.php:300
  8. framework_identify_destinations() /var/www/html/admin/libraries/usage_registry.functions.php:351
  9. framework_list_problem_destinations() /var/lib/asterisk/bin/retrieve_conf:733

From a reboot I get an admin message re SQL:

[FATAL] SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)

Trace Back:

/var/www/html/admin/libraries/BMO/Database.class.php:80 PDO->__construct()
[0]: mysql:host=localhost;dbname=asterisk;charset=utf8
[1]: freepbxuser
[2]: 5bc1174d3e10

/var/www/html/admin/libraries/BMO/FreePBX.class.php:69 FreePBX\Database->__construct()

/var/www/html/admin/bootstrap.php:116 FreePBX->__construct()

/etc/freepbx.conf:9 require_once()
[0]: /var/www/html/admin/bootstrap.php

/var/www/html/admin/modules/dashboard/scheduler.php:25 include()
[0]: /etc/freepbx.conf

Though I’m able to view the CDR’s so I’m not so sure where this error is coming from.

I can see other issues but I suspect these are the ones to resolve first.

Any help appreciated.

Alan

Hi Alan, we’re are having the same issue regarding the Voicemail class. You can fix this by removing the bad data out of /etc/asterisk/voicemail.conf, but that only leads to further problems.

I think your database problem is something else entirely. Maybe a permissions problem with /var/lib/mysql/mysql.sock? Or MySQL isn’t listening on the socket, but only the port?

Anyway, we are seeing additional weirdness around voicemail.

All of our extensions have had voicemail disabled. If we go to enable them, duplicate data gets added to voicemail.conf (and the above error appears) but voicemail doesn’t get enabled in the extensions module.

We updated the framework to last night to the latest. Maybe related?

Here are our current modules:

+----------------------+----------------+----------+
| Module               | Version        | Status   |
+----------------------+----------------+----------+
| accountcodepreserve  | 13.0.2         | Enabled  |
| announcement         | 13.0.2         | Enabled  |
| areminder            | 13.0.2         | Disabled |
| arimanager           | 13.0.3         | Enabled  |
| asterisk-cli         | 13.0.2         | Enabled  |
| asteriskinfo         | 13.0.4         | Enabled  |
| backup               | 13.0.7         | Enabled  |
| blacklist            | 13.0.6         | Enabled  |
| bria                 | 13.0.7         | Enabled  |
| broadcast            | 13.0.2         | Disabled |
| builtin              |                | Enabled  |
| bulkdids             | 13.0.2         | Disabled |
| bulkextensions       | 13.0.2         | Disabled |
| bulkhandler          | 13.0.9         | Enabled  |
| callback             | 13.0.1alpha1   | Enabled  |
| callerid             | 13.0.2         | Disabled |
| callforward          | 13.0.4         | Enabled  |
| calllimit            | 13.0.2         | Disabled |
| callrecording        | 13.0.3         | Enabled  |
| callwaiting          | 13.0.1         | Enabled  |
| campon               | 13.0.1alpha1   | Enabled  |
| cdr                  | 13.0.9         | Enabled  |
| cel                  | 13.0.4         | Enabled  |
| certman              | 13.0.5         | Enabled  |
| cidlookup            | 13.0.4         | Enabled  |
| conferences          | 13.0.5         | Enabled  |
| conferencespro       | 13.0.1alpha1   | Enabled  |
| configedit           | 13.0.4         | Enabled  |
| contactmanager       | 13.0.4         | Disabled |
| core                 | 13.0.1beta1.26 | Enabled  |
| cos                  | 13.0.4         | Disabled |
| customappsreg        | 13.0.4.2       | Enabled  |
| cxpanel              | 4.1.8          | Disabled |
| dahdiconfig          | 13.0.3         | Enabled  |
| dashboard            | 13.0.10        | Enabled  |
| daynight             | 13.0.4         | Enabled  |
| dictate              | 13.0.2         | Enabled  |
| digium_phones        | 2.11.2.4       | Disabled |
| digiumaddoninstaller | 2.11.0.10      | Enabled  |
| directory            | 13.0.3         | Enabled  |
| disa                 | 13.0.2         | Enabled  |
| donotdisturb         | 13.0.3         | Enabled  |
| endpoint             | 13.0.0.4       | Disabled |
| fax                  | 13.0.8         | Enabled  |
| faxpro               | 13.0.8         | Enabled  |
| featurecodeadmin     | 13.0.2         | Enabled  |
| findmefollow         | 13.0.11        | Enabled  |
| framework            | 13.0.1beta3.51 | Enabled  |
| freepbx_ha           | 13.0.2         | Disabled |
| fw_langpacks         | 12.0.7         | Enabled  |
| hotelwakeup          | 13.0.2         | Disabled |
| iaxsettings          | 13.0.3         | Enabled  |
| infoservices         | 12.0.3.2       | Enabled  |
| irc                  | 2.11.0.4       | Enabled  |
| ivr                  | 13.0.4         | Enabled  |
| javassh              | 2.11.2         | Enabled  |
| languages            | 13.0.3         | Enabled  |
| logfiles             | 13.0.3         | Enabled  |
| manager              | 13.0.2.4       | Enabled  |
| miscapps             | 13.0.2.1       | Enabled  |
| miscdests            | 13.0.2         | Enabled  |
| music                | 13.0.4         | Enabled  |
| outroutemsg          | 13.0.2         | Enabled  |
| paging               | 13.0.4         | Enabled  |
| pagingpro            | 13.0.2         | Enabled  |
| parking              | 13.0.3         | Enabled  |
| parkpro              | 13.0.4         | Disabled |
| pbdirectory          | 2.11.0.2       | Enabled  |
| phonebook            | 13.0.3         | Enabled  |
| phpinfo              | 13.0.2         | Enabled  |
| pinsets              | 13.0.2         | Enabled  |
| pinsetspro           | 13.0.3         | Disabled |
| presencestate        | 13.0.3         | Enabled  |
| printextensions      | 13.0.3         | Enabled  |
| queueprio            | 13.0.2         | Enabled  |
| queues               | 13.0.6         | Enabled  |
| qxact_reports        | 13.0.3         | Disabled |
| recording_report     | 13.0.5         | Enabled  |
| recordings           | 12.0.8         | Enabled  |
| restapi              | 13.0.10        | Disabled |
| restapps             | 13.0.3.1       | Disabled |
| restart              | 13.0.3         | Enabled  |
| ringgroups           | 13.0.4         | Enabled  |
| setcid               | 13.0.2         | Enabled  |
| sipsettings          | 13.0.14        | Enabled  |
| sipstation           | 13.0.10        | Enabled  |
| sms                  | 13.0.2         | Enabled  |
| sng_mcu              | 13.0.2         | Enabled  |
| soundlang            | 13.0.0beta6    | Enabled  |
| speeddial            | 2.11.0.3       | Enabled  |
| superfecta           | 13.0.3         | Enabled  |
| sysadmin             | 13.0.12        | Enabled  |
| timeconditions       | 13.0.5         | Enabled  |
| tts                  | 13.0.4         | Enabled  |
| ttsengines           | 13.0.3         | Enabled  |
| ucp                  | 13.0.5         | Enabled  |
| ucpnode              | 13.0.7         | Enabled  |
| userman              | 13.0.12        | Enabled  |
| vmblast              | 13.0.2         | Enabled  |
| vmnotify             | 13.0.5         | Disabled |
| voicemail            | 13.0.9.1       | Enabled  |
| voicemail_report     | 13.0.1alpha1   | Disabled |
| vqplus               | 13.0.9         | Enabled  |
| weakpasswords        | 13.0.1alpha1   | Enabled  |
| webcallback          | 13.0.4         | Disabled |
| webrtc               | 13.0.3         | Enabled  |
| xmpp                 | 13.0.2.3       | Disabled |
+----------------------+----------------+----------+

Please let me know if there is any additional data I can provide!

Thanks.

Will look through this after hours.

Alan

Someone should provide us with your voicemail.conf file

I reverted the changes in framework version 13.0.1beta3.52 upgrade to that version. Then fix your voicemail.conf file then everything should be fine. Sorry about that

Gladly…

[[email protected] asterisk]# cat voicemail.conf

[general]
externnotify=/var/lib/asterisk/agi-bin/vmnotify-newvm.php
#include vm_general.inc
#include vm_email.inc
adsiver=sredman
attach=yes
authpassword=jibberjabberstring
envelope=yes
forcegreetings=no
forcename=yes
moveheard=no
nextaftercmd=no
operator=yes
pbxskip=no
review=no
saycid=no
sayduration=yes
searchcontexts=no
sendvoicemail=yes
tempgreetwarn=yes
usedirectory=yes

[default]
140 => 0000,Shane Redman,[email protected],,attach=no|saycid=no|envelope=no|delete => no,,,,
139 => 1234,Marc Runkel,[email protected],,attach=yes|saycid=no|envelope=no|delete => yes,,,,
139 => 1234,Marc Runkel,[email protected],,attach=yes|saycid=no|envelope=no|delete=yes

I just tried to reenable voicemail for x139. Now we’re getting the error.

I dumped the values of $mailbox and $data right before the error.

here they are:

-------------
mailbox: 139 => 9735,Marc Runkel,[email protected],,attach=yes|saycid=no|envelope=no|delete
-------------
data:    Array
(
    [0] => yes,,,,
    [1] => yes
)

It looks like it’s merging the two x139 records into one? Which is a bug, but the real question is why is voicemail.conf getting two x139’s to begin with.

and I see you posted a fix already as I was typing this… Thanks!

I’ve installed 13.0.1beta3.52, copied over voicemail .conf with the template version and rebooted.

I still have an issue with Apply Config from the GUI with an eror reported from /var/lib/asterisk/bin/retrieve_conf

PHP Fatal error: Cannot use object of type DB_Error as array in /var/www/html/admin/modules/manager/functions.inc.php on line 71
Whoops\Exception\ErrorException: Cannot use object of type DB_Error as array in file /var/www/html/admin/modules/manager/functions.inc.php on line 71
Stack trace:

  1. () /var/www/html/admin/modules/manager/functions.inc.php:71

You have database issues that you need to resolve. I would uninstall manager and reinstall it:

fwconsole moduleadmin uninstall manager
fwconsole moduleadmin install manager

fwconsole moduleadmin uninstall manager
fwconsole moduleadmin install manager

That worked.

I’ll start looking through the rest of the system now.

Thanks

Alan

Things are looking stable again…

Errors still being reported are “Symlink from modules failed”

Which I’m sure is due to the installation of British Asterisk Voice Prompts. Is there a formal way to deal with either the symlink errors or the additional language files?

Thanks

Alan

Symlinks should get cleaned up with

amportal chown

and languages can be properly added via the GUI in Admin, Sound Languages

I’ve been plagued with the same error since yesterday.
I updated from AsteriskNow’s FreePBX 12 to FreePBX 13 from the GUI on tuesday the 11th, so I could install the Sound Languages module (to make the recordings French).

Since yesterday, whenever I try to edit anything (When I have to press the “Edit” icon), the console returns this error.

I’ve tried re-installing both the manager and the voicemail modules. I’ve tried rebooting multiple times, no can do.

I would have included the report and a screenshot, but since I’m a new member, it seems I can’t.

Thank you for your help.

Just a quick update to mention that we were able to make the build stable again by replacing the faulty voicemail.conf with a copy of voicemail.conf.template. All our voicemail inboxes are gone though.

All you needed to do was fix the voicemail file. Not replace it completely.

Upon further investigation, I found out that one of our extensions (1003) was represented 2 times with 2 different sets of options.

1003 => 1337,Test,[email protected],[email protected],attach=yes|saycid=yes|envelope=no|delete => no,
1003 => 1337,Test,attach=no|saycid=no|envelope=no|delete => no,

Now all I have to find out is how this file ended up with two different settings for the same extensions…

As previously discussed that is/was the bug. Which has now been resolved. You will have to clean up your voicemail.conf file, unfortunately the fix can not do that for you. You can post the full voicemail.conf file here if you wish and I can clean it up for you

Oh, thanks but no thanks. I already cleaned up the file. Everything’s fine now.
I thought I’d post my own steps for fixing in case someone ends up with the same problem in the future.
Thanks for being so fast on fixing things!

Would removing voicemail module then re-installing it clear the issue?

No. You need to fix voicemail.conf manually as previously stated

Thanks. By fix you mean just removing the duplicate mailbox data? (presumably the second entry, not the first)