Table './zm/Events' is marked as crashed and should be...

Support and queries relating to all previous versions of ZoneMinder
Locked
User avatar
Lee Sharp
Posts: 1069
Joined: Sat Mar 31, 2007 9:18 pm
Location: Houston, TX

Table './zm/Events' is marked as crashed and should be...

Post by Lee Sharp »

I woke up to a new console...
I tried the Wiki http://www.zoneminder.com/wiki/index.ph ... atabase.3F and a few others... 'mysqlcheck --all-databases --auto-repair' and a few reboots. No luck. Any hints?

Console

Code: Select all

Table './zm/Events' is marked as crashed and should be repaired
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 81

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 82

Warning: array_merge() [function.array-merge]: Argument #3 is not an array in /usr/share/zoneminder/zm_html_view_console.php on line 91
Table './zm/Events' is marked as crashed and should be repaired
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 81

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 82

Warning: array_merge() [function.array-merge]: Argument #3 is not an array in /usr/share/zoneminder/zm_html_view_console.php on line 91
Table './zm/Events' is marked as crashed and should be repaired
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 81

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 82

Warning: array_merge() [function.array-merge]: Argument #3 is not an array in /usr/share/zoneminder/zm_html_view_console.php on line 91
Table './zm/Events' is marked as crashed and should be repaired
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 81

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 82

Warning: array_merge() [function.array-merge]: Argument #3 is not an array in /usr/share/zoneminder/zm_html_view_console.php on line 91
Table './zm/Events' is marked as crashed and should be repaired
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 81

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 82

Warning: array_merge() [function.array-merge]: Argument #3 is not an array in /usr/share/zoneminder/zm_html_view_console.php on line 91
Table './zm/Events' is marked as crashed and should be repaired
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 81

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 82

Warning: array_merge() [function.array-merge]: Argument #3 is not an array in /usr/share/zoneminder/zm_html_view_console.php on line 91
Table './zm/Events' is marked as crashed and should be repaired
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 81

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 82

Warning: array_merge() [function.array-merge]: Argument #3 is not an array in /usr/share/zoneminder/zm_html_view_console.php on line 91
Table './zm/Events' is marked as crashed and should be repaired
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 81

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 82

Warning: array_merge() [function.array-merge]: Argument #3 is not an array in /usr/share/zoneminder/zm_html_view_console.php on line 91
Table './zm/Events' is marked as crashed and should be repaired
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 81

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 82

Warning: array_merge() [function.array-merge]: Argument #3 is not an array in /usr/share/zoneminder/zm_html_view_console.php on line 91
Table './zm/Events' is marked as crashed and should be repaired
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 81

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 82

Warning: array_merge() [function.array-merge]: Argument #3 is not an array in /usr/share/zoneminder/zm_html_view_console.php on line 91
Table './zm/Events' is marked as crashed and should be repaired
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 81

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /usr/share/zoneminder/zm_html_view_console.php on line 82

Warning: array_merge() [function.array-merge]: Argument #3 is not an array in /usr/share/zoneminder/zm_html_view_console.php on line 91
/var/log/messages

Code: Select all

