Upgrade 13 to 14 Error: SQLSTATE[HY000] [2002] can't connect to


#1

… through socket /var/lib/mysql.sock

Based on other threads I’ve repaired tables, verified I have HD space.
ps aux | grep mysql suggests the server is running so, according to other threads
“my problem is probably in the asterisk config”
Where do I go next?

The was an error during the repair install
sqlstate[42S04] base table or view not found: 1146 table ‘asterisk.kvstore_Sipsettings’ doesn’t exist.

I have checked and, indeed, there is no table with this name. All the tables in the database are listed at the bottom of this thread.

Also during install another error suggested I command:
fwconsole ma install sipsettings
which also errors
sqlstate[42S04] base table or view not found: 1146 table ‘asterisk.kvstore_Sipsettings’ doesn’t exist.

Checking mysql:
[root@pbx ~]# ps aux | grep mysql
mysql 971 0.0 0.0 113308 1632 ? Ss 13:08 0:00 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
mysql 1137 0.2 1.7 1235944 102008 ? Sl 13:08 0:01 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --socket=/var/lib/mysql/mysql.sock

Any idea?

after ./post_upgrade

[root@pbx ~]# ./post_upgrade
######### Starting upgrade repair on Mon Oct 14 12:57:22 UTC 2019 #########
######### Cleaning old EL5 and EL6 packages #########
######### Enabling and starting mariadb #########
######### Running mysql_upgrade #########
######### Attempting to check for internet connectivity #########
######### Verified internet connectivity #########
######### Removing known bad RPMs #########
######### Running initial yum update #########
######### Updating Dahdi for this kernel #########
######### Removing packages that will give us problems on blanket yum update ### ######
######### Running yum upgrade (This could take a long time!) #########
######### Before we update downgrade packages in case they were from other sourc es #########
######### Removing old packages that are no longer needed #########
######### Removing PBX Modules that are tied to a PHP Version #########
######### Removed module areminder #########
######### Removed module broadcast #########
######### Removed module callerid #########
######### Removed module calllimit #########
######### Removed module conferencespro #########
######### Removed module cos #########
######### Removed module endpoint #########
######### Removed module extensionroutes #########
######### Removed module faxpro #########
######### Removed module freepbx_ha #########
######### Removed module pagingpro #########
######### Removed module parkpro #########
######### Removed module pinsetspro #########
######### Removed module pms #########
######### Removed module queuestats #########
######### Removed module qxact_reports #########
######### Removed module recording_report #########
######### Removed module restapps #########
######### Removed module sangomacrm #########
######### Removed module sysadmin #########
######### Removed module vega #########
######### Removed module vmnotify #########
######### Removed module voicemail_report #########
######### Removed module vqplus #########
######### Removed module webcallback #########
######### Removed module zulu #########
######### Get a list of modules that are disabled, to attempt to re-disable late r #########
######### Module modulename is in a disabled state #########
######### Module extensionroutes is in a disabled state #########
######### Starting Asterisk #########
######### Updating PBX Version #########
######### Checking for proper fwconsole installation #########
######### Updating ‘framework’ #########
######### Updating ‘core’ #########
######### Skip module cache #########
######### Forcing enabling all modules, in case anything was disabled #########
######### Updating remaining modules #########
No repos specified, using: [standard,extended,commercial,unsupported] from last GUI settings

Module(s) requiring upgrades: findmefollow, sipsettings, sipstation
Upgrading module ‘sipsettings’ from 14.0.27.17 to 14.0.27.17
Downloading module ‘sipsettings’
Processing sipsettings
Verifying local module download…Verified
Extracting…Done
Download completed in 5 seconds
checking for sipsettings table…already exists

In Database.class.php line 212:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'asterisk.kvstore_
** Sipsettings’ doesn’t exist**

moduleadmin [-f|–force] [-d|–debug] [–edge] [–stable] [–color] [–skipchown] [-e|–autoenable] [–skipdisabled] [–snapshot SNAPSHOT] [–format FORMAT] [-R|–repo REPO] [-t|–tag TAG] [–sendemail] [–onlystdout] [–] []…

