Summary:ASTERISK-20456: Unable to take calls when MYSQL server is unreachable
Reporter:Ksenia (ksy)Labels:
Date Opened:2012-09-21 00:59:01Date Closed:2012-10-17 09:02:52
Versions: Frequency of
Environment:GentooAttachments:( 0) asterisk_start_debug.txt
Description:We store cdr records in a mysql database on a remote server. When mysql server becomes unreachable, it's impossible to make and take calls. Only unloading of cdr_mysql module helps while the server is unreachable. When I connect to the console, of course there are messages like 'cannot connect to database ...'. I'm using asterisk on Gentoo.
Any help will be appreciated.
Comments:By: Rusty Newton (rnewton) 2012-09-24 14:13:54.537-0500

Thank you for taking the time to report this bug and helping to make Asterisk better. Unfortunately, we cannot work on this bug because your description did not include enough information. You may find it helpful to read the Asterisk Issue Guidelines https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines. We would be grateful if you would then provide a more complete description of the problem. At a minimum, we need:

1. the specific steps or actions you took that caused you to encounter the problem,
2. the behavior you expected, and
3. the behavior you actually encountered (in as much detail as possible).

This likely includes output from the console with debug level logging, a SIP trace (if this is SIP related), and configuration information such as dialplan (e.g. extensions.conf) and channel configuration (e.g. sip.conf). Thanks!

Please make sure to include a full log captured during the issue occurring, including VERBOSE and DEBUG messages(logger.conf) enabled at level 5.

By: Matt Jordan (mjordan) 2012-10-17 09:02:44.642-0500

Suspended due to lack of activity. Please request a bug marshal in #asterisk-bugs on the IRC network irc.freenode.net to reopen the issue should you have the additional information requested.  Further information can be found at http://www.asterisk.org/developers/bug-guidelines

By: Ksenia (ksy) 2014-10-09 07:26:37.822-0500

Sorry for not responding for a long time - we have found a workaround for that issue using an external script to insert records. But now I have encountered the problem again on Ubuntu 14.04.1 (3.13.0-32). If mysql server is unreachable it seems to me that asterisk core does not load, just like the other modules like pbx_config.so. So 'dialplan show' comand shows only context from features.conf.

This is my test config of cdr_mysql.conf. Fake mysql host is chosen to emulate mysql server outage.

Then I start asterisk with /etc/init.d/asterisk debug (-cvvvvvddddd).
Everything hangs on  
{{== Parsing '/etc/asterisk/cdr_mysql.conf': Found}}
There are no error messages indicating a database is unreachable (unlike the situation with Gentoo). Full log is attached. I can provide any additional information if needed.

By: Ksenia (ksy) 2014-10-09 07:37:10.918-0500

That is strange - when I continued testing asterisk has eventually started with a message
[Oct  9 12:27:27] ERROR[28526]: cdr_mysql.c:560 my_load_module: Failed to connect to mysql database asterisk on
Now I'll try to emulate my recent failure - the database was up but did not respond to requests and asterisk did not load dialplan.