Jun 19 14:34:02 neteye zmc_dvideo1[5406]: WAR [Buffer overrun at index 12, slow down capture, speed up analysis or increase ring buffer size]
Jun 19 14:34:03 neteye zmc_dvideo0[5400]: WAR [Buffer overrun at index 31, slow down capture, speed up analysis or increase ring buffer size]
Jun 19 14:34:05 neteye zmc_dvideo1[5406]: WAR [Buffer overrun at index 24, slow down capture, speed up analysis or increase ring buffer size]
Jun 19 14:34:14 neteye zmc_dvideo1[5406]: WAR [Buffer overrun at index 12, slow down capture, speed up analysis or increase ring buffer size]
Jun 19 14:34:15 neteye zmc_dvideo0[5400]: WAR [Buffer overrun at index 31, slow down capture, speed up analysis or increase ring buffer size]
Jun 19 14:34:17 neteye zmc_dvideo1[5406]: WAR [Buffer overrun at index 24, slow down capture, speed up analysis or increase ring buffer size]
Jun 19 14:34:26 neteye zmc_dvideo1[5406]: WAR [Buffer overrun at index 12, slow down capture, speed up analysis or increase ring buffer size]
Jun 19 14:34:27 neteye zmc_dvideo0[5400]: WAR [Buffer overrun at index 31, slow down capture, speed up analysis or increase ring buffer size]
Jun 19 14:34:29 neteye zmc_dvideo1[5406]: WAR [Buffer overrun at index 24, slow down capture, speed up analysis or increase ring buffer size]
Jun 19 14:34:30 neteye zma_m5[5747]: INF [Office: 1000 - Processing at 3.37 fps]
sysop@neteye:/var/log$ tail messages
Jun 19 14:39:06 neteye zmc_dvideo1[5406]: WAR [Buffer overrun at index 24, slow down capture, speed up analysis or increase ring buffer size]
Jun 19 14:39:13 neteye zmc_dvideo0[5400]: WAR [Buffer overrun at index 21, slow down capture, speed up analysis or increase ring buffer size]
Jun 19 14:39:14 neteye zmc_dvideo1[5406]: WAR [Buffer overrun at index 11, slow down capture, speed up analysis or increase ring buffer size]
Jun 19 14:39:15 neteye zmc_dvideo0[5400]: WAR [Buffer overrun at index 29, slow down capture, speed up analysis or increase ring buffer size]
Jun 19 14:39:18 neteye zmc_dvideo1[5406]: WAR [Buffer overrun at index 24, slow down capture, speed up analysis or increase ring buffer size]
Jun 19 14:39:21 neteye zmdc[5378]: INF [Starting pending process, zma -m 5] 
Jun 19 14:39:21 neteye zmdc[5863]: INF ['zma -m 5' started at 07/06/19 14:39:21] 
Jun 19 14:39:21 neteye zmdc[5378]: INF ['zma -m 5' starting at 07/06/19 14:39:21, pid = 5863] 
Jun 19 14:39:21 neteye zma_m5[5863]: INF [Debug Level = 0, Debug Log = <none>]
Jun 19 14:39:21 neteye zma_m5[5863]: INF [In mode 3/1, warming up]
sysop@neteye:/var/log$ 
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Did you stop the data base and try the other method I have posted in the wiki?

If that fails as well, You are welcome to PM me ssh info, and I can most likily fix it, Just if it goes beyond those simple fixes, it usualy gets pretty involved so no simple how to other than lots of reading on the mysql site to understand whats really going on and how to fix.
User avatar
Lee Sharp
Posts: 1069
Joined: Sat Mar 31, 2007 9:18 pm
Location: Houston, TX

Post by Lee Sharp »

Yes, I tried both things in the Wiki. You will have a PM in 5... However, I would love to know what happened, and what you did. I am all about learn'in and stuff. :)
nelsda
Posts: 11
Joined: Mon Feb 12, 2007 5:18 am
Location: Kelso, WA, USA

Post by nelsda »

I had the same thing start happening yesterday too. What did you discover? Maybe I can fix my system too. Unfortunately in trying to figure what went wrong I went to the Zones screen and resaved the zones on one of my cameras and now I get an error that ./zm/Frames is marked as crashed and should be fixed. Any Ideas on this one?

Thank you,

David
User avatar
Lee Sharp
Posts: 1069
Joined: Sat Mar 31, 2007 9:18 pm
Location: Houston, TX

Post by Lee Sharp »

One thing I discovered is that Cordel is awesome! He fixed it in no time. This is from our off line discussion...
Unable to use the database repair tool myisamchk

