Control Web Panel

WebPanel => Backup => Topic started by: ring_c on September 03, 2018, 05:44:00 AM

Title: Error found on the email from - Anacron job 'cron.daily'
Post by: ring_c on September 03, 2018, 05:44:00 AM
For the first time I've looked deeply into the email received for the daily backups and found some errors (marked the errors in Red):

---
mysqldump: unknown variable 'local-infile=0'
Database Backup: dbb_dba --> /backup/mysql/daily//dbb_dba.sql
mysqldump: unknown variable 'local-infile=0'
Database Backup: dbb_dbb --> /backup/mysql/daily//dbb_dbb.sql
mysqldump: unknown variable 'local-infile=0'
Database Backup: dbb_dbc --> /backup/mysql/daily//dbb_dbc.sql
mysqldump: unknown variable 'local-infile=0'
Database Backup: dbb_dbd --> /backup/mysql/daily//dbb_dbd.sql
mysqldump: unknown variable 'local-infile=0'
Database Backup: dbb_dbe --> /backup/mysql/daily//dbb_dbe.sql
mysqldump: unknown variable 'local-infile=0'
Database Backup: dbb_dbf --> /backup/mysql/daily//dbb_dbf.sql
mysqldump: unknown variable 'local-infile=0'
Database Backup: dbb_dbg --> /backup/mysql/daily//dbb_dbg.sql
Skipping database: information_schema.
mysqldump: unknown variable 'local-infile=0'
Database Backup: dbb_dbh --> /backup/mysql/daily//dbb_dbh.sql
mysqldump: unknown variable 'local-infile=0'
Database Backup: mysql --> /backup/mysql/daily//mysql.sql
mysqldump: unknown variable 'local-infile=0'
Database Backup: oauthv2 --> /backup/mysql/daily//oauthv2.sql
mysqldump: unknown variable 'local-infile=0'
Database Backup: performance_schema --> /backup/mysql/daily//performance_schema.sql
mysqldump: unknown variable 'local-infile=0'
Database Backup: postfix --> /backup/mysql/daily//postfix.sql
mysqldump: unknown variable 'local-infile=0'
Database Backup: root_cwp --> /backup/mysql/daily//root_cwp.sql
mysqldump: unknown variable 'local-infile=0'
Database Backup: roundcube --> /backup/mysql/daily//roundcube.sql
mysqldump: unknown variable 'local-infile=0'
Database Backup: dbb_dbi --> /backup/mysql/daily//dbb_dbi.sql
warning: /var/tmp/rpm-tmp.RpBiRK: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEYerror: Failed dependencies:
       perl(DBD::mysql) >= 1.0 is needed by percona-toolkit-2.2.16-1.noarch
---

Any idea what might be wrong?
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: bullten on September 03, 2018, 11:31:06 AM
What is output of

Code: [Select]
cat /etc/my.cnf
Did you added local-infile=0 under [mysqld] so it would look like

Code: [Select]
[mysqld]
local-infile=0
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: ring_c on September 03, 2018, 11:56:10 AM

cat /etc/my.cnf:
Code: [Select]

[xxx@cwp ~]# cat /etc/my.cnf
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]


#
# include all files from the config directory
#
!includedir /etc/my.cnf.d


#
# Disable LOAD DATA LOCAL commands in MySQL
#
local-infile=0


As you can see, the
Code: [Select]
local-infile=0 is there...
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: bullten on September 03, 2018, 12:15:02 PM
You didnt read my whole reply. i told you it should be under [mysqld]

Also when you added local-infile=0 you didnt restart mysql?

so now added it under [mysqld]

Quote
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]


#
# include all files from the config directory
#
!includedir /etc/my.cnf.d


#
# Disable LOAD DATA LOCAL commands in MySQL
#
[mysqld]
local-infile=0

Also dont forget to restart mysql
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: ring_c on September 03, 2018, 12:25:21 PM
You didnt read my whole reply. i told you it should be under [mysqld]
Sorry. I'm quite new to VPS in general and CWP in particular. I thought that's what you meant.