Upgrading module ‘findmefollow’ from 14.0.1.23 to 14.0.1.23
Downloading module ‘findmefollow’
Processing findmefollow
Verifying local module download…Verified
Extracting…Done
Download completed in 6 seconds
Updating tables findmefollow…Done

In php-asmanager.php line 242:

Asterisk is not connected

moduleadmin [-f|–force] [-d|–debug] [–edge] [–stable] [–color] [–skipchown] [-e|–autoenable] [–skipdisabled] [–snapshot SNAPSHOT] [–format FORMAT] [-R|–repo REPO] [-t|–tag TAG] [–sendemail] [–onlystdout] [–] []…

Upgrading module ‘sipstation’ from 14.0.4.1 to 14.0.4.1
Downloading modulProcessing sipstation
Verifying local module download…Verified
Extracting…Done
Download completed in 52 seconds
Detected Missing Dependency of: sipsettings 13.0.26
Found local Dependency of: sipsettings 14.0.27.17
Installing Missing Dependency of: sipsettings 13.0.26
checking for sipsettings table…already exists

In Database.class.php line 212:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'asterisk.kvstore_
** Sipsettings’ doesn’t exist**

moduleadmin [-f|–force] [-d|–debug] [–edge] [–stable] [–color] [–skipchown] [-e|–autoenable] [–skipdisabled] [–snapshot SNAPSHOT] [–format FORMAT] [-R|–repo REPO] [-t|–tag TAG] [–sendemail] [–onlystdout] [–] []…

All upgrades completed successfully!
Updating Hooks…Done
######### Repairing PHP Version specific modules #########
######### Ensuring sysadmin is enabled and up to date #########
######### Repairing areminder #########
######### Repairing broadcast #########
######### Repairing callerid #########
######### Repairing calllimit #########
######### Repairing conferencespro #########
######### Repairing cos #########
######### Repairing endpoint #########
######### Repairing extensionroutes #########
######### Repairing faxpro #########
######### Repairing freepbx_ha #########
######### Repairing pagingpro #########
######### Repairing parkpro #########
######### Repairing pinsetspro #########
######### Repairing pms #########
######### Repairing queuestats #########
######### Repairing qxact_reports #########
######### Repairing recording_report #########
######### Repairing restapps #########
######### Repairing sangomacrm #########
######### Repairing vmnotify #########
######### Repairing voicemail_report #########
######### Repairing vqplus #########
######### Repairing webcallback #########
######### Repairing zulu #########
######### Adding new modules #########
######### Re-running install to ensure database is correct #########
######### Removing bria Module #########
######### Attempting to disable any modules that was previously disabled #########
######### Attempting to re-disable the module modulename #########
Error running fwconsole ma disable modulename - Retrying. Output was:
The following error(s) occured:

  • Specified module not found
    ######### Attempting to re-disable the module extensionroutes #########
    Error running fwconsole ma disable extensionroutes - Retrying. Output was:
    The following error(s) occured:
  • Module not enabled: cannot disable
    ######### Attempting to remove any branding modules, as we will get an updated one later #########
    ######### Attempting remove module asteriskinfo #########
    ######### Updating httpd.conf #########
    Generating grub configuration file …
    Found linux image: /boot/vmlinuz-3.10.0-957.21.3.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-957.21.3.el7.x86_64.img
    Found linux image: /boot/vmlinuz-3.10.0-957.10.1.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-957.10.1.el7.x86_64.img
    Found linux image: /boot/vmlinuz-redhat-upgrade-tool
    done
    ######### Running System Configuration hooks #########
    ######### - Running config-pnpd #########
    ######### - Running config-postfix #########
    Skipping crontab-update
    ######### - Running fail2ban-generate #########
    ######### - Running update-dns #########
    ######### - Running update-dnsmasq #########
    ######### - Running update-hostname #########
    ######### - Running update-ports #########
    ######### - Running update-timezone #########
    ######### Starting PBX #########
    ######### Update license #########
    Updating license for 92874833
    Done!
    No changes from original Licence.
    ######### Running final PBX Reload #########
    Error running fwconsole reload - Retrying. Output was:
    Reloading FreePBX
    Error(s) have occured, the following is the retrieve_conf output:
    exit: 1

