CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Losing DB connection on mail cron
Pages: [1] 2

Author Topic: Losing DB connection on mail cron  (Read 4993 times)

Matt2000

  • I post frequently
  • ***
  • Posts: 288
  • Karma: 27
    • http://www.ninjitsuweb.com
Losing DB connection on mail cron
May 18, 2008, 07:01:09 pm
When I run mail cron, it starts the process (so it has an initial DB connection, because the status changes to 'Running') but then I get:

Code: [Select]
Error Details:

Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -14
    [message] => DB Error: no database selected
    [mode] => 16
    [debug_info] => SELECT *
 FROM civicrm_mailing_bounce_pattern
 
 
 
 
 
 [nativecode=2006 ** MySQL server has gone away]
    [type] => DB_Error
    [user_info] => SELECT *
 FROM civicrm_mailing_bounce_pattern
 
 
 
 
 
 [nativecode=2006 ** MySQL server has gone away]
    [to_string] => [db_error: message="DB Error: no database selected" code=-14 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT *
 FROM civicrm_mailing_bounce_pattern
 
 
 
 
 
 [nativecode=2006 ** MySQL server has gone away]"]
)

Any help available?
[/code]
Drupal/CiviCRM micro-blogging http://twitter.com/matt2000

Ninjitsu Web Development http://www.NinjitsuWeb.com/

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Losing DB connection on mail cron
May 18, 2008, 07:49:36 pm

check:

The MySQL server has gone away was a bit of a clue:

http://bugs.mysql.com/bug.php?id=1011

dont read a lot into the bug report, but i think it gives a clue on the potential issue.

What was the query(ies?) before the broken connection. What happens when you execute that query manually

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Matt2000

  • I post frequently
  • ***
  • Posts: 288
  • Karma: 27
    • http://www.ninjitsuweb.com
Re: Losing DB connection on mail cron
May 18, 2008, 08:07:23 pm
The bug is reported on 4.0, though I am running 5.0. Not sure what else to make of it.

Besides the SELECT query above, I'm seeing an error on:

Code: [Select]
[to_string] => [db_error: message="DB Error: no database selected" code=-14 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT RELEASE_LOCK( 'civimail.job.1.311' ) [nativecode=2006 ** MySQL server has gone away]"]
Drupal/CiviCRM micro-blogging http://twitter.com/matt2000

Ninjitsu Web Development http://www.NinjitsuWeb.com/

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Losing DB connection on mail cron
May 18, 2008, 08:19:46 pm

i think a bad query is causing the mysql server to drop the connection (which seems to be true, since the error message does say so)

so now the question remains, what query is causing this behavior? if you have mysql query logging enabled, you can search the query log for this information. if not, you can set 'daoDebug' to 1 in CRM/Core/Config.php and run the cron script from the browser. this should spit out lots of detailed information and hopefully will give you/us a clue on the potentially bad query

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Matt2000

  • I post frequently
  • ***
  • Posts: 288
  • Karma: 27
    • http://www.ninjitsuweb.com
Re: Losing DB connection on mail cron
May 18, 2008, 10:37:25 pm
It dies while doing:

CRM_Core_DAO_StateProvince: QUERY: SELECT id, abbreviation
FROM civicrm_state_province

..which returns a zillion rows that have nothing to do with my civimailing. Why would it even do this?

FYI, the mailing group is NOT a smart group.
Drupal/CiviCRM micro-blogging http://twitter.com/matt2000

Ninjitsu Web Development http://www.NinjitsuWeb.com/

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Losing DB connection on mail cron
May 18, 2008, 10:55:20 pm
Does repeating that query from console or phpMyAdmin crash your MySQL server also?
@xurizaemon ● www.fuzion.co.nz

Matt2000

  • I post frequently
  • ***
  • Posts: 288
  • Karma: 27
    • http://www.ninjitsuweb.com
Re: Losing DB connection on mail cron
May 18, 2008, 11:02:03 pm
Correction: Last query attempted before the error is:

"SELECT id, name FROM civicrm_state_province ORDER BY name "

Neither this nor the previously listed query fail when run from console.      :-P
Drupal/CiviCRM micro-blogging http://twitter.com/matt2000

Ninjitsu Web Development http://www.NinjitsuWeb.com/

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Losing DB connection on mail cron
May 18, 2008, 11:19:43 pm
You'll need to turn on DAO debugging then. See Lobo's instructions in this thread and see if that helps shed any light.
@xurizaemon ● www.fuzion.co.nz

Matt2000

  • I post frequently
  • ***
  • Posts: 288
  • Karma: 27
    • http://www.ninjitsuweb.com
Re: Losing DB connection on mail cron
May 19, 2008, 11:03:16 am
I did turn on DAO debugging; that's how I figured out the last query.

Is there a suggest set of MySQL configs for civimail? I've been playing with my.cnf, but no real progress yet.
Drupal/CiviCRM micro-blogging http://twitter.com/matt2000

Ninjitsu Web Development http://www.NinjitsuWeb.com/

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Losing DB connection on mail cron
May 19, 2008, 12:31:08 pm

i'm not sure why that query is causing problems. its a pretty simple query on a relatively small table (the question of whether we should even issue that query can be dealt with later)

You might want to check that your db is valid and consistent from a mysql standpoint.

http://dev.mysql.com/doc/refman/5.0/en/check-table.html

I suspect there are a few more commands like this

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Matt2000

  • I post frequently
  • ***
  • Posts: 288
  • Karma: 27
    • http://www.ninjitsuweb.com
Re: Losing DB connection on mail cron
May 19, 2008, 03:40:47 pm
My server provider reports that there is a known issue with cPaenl & mysql, and ran a script to fix.

I'm no longer getting DB errors, but my mailings is still not being sent when cron runs. Investigating this further...
Drupal/CiviCRM micro-blogging http://twitter.com/matt2000

Ninjitsu Web Development http://www.NinjitsuWeb.com/

Matt2000

  • I post frequently
  • ***
  • Posts: 288
  • Karma: 27
    • http://www.ninjitsuweb.com
Re: Losing DB connection on mail cron
May 19, 2008, 05:31:18 pm
Actually, it seems the cPanel fix did nothing permanent, except suggest that the problem might not be with CiviCRM. I'm loosing my DB connection again....
Drupal/CiviCRM micro-blogging http://twitter.com/matt2000

Ninjitsu Web Development http://www.NinjitsuWeb.com/

Matt2000

  • I post frequently
  • ***
  • Posts: 288
  • Karma: 27
    • http://www.ninjitsuweb.com
Re: Losing DB connection on mail cron
May 20, 2008, 01:11:47 pm
I'm noticing another symptom:

New mailings are assigned the same scheduled date & start date as the first uncompleted mailing (which has since been deleted).

Does this mean anything?
Drupal/CiviCRM micro-blogging http://twitter.com/matt2000

Ninjitsu Web Development http://www.NinjitsuWeb.com/

Matt2000

  • I post frequently
  • ***
  • Posts: 288
  • Karma: 27
    • http://www.ninjitsuweb.com
Re: Losing DB connection on mail cron
May 20, 2008, 01:40:30 pm
OK, I got a semi-successful cron completion for 2 mailings by increasing my mysql timeout variables to insane levels.

The mailings show as completed, but one report has 100% bounces (for 5 known good recipient addresses).

When I try to view the report for the second mailing, I get:

"Selected Mailing has more than one live job."

..and I'm sent to the CiviCRM admin page.

Any ideas?

Drupal/CiviCRM micro-blogging http://twitter.com/matt2000

Ninjitsu Web Development http://www.NinjitsuWeb.com/

Matt2000

  • I post frequently
  • ***
  • Posts: 288
  • Karma: 27
    • http://www.ninjitsuweb.com
Re: Losing DB connection on mail cron
May 20, 2008, 01:55:19 pm
The Test Mailing process is dying after this query according to daoDebug:

CRM_Mailing_DAO_Mailing: 1: Clearing Cache for crm_mailing_dao_mailing
CRM_Mailing_DAO_Mailing: 1: Clearing Cache for crm_mailing_dao_mailing
CRM_Core_DAO: CONNECT: Checking for database database_ in options
CRM_Core_DAO: QUERY: SELECT RELEASE_LOCK( 'civimail.job.1.320' )
CRM_Core_DAO: query: QUERY DONE IN 0.000404834747314 seconds
CRM_Core_DAO: 1: Clearing Cache for crm_core_dao
Drupal/CiviCRM micro-blogging http://twitter.com/matt2000

Ninjitsu Web Development http://www.NinjitsuWeb.com/

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Losing DB connection on mail cron

This forum was archived on 2017-11-26.