Also when you added local-infile=0 you didnt restart mysql?

so now added it under [mysqld]

Quote
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]


#
# include all files from the config directory
#
!includedir /etc/my.cnf.d


#
# Disable LOAD DATA LOCAL commands in MySQL
#
[mysqld]
local-infile=0

Also dont forget to restart mysql
I don't really know. I only follow tutorials. Though I'm quite sure I made a server restart 2 days ago...
I will change according to your guidance, restart mysql and will keep an eye on further emails hopping it'll be resolved.


Thanks!
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: bullten on September 03, 2018, 12:30:42 PM
Well you can replicate the issue easily.

in /etc/my.cnf file remove [mysqld] and restart mysql. See if it starts.
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: ring_c on September 03, 2018, 12:38:45 PM
Yes. It does restart!
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: bullten on September 03, 2018, 12:39:28 PM
what is output of

mysqldump

Does it gives same warning like  you mentioned above?
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: ring_c on September 03, 2018, 12:47:05 PM
Sorry, what exactly should I have to run?  :-[
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: bullten on September 03, 2018, 12:50:36 PM
make /etc/my.cnf to look like below as I comment out [mysqld]

nano /etc/my.cnf
Quote
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]


#
# include all files from the config directory
#
!includedir /etc/my.cnf.d


#
# Disable LOAD DATA LOCAL commands in MySQL
#
# [mysqld]
local-infile=0

restart mysql

Code: [Select]
service mysqld restart
Does it restart?

run the command below

Code: [Select]
mysqldump
Does the above command gives same warning as you mentioned in the first thread.
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: ring_c on September 03, 2018, 12:56:31 PM
Oh, this time it doesn't restart (I was using the restart button in CWP's dashboard before that, and I didn't get an error then).
Running service mysqld status after the restart command resolves in "ERROR! MariaDB is not running".
And mysqldump resolves in " unknown variable 'local-infile=0' " indeed.


