Page 1 of 1
Table 'Monitors' is read only
Posted: Wed Feb 08, 2006 12:08 am
by gessel
Odd error. I'm logged in as admin. It worked fine for quite some time. I haven't spent a lot of time debugging, but if there's an easy answer it would save me time.
I can't change the state of Zone minder (from stopped to start for example) or change the funciton of the cameras because "Table 'Monitors' is read only"
-David
Posted: Wed Feb 08, 2006 3:26 pm
by zoneminder
Do you have any wierd permissions on the actual database files? Or is the table locked for update by something else that might be running? You can have mysql read-only tables but I think you have to specifically generate them.
Posted: Wed Feb 08, 2006 5:17 pm
by gessel
Not that I'm aware of. I didn't change any of the database permissions and I tried rebooting which in theory should have released any rogue applications.
There's nothing much in the log files either...
It is possible the machine was compromised by someone mischevious, but there are none of the usual signs (missing log files, odd file entries, etc.)
-David
Posted: Wed Feb 08, 2006 7:09 pm
by cordel
Check the database integrity. Sounds like something might have gotten corrupted.
first you can try:
Code: Select all
mysqlcheck --all-databases --auto-repair -ppassword -u user
and If that can't repair everything then stop zm and mysql and run:
Code: Select all
myisamchk --silent --force --fast --update-state -O key_buffer=64M \
-O sort_buffer=64M -O read_buffer=1M -O write_buffer=1M \
/var/lib/mysql/*/*.MYI
Corey
fixed - bad blocks
Posted: Mon Feb 27, 2006 6:28 am
by gessel
After much futzing it became apparent that this was a hardware problem with the /var partition. As this is mounted as /dev/hda6, what I needed to do was fsck it in a fairly agressive way to get the blocks mapped out and any thus broken files remapped. Fortunately nothing critical seems to have been hosed.
unmounts the drive
Code: Select all
e2fsck -c -c -D -f -F -k -v -y /dev/hda6
does a non-destructive read/write and found 27 bad blocks (total, most probably on the OEM table, but reverified).
-p found errors, but they were a bit too serious to fix in "not likely to hose" mode. There is some risk of totally hosing your drive, so backup first.[/code]
Posted: Thu Jan 18, 2007 10:36 am
by jameswilson
having probs myself
tried the usual
Code: Select all
Stopping ZoneMinder: [ OK ]
[root@id1461 ~]# myisamchk --silent --force --fast --update-state -O key_buffer= 64M \
> -O sort_buffer=64M -O read_buffer=1M -O write_buffer=1M \
> /var/lib/mysql/*/*.MYI
myisamchk: MyISAM file /var/lib/mysql/zm/Events.MYI
myisamchk: warning: 1 client is using or hasn't closed the table properly
myisamchk: MyISAM file /var/lib/mysql/zm/Frames.MYI
myisamchk: warning: Table is marked as crashed and last repair failed
myisamchk: warning: Size of indexfile is: 262320128 Should be: 136311808
myisamchk: warning: Size of datafile is: 204207030 Should be: 194865450
myisamchk: error: Can't read indexpage from filepos: -1
myisamchk: Error writing file '/var/lib/mysql/zm/Frames.MYI' (Errcode: 5)
myisamchk: MyISAM file /var/lib/mysql/zm/Frames.MYI
myisamchk: error: 5 when fixing table
im having this too niether ofthe fix commands do fix it
any clues?
helpful
Posted: Fri Jan 19, 2007 5:56 am
by dgessel
In the end, my drive got flaky. I have had a chron job running fsck daily ever since my last post, and haven't had the same problems since. This is not recommended procedure, your mileage may vary, but it is working for me. The server is running headless at the moment, so I can't pull up the command to reference it.
Check df to make sure you're good on space too.
Posted: Fri Jan 19, 2007 4:33 pm
by jameswilson
its not full. that was my first thought!
i have tried running fsck but as i need it to run on md0 i dont know how
thanks anyway. I reakon its had a bad power down, but as mqsql cant repair it self the thing is currently down!
Posted: Tue Jan 23, 2007 10:10 pm
by zoneminder
jameswilson wrote:myisamchk: Error writing file '/var/lib/mysql/zm/Frames.MYI' (Errcode: 5)
This looks like an I/O error so it may be that your disk is on the way out. Any other errors in /var/log/messages? md0 is a RAID partition usually, do you have it striped or mirrored? It may be that you can add in a different disk and rebuild the RAID but I'm afraid I don't know exactly how.
Posted: Wed May 28, 2008 3:55 am
by SlovakJoe
In case it helps anyone else, here's how the above problem worked out for me.
The symptoms in my case were that filters weren't being run. A check of /var/zmdc.log revealed
Code: Select all
05/27/2008 23:27:03.079696 zmdc[22862].INF [Starting pending process, zmaudit.pl -c]
05/27/2008 23:27:03.088442 zmdc[22862].INF ['zmaudit.pl -c' starting at 08/05/27 23:27:03, pid = 23277]
05/27/2008 23:27:05.127264 zmdc[22862].ERR ['zmaudit.pl -c' exited abnormally, exit status 9]
After running
Code: Select all
mysqlcheck --all-databases --auto-repair -ppassword -u user
it output the following
Code: Select all
mysql.columns_priv OK
mysql.db OK
mysql.func OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.proc OK
mysql.procs_priv OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
zm.Config OK
zm.ControlPresets OK
zm.Controls OK
zm.Devices OK
zm.Events OK
zm.Filters OK
zm.Frames OK
zm.Groups OK
zm.MonitorPresets OK
zm.Monitors OK
zm.States OK
zm.Stats
error : Table './zm/Stats' is marked as crashed and should be repaired
zm.TriggersX10 OK
zm.Users OK
zm.ZonePresets OK
zm.Zones OK
Repairing tables
zm.Stats OK
As of the time of this writing I can't be sure if the filter is being run now. It doesn't appear to. After checking with the ZM options via the web interface, it appears the filters should've run by now. I'll keep you all posted.
Posted: Wed May 28, 2008 3:59 am
by cordel
Are you running an old version of ZM. You should think about updating to at least 1.22.3