Error running fwconsole reload - Retrying. Output was:
Reloading FreePBX
Error(s) have occured, the following is the retrieve_conf output:
exit: 1

Error running fwconsole reload - Retrying. Output was:
Reloading FreePBX
Error(s) have occured, the following is the retrieve_conf output:
exit: 1

######### Finished post_upgrade on Mon Oct 14 13:07:37 UTC 2019 #########
######### Rebooting one more time #########

Getting a little desperate here:
tried
/usr/sbin/asterisk -vvvgc
lots of errors like:
[2019-10-14 13:27:30] WARNING[4316]: pbx.c:7019 add_priority: Extension ‘s’ priority 13 in ‘macro-user-logon’, label ‘gotpass’ already in use at priority 9
[2019-10-14 13:27:30] ERROR[4316]: pbx.c:7243 ast_add_extension2_lockopt: You have to be kidding-- add exten ‘’ to context clean? Figure out a name and call me back. Action ignored.
and
[2019-10-14 13:27:54] NOTICE[4440]: manager.c:3492 authenticate: 127.0.0.1 failed to authenticate as ‘admin’

Tables in the database:

MariaDB [asterisk]> show tables;
±--------------------------------------------+
| Tables_in_asterisk |
±--------------------------------------------+
| admin |
| ampusers |
| announcement |
| areminder |
| areminder_calls |
| areminder_settings |
| areminder_updates |
| arimanager |
| backup |
| backup_cache |
| backup_details |
| backup_items |
| backup_server_details |
| backup_servers |
| backup_template_details |
| backup_templates |
| broadcast_callees |
| broadcast_campaign_groups |
| broadcast_campaigns |
| broadcast_groups |
| broadcast_log |
| broadcast_settings |
| callback |
| callerid_entries |
| calllimit |
| calllimit_usage |
| callrecording |
| callrecording_module |
| certman_cas |
| certman_certs |
| certman_csrs |
| certman_mapping |
| cidlookup |
| cidlookup_incoming |
| conferencespro |
| conferencespro_rooms |
| contactmanager_entry_emails |
| contactmanager_entry_images |
| contactmanager_entry_numbers |
| contactmanager_entry_speeddials |
| contactmanager_entry_userman_images |
| contactmanager_entry_websites |
| contactmanager_entry_xmpps |
| contactmanager_group_entries |
| contactmanager_groups |
| cron_jobs |
| cronmanager |
| custom_extensions |
| customcontexts_contexts |
| customcontexts_contexts_list |
| customcontexts_includes |
| customcontexts_includes_list |
| customcontexts_module |
| cxpanel_conference_rooms |
| cxpanel_email |
| cxpanel_managed_items |
| cxpanel_phone_number |
| cxpanel_queues |
| cxpanel_recording_agent |
| cxpanel_server |
| cxpanel_users |
| cxpanel_voicemail_agent |
| dahdi |
| dahdi_advanced |
| dahdi_advanced_modules |
| dahdi_analog |
| dahdi_analog_custom |
| dahdi_configured_locations |
| dahdi_modules |
| dahdi_spans |
| dahdichandids |
| daynight |
| devices |
| digium_phones_alerts |
| digium_phones_customapp_settings |
| digium_phones_customapps |
| digium_phones_device_alerts |
| digium_phones_device_customapps |
| digium_phones_device_externallines |
| digium_phones_device_logos |
| digium_phones_device_mcpages |
| digium_phones_device_networks |
| digium_phones_device_parkapps |
| digium_phones_device_phonebooks |
| digium_phones_device_ringtones |
| digium_phones_device_settings |
| digium_phones_device_statuses |
| digium_phones_devices |
| digium_phones_extension_settings |
| digium_phones_externalline_settings |
| digium_phones_externallines |
| digium_phones_firmware |
| digium_phones_firmware_packages |
| digium_phones_general |
| digium_phones_lines |
| digium_phones_logos |
| digium_phones_mcpage_settings |
| digium_phones_mcpages |
| digium_phones_network_settings |
| digium_phones_networks |
| digium_phones_phonebook_entries |
| digium_phones_phonebook_entry_settings |
| digium_phones_phonebooks |
| digium_phones_pnac_settings |
| digium_phones_pnacs |
| digium_phones_queues |
| digium_phones_ringtones |
| digium_phones_status_entries |
| digium_phones_status_settings |
| digium_phones_statuses |
| digium_phones_voicemail_translations |
| digiumaddoninstaller_addons |
| digiumaddoninstaller_addons_downloads |
| digiumaddoninstaller_downloads |
| digiumaddoninstaller_downloads_ast_versions |
| digiumaddoninstaller_downloads_bits |
| digiumaddoninstaller_registers |
| digiumaddoninstaller_system |
| directory_details |
| directory_entries |
| disa |
| endpoint_basefiles |
| endpoint_basestations |
| endpoint_brand |
| endpoint_buttons |
| endpoint_customExt |
| endpoint_digium_phones_general |
| endpoint_ext_buttons |
| endpoint_extensions |
| endpoint_firmware |
| endpoint_global |
| endpoint_ignoreMac |
| endpoint_images |
| endpoint_models |
| endpoint_ringtones |
| endpoint_templates |
| endpoint_timezones |
| endpoint_xml |
| endpointman_brand_list |
| endpointman_custom_configs |
| endpointman_global_vars |
| endpointman_line_list |
| endpointman_mac_list |
| endpointman_model_list |
| endpointman_oui_list |
| endpointman_product_list |
| endpointman_template_list |
| extensionroutes |
| extensions |
| fax_details |
| fax_incoming |
| fax_store |
| fax_users |
| faxpro_hook_core |
| featurecodes |
| findmefollow |
| freepbx_log |
| freepbx_settings |
| globals |
| hotelwakeup |
| hotelwakeup_calls |
| iax |
| iaxsettings |
| incoming |
| indications_zonelist |
| ivr_details |
| ivr_entries |
| kvblobstore |
| kvstore |
| kvstore_Dashboard |
| kvstore_Fax |
| kvstore_FreePBX |
| kvstore_FreePBX_Hooks |
| kvstore_FreePBX_modules_Calendar |
| kvstore_FreePBX_modules_Conferences |
| kvstore_FreePBX_modules_Contactmanager |
| kvstore_FreePBX_modules_Core |
| kvstore_FreePBX_modules_Dahdiconfig |
| kvstore_FreePBX_modules_Firewall |
| kvstore_FreePBX_modules_Recording_report |
| kvstore_FreePBX_modules_Sangomacrm |
| kvstore_FreePBX_modules_Ucpnode |
| kvstore_FreePBX_modules_Userman |
| kvstore_FreePBX_modules_Voicemail |
| kvstore_FreePBX_modules_Webrtc |
| kvstore_FreePBX_modules_Zulu |
| kvstore_OOBE |
| language_incoming |
| languages |
| logfile_logfiles |
| logfile_settings |
| manager |
| meetme |
| miscapps |
| miscdests |
| module_xml |
| modules |
| motif |
| music |
| notifications |
| outbound_route_patterns |
| outbound_route_sequence |
| outbound_route_trunks |
| outbound_routes |
| outroutemsg |
| paging_autoanswer |
| paging_config |
| paging_groups |
| pagingpro |
| pagingpro_core_routing |
| pagingpro_scheduler_crons |
| pagingpro_scheduler_events |
| pagingpro_scheduler_exclusions |
| pagingpro_scheduler_range |
| parkplus |
| parkplus_announce |
| parkplus_device |
| phpagiconf |
| pinset_usage |
| pinsets |
| pjsip |
| pms_banner |
| pms_booking |
| pms_calendar |
| pms_charges |
| pms_config |
| pms_cos_oracle |
| pms_guest |
| pms_maid_services |
| pms_minibar |
| pms_models |
| pms_privileges |
| pms_rates_obrt |
| pms_register |
| pms_rest_sales |
| pms_restaurant |
| pms_rooms |
| pms_sched_discounting |
| pms_sched_room |
| pms_status |
| polycom_alertinfo |
| polycom_device_attendants |
| polycom_device_line_settings |
| polycom_device_lines |
| polycom_device_settings |
| polycom_devices |
| polycom_externalline_settings |
| polycom_externallines |
| polycom_network_settings |
| polycom_networks |
| polycom_settings |
| presencestate_list |
| presencestate_prefs |
| prosody |
| qs_agentlog |
| qs_agentstats |
| qs_callstats |
| qs_livestats |
| qs_queuestats |
| queuemetrics_options |
| queueprio |
| queues_config |
| queues_details |
| qxact_agent_actions |
| qxact_agent_calls |
| qxact_calls |
| qxact_reports |
| qxact_system_events |
| recording_files |
| recording_report |
| recordings |
| restapi_general |
| restapi_log_event_details |
| restapi_log_events |
| restapi_token_details |
| restapi_token_user_mapping |
| restapi_tokens |
| restapps_settings |
| restapps_stats |
| ringgroups |
| sangomacrm_rest_rows |
| sangomacrm_rest_webhooks |
| sangomarcrm_salesforce_users |
| sangomarcrm_suitecrm_users |
| sangomarcrm_zoho_users |
| setcid |
| sip |
| sipsettings |
| sms_dids |
| sms_media |
| sms_messages |
| sms_routing |
| sng_mcu_details |
| sng_mcu_entries |
| soundlang_customlangs |
| soundlang_packages |
| soundlang_prompts |
| soundlang_settings |
| superfecta_mf |
| superfecta_mf_child |
| superfecta_to_incoming |
| superfectacache |
| superfectaconfig |
| sysadmin_options |
| sysadmin_update_log |
| timeconditions |
| timegroups_details |
| timegroups_groups |
| trunk_dialpatterns |
| trunks |
| tts |
| ttsengines |
| ucp_sessions |
| userman_directories |
| userman_groups |
| userman_groups_settings |
| userman_users |
| userman_users_settings |
| users |
| virtual_queue_config |
| vmblast |
| vmblast_groups |
| vmnotify |
| vmnotify_events |
| vmnotify_notifications |
| voicemail_admin |
| vqplus_callback_calls |
| vqplus_callback_config |
| vqplus_callback_log |
| vqplus_qrule_config |
| vqplus_qrule_detail |
| vqplus_queue_config |
| webcallback |
| webrtc_clients |
| xmpp_options |
| xmpp_users |
| zulu_interactions_contacts |
| zulu_interactions_interaction_states |
| zulu_interactions_interactions |
| zulu_interactions_members |
| zulu_interactions_owners |
| zulu_interactions_stream_actions |
| zulu_interactions_stream_bodies |
| zulu_interactions_stream_links |
| zulu_interactions_streams |
| zulu_login_tokens |
| zulu_softphones |
| zulu_tokens |
±--------------------------------------------+
348 rows in set (0.00 sec)


Distro Upgrade script for 13 to 14?
(Lorne Gaetz) #2

What is output now of:

fwconsole ma list | grep sipsettings

#3

Thank you! Got this.

[root@localhost ~]# fwconsole ma list | grep sipsettings
| sipsettings | 13.0.27.8 | Disabled; Pending upgrade to 14.0.27.17 | AGPLv3+ |

Would this be something to try?
fwconsole ma downloadinstall framework --force
fwconsole ma downloadinstall core --force
… saw it in another thread.


(Lorne Gaetz) #4

The following commands will roll back to 13 so you can then try updating again:

fwconsole ma downloadinstall sipsettings --tag 13.0.27.8 
fwconsole ma upgrade sipsettings

#5

SQLSTATE[HY000]: General error: 126 Incorrect key file for table ‘./asterisk/kvstore.MYI’; try to repair it
repaired asterisk.kvstore
Module sipsettings version 14.0.27.17 successfully installed

After I did this, the “Can not Connect to asterisk” note went away. Rebooted, got the same SQL state error, and “Can not connect to asterisk” is back.

Re-executed the commands you suggested, now I appear to be running fine. I don’t understand this…

./post_upgrade throws this error

FATAL ERROR: Upgrade failed
Error running /usr/bin/mysql_upgrade - Retrying. Output was:
Version check failed. Got the following error when calling the ‘mysql’ command line client
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)

Nonetheless, after another run of ./post_upgrade it seems to be working.

(Later) after rebooting the server, when I log in, the SQLSTATE error shows and the GUI says “Can not connect to Asterisk”. After a few minutes, the message disappears. It it just a matter of “wait a few minutes?”


(system) closed #6

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