SQLgrey encountered an SQL error ...

Report bugs and workarounds
Post Reply
tesme33
Posts: 13
Joined: 22 Mar 2015 10:57
Location: Germany/Munich area

SQLgrey encountered an SQL error ...

Post by tesme33 » 12 Feb 2019 19:32

Hi
im getting since some time the following errors:

Code: Select all

SQLgrey encountered an SQL error and triggered a reconnection to: DBI:mysql:database=sqlgrey;host=localhost

and after some Minutes to half an hour

Code: Select all

SQLgrey established connection to: DBI:mysql:database=sqlgrey;host=localhost

This is sent to postmaster from sqlgrey.


Does anybody have the same issue ?


P.S.: The system is updated regularly via "yum update"

henk
Posts: 299
Joined: 14 Dec 2015 22:16
Location: Netherlands
Contact:

Re: SQLgrey encountered an SQL error ...

Post by henk » 12 Feb 2019 20:10

If sqlgrey is having issues, there must be more errors, when this pops up. The var/log messages is a good start.
As I have some ideas why, can you post:

Code: Select all

free -m

Code: Select all

df -h

Code: Select all

find /var/lib/mysql/ -maxdepth 1 -type d ! -name '.' -exec du -sh {} \;

Code: Select all

ls -l /var/dcc/log |wc -l

Code: Select all

ls -l /var/spool/MailScanner/incoming/SpamAssassin-Temp | wc -l

tesme33
Posts: 13
Joined: 22 Mar 2015 10:57
Location: Germany/Munich area

Re: SQLgrey encountered an SQL error ...

Post by tesme33 » 13 Feb 2019 05:58

Hi
thanks for the ideas.
Below you find the output put i dont see anomalies, perhaps as i dont have any comparision possibility.

Code: Select all

[root@efa ~]# free -m
             total       used       free     shared    buffers     cached
Mem:          3832       3241        590          1        258       1293
-/+ buffers/cache:       1689       2142
Swap:            0          0          0
[root@efa ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_00-lv_root
                      7.8G  2.9G  4.6G  39% /
tmpfs                 1.9G     0  1.9G   0% /dev/shm
/dev/sda1             485M  165M  296M  36% /boot
/dev/mapper/vg_00-lv_tmp
                      976M  1.7M  924M   1% /tmp
/dev/mapper/vg_00-lv_var
                       21G  3.5G   16G  19% /var
none                  1.9G   68K  1.9G   1% /var/spool/MailScanner/incoming
[root@efa ~]# find /var/lib/mysql/ -maxdepth 1 -type d ! -name '.' -exec du -sh {} \;
390M	/var/lib/mysql/
1.3M	/var/lib/mysql/mysql
32K	/var/lib/mysql/efa
46M	/var/lib/mysql/sa_bayes
8.0K	/var/lib/mysql/performance_schema
4.0K	/var/lib/mysql/temp
20M	/var/lib/mysql/mailscanner
280K	/var/lib/mysql/sqlgrey
[root@efa ~]# ls -l /var/dcc/log |wc -l
603
[root@efa ~]# ls -l /var/spool/MailScanner/incoming/SpamAssassin-Temp | wc -l
1

henk
Posts: 299
Joined: 14 Dec 2015 22:16
Location: Netherlands
Contact:

Re: SQLgrey encountered an SQL error ...

Post by henk » 13 Feb 2019 11:29

Looks fine to me, but as you have only 4Gb memory, you can try 2 things.
1. Add memory ( 8GB is recommended)
2. Stop or disable services.

Code: Select all

service munin-node stop
If you do not use webmin

Code: Select all

service webmin stop
Disable cron in

Code: Select all

/etc/cron.d/munin
#*/5 * * * * munin test -x /usr/bin/munin-cron && /usr/bin/munin-cron

Disable monitored services in

Code: Select all

/usr/sbin/EFA-Monitor-cron
MonitoredServices=("mysqld=mysqld" "MailScanner=mailscanner" "master=postfix" "httpd=httpd" "clamd=clamd" "unbound=unbound" "saslauthd=saslauthd" "dccifd=adcc")

If the issue is solved by these modifications, you could disable the Webmin and or munin services
Disable service

Code: Select all

chkconfig Webmin  off
Check services

Code: Select all

chkconfig --list
My memory ( As I'm also using only 4 GB)

Code: Select all

free -m
             total       used       free     shared    buffers     cached
Mem:          3961       2940       1020          1        163       1284
-/+ buffers/cache:       1492       2468
Swap:         4095          0       4095

tesme33
Posts: 13
Joined: 22 Mar 2015 10:57
Location: Germany/Munich area

Re: SQLgrey encountered an SQL error ...

Post by tesme33 » 17 Feb 2019 06:11

Hi
i have changed the config to 8GB . but no result. I now even have the feeling that the error comes more often.

Is there a script to check the mysql database ? Or some maintenance action which could be done ?

Code: Select all

[admin@efa ~]$ free
             total       used       free     shared    buffers     cached
Mem:       8061260    3136144    4925116       1612     269864    1182640
-/+ buffers/cache:    1683640    6377620
Swap:            0          0          0

henk
Posts: 299
Joined: 14 Dec 2015 22:16
Location: Netherlands
Contact:

Re: SQLgrey encountered an SQL error ...

Post by henk » 17 Feb 2019 10:15

You need to learn how to search this forum, as it contains a lot of usefull information viewtopic.php?t=2974
The logs will provide usefull info in most cases, so always check them for errors. ( /var/log/)
To check mysql issues have a look at viewtopic.php?t=2938

tesme33
Posts: 13
Joined: 22 Mar 2015 10:57
Location: Germany/Munich area

Re: SQLgrey encountered an SQL error ...

Post by tesme33 » 17 Feb 2019 14:53

Hi
after searching around the only way was to check the mysql.

Code: Select all

more /var/lib/mysql/efa.xxx.de.err | grep ERROR
And yes some tables, incl. sqlgray, need repair.

Now going a repair via mysqlcheck repaired the tables.

Table check: --> behind all tables you should see an OK
· --check, -c

Check the tables for errors. This is the default operation.

Code: Select all

mysqlcheck -c -A -uroot -p`grep ROOT /etc/EFA-Config | awk -F: '{print $2}'`
Table analyze:
· --analyze, -a

Analyze the tables.

Code: Select all

mysqlcheck --analyze -A -uroot -p`grep ROOT /etc/EFA-Config | awk -F: '{print $2}'`
Table repair:
· --repair, -r

Perform a repair that can fix almost anything except unique keys that are not unique.

Code: Select all

mysqlcheck -r -A -uroot -p`grep ROOT /etc/EFA-Config | awk -F: '{print $2}'`

Post Reply