Welcome, Guest. Please login or register.

Author Topic: DBD:mysql error during nightly backup 1.6p1  (Read 1053 times)

ntmark

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • tvnz.co.nz
DBD:mysql error during nightly backup 1.6p1
« on: June 13, 2016, 01:57:30 AM »
I've been doing backups with options -sS -p -B360 and getting an error in the log when I get to a 6800X with VSS and 25 FEX switches.
It always happens on this switch with the error below
Code: [Select]
10.20.10.1     SWITCH1      v97 i1694    j75   DiDpp1 b23 m173    a4     f1214 c26428DBD::mysql::st execute failed: MySQL server has gone away at /usr/local/nedi/inc/libdb.pm line 913.
DBD::mysql::st execute failed: MySQL server has gone away at /usr/local/nedi/inc/libdb.pm line 913.

Looking this up I found that the connection may be timing out? and that enabling mysql_auto_reconnect or checking connection before performing execute may help.
I'm not sure if this is enabled already, but to enable the option the below was given on the cpan.org doc of DBD-mysql.
Code: [Select]
$dbh->{mysql_auto_reconnect} = 1;OR
Code: [Select]
my $dbh = DBI->connect($dsn, $user, $password, {
 mysql_auto_reconnect => 1,
});

I've already tried with this added to line 37 in libdb.pm where $dbh = DBI->connect(..... is defined like so:
Code: [Select]
$dbh = DBI->connect("DBI:$misc::backend:dbname=$dbname;host=$dbhost", $dbuser, $dbpass, { RaiseError => 1, AutoCommit => $ac, mysql_auto_reconnect=> 1} ) or die $DBI::errstr;
But the same error occurred.
Any tips on what I need to do to fix this error and it looks like backups aren't working correctly.

Thanks in advance.
Apologies for the choppy post.
Mark.
« Last Edit: June 16, 2016, 02:09:07 AM by ntmark »

ntmark

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • tvnz.co.nz
Re: DBD:mysql error during nightly backup 1.6p1
« Reply #1 on: June 14, 2016, 02:44:21 AM »
Small addition.
I've also tried to run this from the GUI to force backup with these options: -v -B0 -SAFGgsjmvpadobewitu -a
but same result.

I've tied it down to about line 912 in inc/libdb.pm where this following line is run:
Code: [Select]
$sth->execute ($dv,$cfg,$chg,$main::now);
I think this started to happen after the 1.6p1 patch was applied, but I'm not entirely sure about this.

Printing out some output before that $sth->execute was run the values supplied to it are:
HOSTNAME: ~10 characters
CONFIG: 26427 lines
CHANGES: 20715 lines
UNIXTIMESTAMP: todays date.

Unable to get any output after the execute as it crashes.




rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2520
    • View Profile
    • NeDi
Re: DBD:mysql error during nightly backup 1.6p1
« Reply #2 on: June 14, 2016, 10:49:13 PM »
The config and changes seem quite big. If you can live with loosing the changes in the DB try deleting them first (via red X) and then backup again. If it works, it could explain why it worked before (when the changes were smaller).

I guess the proper way to fix this may be changing my.cnf:

max_allowed_packet = 128M

then sudo /etc/init.d/mysql restart
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

ntmark

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • tvnz.co.nz
Re: DBD:mysql error during nightly backup 1.6p1
« Reply #3 on: June 16, 2016, 02:08:26 AM »
Thanks,
 I've added the max_allowed_packet = 128 to mariaDB my.cnf
All is now working!

This is now showing with 1696 interfaces.
Takes about 4 minutes to complete a Discovery.
changes came to 11689.

currently has 30 configured FEX's and soon will have another 6 or so.

Backup config is 739K in size

Restart with  systemd controls:
Code: [Select]
systemctl restart mariadb
Thank you for the help.
Mark. ;D