I'll uncomment the [mysqld] and restart mysql again.
But... how come my wordpress sites are working then if the mysql is not running?
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: ring_c on September 03, 2018, 12:58:14 PM
Oh, damn... I've uncommented the [mysqld], saved the file and restarted mysqld.
But the status still shows the error message (though mysqldump doesn't).
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: bullten on September 03, 2018, 01:08:36 PM
Adding that line I think you didnt restart mysql and thats why it happened.

by uncommenting [mysqld] and restarting through ssh did it give any error?
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: ring_c on September 03, 2018, 01:49:12 PM
The last time I did it through SSH.
I still get the same error that MariaDB is not running. :(
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: bullten on September 03, 2018, 01:51:11 PM
stop mysql

Code: [Select]
service mysqld stop
service mysql stop

Now start from cwp gui
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: ring_c on September 03, 2018, 01:53:19 PM
Still the same. :(
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: bullten on September 03, 2018, 02:14:24 PM
what does below command shows
Code: [Select]
service mysqld status
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: ring_c on September 03, 2018, 02:29:46 PM
As before:
Code: [Select]
ERROR! MariaDB is not running
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: bullten on September 03, 2018, 02:35:07 PM
what is output of

Code: [Select]
mysqlcheck
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: ring_c on September 03, 2018, 02:43:38 PM

Code: [Select]
[root@cwp ~]# mysqlcheck
You forgot to give the arguments! Please see mysqlcheck --help
for more information.
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: bullten on September 03, 2018, 02:49:32 PM
what is final output of

Code: [Select]
service mysqld start
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: ring_c on September 03, 2018, 02:57:13 PM
Code: [Select]

[root@cwp ~]# service mysqld start
Starting mysqld (via systemctl):                           [  OK  ]
[root@cwp ~]# service mysqld status
 ERROR! MariaDB is not running
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: bullten on September 03, 2018, 03:07:22 PM
what does centos web panel gui says?
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: bullten on September 03, 2018, 03:15:50 PM
Hmmmm my bad you are running centos 7 and mariadb

start
Code: [Select]
systemctl start mariadb.service
stop
Code: [Select]
systemctl stop mariadb.service
restart
Code: [Select]
systemctl restart mariadb.service
status
Code: [Select]
systemctl status mariadb.service
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: ring_c on September 03, 2018, 06:08:46 PM
I was wondering why we're using the mysql command, but I thought - hey, I know nothing, I better shut up. :)


Well, yeah it seems it all works (all that time everything was Green in CWP dashboard).
Here's the status:


Code: [Select]
Active: active (running) since Mon 2018-09-03 21:04:47 IDT; 5s ago

So, I'm good? No need to panic? Do I have to change anything in /etc/my.cnf (remember we've added [mysqld] ?).
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: bullten on September 03, 2018, 09:17:11 PM
Yes my fault, agreed

Yes everything is fine as long as there is green light in GUI of CWP.



Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: ring_c on September 04, 2018, 05:24:48 AM
Thank you, dear bullten.
Yet, I'm still getting the following error in the log sent by email for daily backups:


Code: [Select]
warning: /var/tmp/rpm-tmp.VFyLyO: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEYerror: Failed dependencies:        perl(DBD::mysql) >= 1.0 is needed by percona-toolkit-2.2.16-1.noarch
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: bullten on September 04, 2018, 12:02:17 PM
Code: [Select]
yum install perl-DBI -y
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: ring_c on September 04, 2018, 01:57:43 PM

Already installed :(
Maybe perl needs mysql while I have MariaDB?

Code: [Select]

[root@cwp ~]# yum install perl-DBI -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                     |  31 kB     00:00
 * base: mirror.ratiokontakt.de
 * epel: mirror.wiuwiu.de
 * extras: mirror.ratiokontakt.de
 * remi-safe: mirror.23media.de
 * updates: mirror.ratiokontakt.de
base                                                     | 3.6 kB     00:00
cwp                                                      | 2.9 kB     00:00
extras                                                   | 3.4 kB     00:00
mariadb                                                  | 2.9 kB     00:00
remi-safe                                                | 2.9 kB     00:00
updates                                                  | 3.4 kB     00:00
varnishcache_varnish5/x86_64/signature                   |  836 B     00:00
varnishcache_varnish5/x86_64/signature                   | 1.0 kB     00:00 !!!
varnishcache_varnish5-source/signature                   |  836 B     00:00
varnishcache_varnish5-source/signature                   | 1.0 kB     00:00 !!!
Package perl-DBI-1.627-4.el7.x86_64 already installed and latest version
Nothing to do
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: bullten on September 04, 2018, 03:58:42 PM
You need to find out from where it is generating.
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: bullten on September 07, 2018, 04:09:56 PM
We dont usually use backup for cwp servers but today used it on one server and it gave the error as you mentioned error. Below is its resolution

Code: [Select]
yum install perl-DBD-MySQL -y
rpm -Uvh http://dl1.centos-webpanel.com/files/mysql/percona-toolkit.rpm

Rerun the backup and it will be fine now.

Code: [Select]
/usr/local/cwp/php71/bin/php -d max_execution_time=1000000 -q /usr/local/cwpsrv/htdocs/resources/admin/include/cron_backup.php
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: ring_c on September 08, 2018, 07:30:30 PM
Wow, bulletn, thank you so much for thinking of me!!!
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: ring_c on September 08, 2018, 08:03:02 PM
Well, I did get this:


Code: [Select]
Database Backup: oauthv2 --> /backup/mysql/daily//oauthv2.sql
mysqldump: Got error: 1142: "SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'accounts'" when using LOCK TABLES
Database Backup: performance_schema --> /backup/mysql/daily//performance_schema.                                                                                                                                                             sql
Title: Re: Error found on the email from - Anacron job 'cron.daily'
Post by: bullten on September 09, 2018, 01:08:20 PM
http://forum.centos-webpanel.com/backup/mysqldump-got-error-1142-'select-lock-tables/msg19058/#msg19058