Segmentation Fault from running repairmysql.sh

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
NetNeutron
Posts: 36
Joined: Thu Aug 25, 2016 12:49 pm

Segmentation Fault from running repairmysql.sh

Post by NetNeutron »

Hello,
I have been getting a lot of messages in the /var/log/messages file...
Sep 19 08:23:03 phslxnagios1 ndo2db: mysql_error: 'Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed'

1. Linux Distribution and version? Red Hat Enterprise Linux Server release 6.7 (Santiago)
2. 64-Bit ( 2.6.32-573.18.1.el6.x86_64 #1 SMP Wed Jan 6 11:20:49 EST 2016 x86_64 x86_64 x86_64 GNU/Linux )
3. Manual Install of XI
4. No Gnome installed, no proxy, no SSL
5. NagiosXI 5.2.9

I ran
# service mysqld stop
# Stopping mysqld: [ OK ]
# /usr/local/nagiosxi/scripts/repairmysql.sh Nagios
mysqld is stopped
DATABASE: nagios
TABLE:
/var/lib/mysql/nagios /usr/local
Stopping mysqld: [ OK ]

---------
- recovering (with sort) MyISAM-table 'nagios_contactnotificationmethods.MYI'
Data records: 3938360
- Fixing index 1

28821000
28822000
28823000
/usr/local/nagiosxi/scripts/repairmysql.sh: line 59: 11735 Segmentation fault (core dumped) $cmd $t --sort_buffer_size=256M
Timeout error occurred trying to start MySQL Daemon.
Starting mysqld: [FAILED]

Please advise…
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Segmentation Fault from running repairmysql.sh

Post by tmcdonald »

Very interesting. Can you PM me the core dump? Refer to this article if you need assistance finding it:

http://stackoverflow.com/questions/2065 ... -directory

Unfortunately this is a segfault in myisamchk, which we do not develop, so the best we can do is check version compatibility and see if you need to upgrade/downgrade anything.
Former Nagios employee
NetNeutron
Posts: 36
Joined: Thu Aug 25, 2016 12:49 pm

Re: Segmentation Fault from running repairmysql.sh

Post by NetNeutron »

Unfortunately I cannot as a NagiosXI newbie I guess...
We are sorry, but you are not authorised to use this feature. You may have just registered here and may need to participate more to be able to use this feature.
G.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Segmentation Fault from running repairmysql.sh

Post by tmcdonald »

Ahh, right. Now that you have two posts it should allow you through :)

Update: File received and placed in shared drive
Former Nagios employee
NetNeutron
Posts: 36
Joined: Thu Aug 25, 2016 12:49 pm

Re: Segmentation Fault from running repairmysql.sh

Post by NetNeutron »

Update :
What was happening is that the /var/log/messages file was filling up the disk were the MySQL is on.
So when I tried to run repairmysql.sh Nagios it crashed with the Segmentation Fault.
So I brought everthing down.
Moved the /var/lib/mysql to another disk/directory and linked it back to the original directory.
Then I was able to run the repairmysql successfully.

I also set the logrotate.conf file to weekly.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Segmentation Fault from running repairmysql.sh

Post by tmcdonald »

Ahh, glad to hear it! Sorry for the lack of response, a segfault in mysql utilities is all three of:

1.) Difficult to track down/replicate
2.) Pretty far out of scope
3.) Very interesting, which somewhat overrides #2 above

Just for curiosity's sake, what version of myisamchk are you running? myisamchk --version should do it. It might be worth mentioning this to the MySQL folks if this is not already a known/fixed issue.
Former Nagios employee
NetNeutron
Posts: 36
Joined: Thu Aug 25, 2016 12:49 pm

Re: Segmentation Fault from running repairmysql.sh

Post by NetNeutron »

This is what I have for the version.

# myisamchk --version
myisamchk Ver 2.7 for redhat-linux-gnu at x86_64
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Segmentation Fault from running repairmysql.sh

Post by tmcdonald »

Hmm, found another instance of this but no version was mentioned:

https://support.nagios.com/forum/viewto ... 16#p107371

At any rate, glad it has been resolved. Mind if I lock this up? I'll have our KB updated with this info for future reference.
Former Nagios employee
Locked