Code: Select all

 myisamchk --force --update-state -O key_buffer=64M -O sort_buffer=64M -O read_buffer=1M -O write_buffer=1M /var/lib/mysql/zm/*.MYI
myisamchk: error: File '/var/lib/mysql/zm/*.MYI' doesn't exist
I managed to get around it. by executing directly in the database repair table Events.

You should be good to go.
When I asked how he did that, he replied with,
From this chapter at mysql:
http://dev.mysql.com/doc/refman/5.0/en/ ... e-sql.html
Analysis showed the the index was off, but for the most part everything else was okay in zm.Events. So I ran a repair table Events from within the database.
The man is good!
jerji
Posts: 13
Joined: Mon Jan 15, 2007 3:29 am
Location: Canberra, Australia

Post by jerji »

OK looks like I am next in line for the problem. Have tried the recommended actions and YES with the database closed. I even tried to repair the events table from within the database - no joy.

Can I take you up on the offer of a PM to look at the system?
User avatar
Lee Sharp
Posts: 1069
Joined: Sat Mar 31, 2007 9:18 pm
Location: Houston, TX

Post by Lee Sharp »

There is something going on with the posted command line instructions and Debian. I have been looking into it, but not found an answer yet. So to fix it, install phpmyadmin. Then stop ZM, and use phpmyadmin to check and repair the database. You should actually only need to repair the tables marked 'in use' when ZM is stopped, but I do a full check, and repair. Then for security remove, or otherwise disable phpmyadmin.
jerji
Posts: 13
Joined: Mon Jan 15, 2007 3:29 am
Location: Canberra, Australia

Fixed :-)

Post by jerji »

Lee,

Thanks for the info. The process worked like a charm and I am back on deck. For what it is worth the message when I ran the repair was "Number of rows changed from 456918 to 456920". Not sure if it helps with any debugging.

For the newbies...

I am using Ubuntu 7.05 server.
  • Using the web interface stop zm
    SSH into your server...
    My commands were:

    Code: Select all

    sudo apt-get install phpmyadmin
    Add the password and watch it install.
    Open a web browser and go to http://your.server.ip.address/phpmyadmin
    I suggest you go in as root
    If you have a password (and you should) enter it else leave it blank
    On the left select the zm database
    bottom of screen

    Code: Select all

    Check all
    Drop down box (says "With selected") change to "Repair Table"
    Wait for it to do its stuff
    Now go back into your web interface for zm and select and delete all events (I have six cameras so it took a bit). This gets rid of broken links.
    Make sure zm is started again...
Job Done! :wink:

Smiles all round :D

Thanks again

Jerji
cyrulution
Posts: 52
Joined: Sat Jul 28, 2007 12:27 pm
Location: Kinzweiler, Germany and Beith, Scotland

Re: Fixed :-)

Post by cyrulution »

jerji wrote: Job Done! :wink:

Smiles all round :D

Thanks again

Jerji
Thank you so much!
Your advice was easily to follow!

You saved my Computer as well! :) :) :)
Cyrus
Serenity is not freedom from storm; it's peace within the storm
User avatar
Lee Sharp
Posts: 1069
Joined: Sat Mar 31, 2007 9:18 pm
Location: Houston, TX

Re: Fixed :-)

Post by Lee Sharp »

cyrulution wrote:Thank you so much!
Your advice was easily to follow!

You saved my Computer as well! :) :) :)
Cyrus
I post the solution and he gets the thanks? That's it. I'm outta here! :lol:

For the record, I have seen about 6 of these crashed tables. Almost all of them seem to coincide with a unscheduled reboot. Only 2 were from an unknown cause. Right now I have 6 ZM machines on Ubuntu running. 1 Edgy, and the rest Feisty 32bit. I also do not delete the old events. The broken links leave soon enough on there own. :)
jerji
Posts: 13
Joined: Mon Jan 15, 2007 3:29 am
Location: Canberra, Australia

zm/events and reboot

Post by jerji »

Hi Lee,

I was not trying to steal your kudos :oops:

You might be onto something with the unscheduled reboot. I had a power failure that took out the server at the remote site (and yes I went out and bought a bigger UPS). Maybe the system was in the middle of writing to the database and something may have got out of sync on the reboot.

Jerji
User avatar
Lee Sharp
Posts: 1069
Joined: Sat Mar 31, 2007 9:18 pm
Location: Houston, TX

Post by Lee Sharp »

It is a security camera. It is always writing to the database. :)
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Re: zm/events and reboot

Post by cordel »

jerji wrote:You might be onto something with the unscheduled reboot. I had a power failure that took out the server at the remote site (and yes I went out and bought a bigger UPS). Maybe the system was in the middle of writing to the database and something may have got out of sync on the reboot.

Jerji
This is the number two culprit, with the first being a system lockup. You are absolutely correct in if there is a transaction in progress when the system goes down, the tables involved will still be marked as open, thus showing that there is a potential error in the table and it is locked since the sever thinks a process is still using the table.
cyrulution
Posts: 52
Joined: Sat Jul 28, 2007 12:27 pm
Location: Kinzweiler, Germany and Beith, Scotland

Re: Fixed :-)

Post by cyrulution »

Lee Sharp wrote:
cyrulution wrote:Thank you so much!
Your advice was easily to follow!

You saved my Computer as well! :) :) :)
Cyrus
I post the solution and he gets the thanks? That's it. I'm outta here! :lol:
Sorry Lee!
I made a wrong quote!
At least he was praising you.

Cyrus :oops:
Serenity is not freedom from storm; it's peace within the storm
Locked