database error

Problems/questions regarding MailCleaner installation

Moderators: FlorianB, Pascal, bourgeois, mentor

c0mputerking
Posts: 5
Joined: Fri Nov 04, 2016 8:05 pm
How did you hear about Mailcleaner: google

database error

Postby c0mputerking » Wed Dec 13, 2017 8:05 pm

I am getting this database error is this normal ?? or does this have something to do with the fact i cannot create new users? either way nobody likes to see errors on their brand new install :)

171213 10:36:43 [ERROR] Error reading packet from server: Could not find first log file name in binary log index file ( server_errno=1236)
171213 10:36:43 [ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file', Error_code: 1236
171213 10:36:43 [Note] Slave I/O thread exiting, read up to log 'mysql_bin.000040', position 107
mentor
Posts: 26
Joined: Thu Jul 30, 2015 9:38 am
How did you hear about Mailcleaner: I work at MC

Re: database error

Postby mentor » Fri Dec 15, 2017 12:49 am

Hi c0mputerking,

have you still this issue ? If yes this may come from a forget during the VM creation in the binary log index file.

You can correct this by simply edit the file *.index file in /var/mailcleaner/spool/mysql_master/ and remove the line which contains mysql_bin.000040.

Regards,
Mentor Reka
MailCleaner Team
c0mputerking
Posts: 5
Joined: Fri Nov 04, 2016 8:05 pm
How did you hear about Mailcleaner: google

Re: database error

Postby c0mputerking » Fri Dec 15, 2017 8:40 am

Yes i believe i am still having the database problem, however i do not have a line in the *.index file which on my system is
mc_17-bin.index
there are only 2 lines in that file no mention of mysql_bin.00040
./mc_17-bin.000001
./mc_17-bin.000002
whiplash
Posts: 1
Joined: Tue Feb 13, 2018 10:43 am
How did you hear about Mailcleaner: On the web

Re: database error

Postby whiplash » Tue Feb 13, 2018 11:16 am

Hello, actually there's a problem in the master/slave replica, slave is pointing to the wrong binary log file, here's how I solved

=======================================================
# echo "show slave status\G" |/usr/mailcleaner/bin/mc_mysql -s mc_config
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: 127.0.0.1
Master_User: mailcleaner
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql_bin.000040
Read_Master_Log_Pos: 107
Relay_Log_File: mysqldslave-relay-bin.000005
Relay_Log_Pos: 4
Relay_Master_Log_File: mysql_bin.000040
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB: mc_config
Replicate_Ignore_DB: mc_spool
Replicate_Do_Table:
Replicate_Ignore_Table: mc_config.update_patch
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 107
Relay_Log_Space: 107
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 1236
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 11

As you may notice, IO thread is not running, because of the wrong bin log.

Let's see what master instance tells us:

=======================================================
# echo "show master status\G" |/usr/mailcleaner/bin/mc_mysql -m
*************************** 1. row ***************************
File: mysql_bin.000045
Position: 107
Binlog_Do_DB: mc_config
Binlog_Ignore_DB: mc_stats,mc_spool
=======================================================

So the right bin log file is mysql_bin.000045, position 107.

We need to fix the slave instance then.

Here you need the administrative password fro db (the one chosen during the web setup):

==================================================================
# /opt/mysql5/bin/mysql -S /var/mailcleaner/run/mysql_slave/mysqld.sock -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 142
Server version: 5.5.40 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> stop slave;
Query OK, 0 rows affected (0.02 sec)

mysql> reset slave;
Query OK, 0 rows affected (0.00 sec)

mysql> change master to master_log_file='mysql_bin.000045', master_log_pos=107;
Query OK, 0 rows affected (0.01 sec)

mysql> start slave;
Query OK, 0 rows affected (0.00 sec)

mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 127.0.0.1
Master_User: mailcleaner
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql_bin.000045
Read_Master_Log_Pos: 107
Relay_Log_File: mysqldslave-relay-bin.000002
Relay_Log_Pos: 253
Relay_Master_Log_File: mysql_bin.000045
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB: mc_config
Replicate_Ignore_DB: mc_spool
Replicate_Do_Table:
Replicate_Ignore_Table: mc_config.update_patch
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 107
Relay_Log_Space: 415
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 11
1 row in set (0.00 sec)

mysql> quit
Bye
==================================================================

Slave is now working as expected.
HTH.

Regards.

Return to “Installation”

Who is online

Users browsing this forum: No registered users and 5 guests