Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    Location
    Reporting Live from Marrz
    Posts
    254

    DBD::mysql::st execute failed in amavisd

    Code:
    Oct  8 20:33:04 mail amavis[11245]: (11245-02)
    NOTICE: reconnecting in response to: sql execute: sts=2013, DBD::mysql::st execute failed:
    Lost connection to MySQL server during query at (eval 38) line 127, <GEN20> line 5.
    Oct  8 20:33:04 mail amavis[11245]: (11245-02)
    sql begin transaction failed, probably disconnected by server,
    reconnecting (DBD driver has not implemented the AutoCommit attribute at
    /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/DBI.pm
    line 1632, <GEN6> line 246.)
    We are occassionally getting this on one dedicated mail server. Amavisd-new 2.3.1, DBD::mysql latest, Perl 5.8.5, mySQL 4.1 latest.

    Does anyone know why this happens and how to fix it?
    Last edited by SupaDucta; 10-08-2005 at 02:53 PM.

  2. #2
    Join Date
    Jul 2004
    Location
    Reporting Live from Marrz
    Posts
    254
    Nevermind - fixed.

    The wait_timeout in my.cnf was 30, way too short for it. According to mySQL manual, I have upped the wait_timeout.

    This didn't solve the problem, just made it appear less often.
    The problem was neither in amavisd nor any perl modules, it was in mySQL 4.1.

    Looking at SHOW VARIABLES; I have noticed that the init_connect
    variable was completely empty.

    So perl module couldn't set the attribute because there wasn't an
    initial variable it could set it to:

    'Oct 8 14:14:38 mail amavis[6697]: (06697-01-2) sql begin transaction
    failed, probably disconnected by server, reconnecting (DBD driver has
    not implemented the AutoCommit attribute at
    /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/DBI.pm line
    1632, <GEN6> line 74.) '

    After putting init_connect = 'set autocommit=0' in my.cnf, all works perfectly, amavisd disconnects from database even before timeouts when needed, no errors nor notices anywhere.

    Hard nut - took me 2 days to figure this one out, but is working like a charm now
    Last edited by SupaDucta; 10-09-2005 at 02:19 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •