?DB connection problem - events dont replay

Support and queries relating to all previous versions of ZoneMinder
Locked
pdc124
Posts: 15
Joined: Fri Feb 02, 2007 9:53 am

?DB connection problem - events dont replay

Post by pdc124 »

replaying events is blank.
looking in apache logs I get this
DBI connect('database=zm;host=localhost','zm',...) failed: Lost connection to MySQL server during query at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder/Config.pm line 89
Can't call method "prepare_cached" on an undefined value at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder/Config.pm line 91.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder/Config.pm line 100.
Compilation failed in require at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder.pm line 33.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder.pm line 33.
Compilation failed in require at /usr/bin/zmdc.pl line 50.
BEGIN failed--compilation aborted at /usr/bin/zmdc.pl line 50.
DBI connect('database=zm;host=localhost','zm',...) failed: Lost connection to MySQL server during query at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder/Config.pm line 89
Can't call method "prepare_cached" on an undefined value at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder/Config.pm line 91.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder/Config.pm line 100.
Compilation failed in require at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder.pm line 33.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder.pm line 33.
Compilation failed in require at /usr/bin/zmdc.pl line 50.
BEGIN failed--compilation aborted at /usr/bin/zmdc.pl line 50.
[Fri Feb 16 18:54:06 2007] [error] [client 60.216.232.97] script '/var/www/localhost/htdocs/proxygrade.php' not found or unable to stat, referer: http://www.proxygrade.com/proxygrade.ph ... 3698723D3E
DBI connect('database=zm;host=localhost','zm',...) failed: Lost connection to MySQL server during query at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder/Config.pm line 89
Can't call method "prepare_cached" on an undefined value at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder/Config.pm line 91.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder/Config.pm line 100.
Compilation failed in require at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder.pm line 33.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder.pm line 33.
Compilation failed in require at /usr/bin/zmdc.pl line 50.
BEGIN failed--compilation aborted at /usr/bin/zmdc.pl line 50.
jpegtopnm: Unable to open file 'events/1/1/001-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/1/002-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/1/003-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/1/004-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/1/005-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/1/006-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/1/007-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/1/008-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/1/009-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/1/010-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/1/011-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/1/012-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/1/013-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/1/014-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/1/015-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/1/016-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/4/001-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/4/002-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/4/003-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/4/004-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/4/005-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/4/006-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/4/007-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/4/008-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/4/009-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/4/010-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/4/011-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/4/012-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/4/013-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/4/014-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/4/015-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
jpegtopnm: Unable to open file 'events/1/4/016-capture.jpg' for reading. fopen() returns errno 2 (No such file or directory)
pnmscalefixed: Error reading magic number from Netpbm imabut ge stream. Most often, this means your input file is empty.
pnmtojpeg: Error reading magic number from Netpbm image stream. Most often, this means your input file is empty.
It looks to me ( but ive no idea what im doing really ) that its not connecting to the database .

But I can connect to the database 'manually' with the details in etc/zm.conf (this is a gentoo install);

How to debug it ?
chickcam apache2 # mysql -u zm -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 30188 to server version: 5.0.26-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use zm;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables ;
+----------------+
| Tables_in_zm |
+----------------+
| Config |
| ControlPresets |
| Controls |
| Devices |
| Events |
| Filters |
| Frames |
| Groups |
| MonitorPresets |
| Monitors |
| States |
| Stats |
| TriggersX10 |
| Users |
| ZonePresets |
| Zones |
+----------------+
16 rows in set (0.00 sec)

mysql> [/code]
[/code]
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Okay so what does your mysql log have to say?
pdc124
Posts: 15
Joined: Fri Feb 02, 2007 9:53 am

Post by pdc124 »

mysql installed with gentoo defaults

Code: Select all

070217 15:33:43  InnoDB: Starting shutdown...
070217 15:33:45  InnoDB: Shutdown completed; log sequence number 0 43655
070217 15:33:45 [Note] /usr/sbin/mysqld: Shutdown complete

070217 15:33:48 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=chickcam-bin' to avoid this problem.
070217 15:33:54  InnoDB: Started; log sequence number 0 43655
070217 15:33:56 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.0.26-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Gentoo Linux mysql-5.0.26-r2
chickcam mysql # ps -A |grep my
 1747 ?        00:00:02 mysqld
 1768 ?        00:00:00 mysqld
 1769 ?        00:00:00 mysqld
 1770 ?        00:00:00 mysqld
 1771 ?        00:00:00 mysqld
 1772 ?        00:00:00 mysqld
 1805 ?        00:00:00 mysqld
 1806 ?        00:00:00 mysqld
 1808 ?        00:00:00 mysqld
 1813 ?        00:00:00 mysqld
 1828 ?        00:00:00 mysqld
 1848 ?        00:00:00 mysqld
 1849 ?        00:00:00 mysqld
 1850 ?        00:00:00 mysqld
 1855 ?        00:00:00 mysqld
 1858 ?        00:00:00 mysqld
 1859 ?        00:00:00 mysqld
chickcam mysql # ls -la  /var/www/localhost/htdocs/zm/images/
total 8
drwxrwxrwx 2 apache apache 4096 Feb 17 15:25 .
drwxr-xr-x 8 root   root   4096 Feb 16 22:12 ..
-rw-r--r-- 1 apache apache    0 Feb 17 13:30 28-001-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 13:30 28-002-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 13:30 28-003-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 13:30 28-004-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 13:30 28-005-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 13:30 28-006-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 13:30 28-007-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 13:30 28-008-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 13:30 28-009-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 13:30 28-010-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 13:30 28-011-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 13:30 28-012-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 13:30 28-013-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 13:30 28-014-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 13:30 28-015-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 13:30 28-016-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 15:40 29-001-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 15:40 29-002-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 15:40 29-003-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 15:40 29-004-capture-25.jpg
-rw-r--r-- 1 apache apache    0 Feb 17 15:40 29-005-capture-25.jpg
                    
   
Ive got data in the events table of mysql which is read to produce the 'events' page but clicking on a link gives nothing on playback and 'stills' give a series of empty images ( and i assume poduces these files )

and Ive turned on logging in Mysql

opening events page
chickcam mysql # tail -f /var/log/mysql/mysql_queries.log
/usr/sbin/mysqld, Version: 5.0.26-log. started with:
Tcp port: 3306 Unix socket: /var/run/mysqld/mysqld.sock
Time Id Command Argument
070217 16:43:04 1 Connect zm@localhost on
1 Init DB zm
1 Query select * from Config order by Id asc
070217 16:43:09 2 Connect zm@localhost on
2 Init DB zm
2 Query select * from Config order by Id asc
070217 16:43:11 2 Query select count(E.Id) as EventCount from Monitors as M inner join Events as E on (M.Id = E.MonitorId) where 1 and ( E.MonitorId = 1 and E.Archived = 0 )
2 Query select E.Id,E.MonitorId,M.Name As MonitorName,M.Width,M.Height,M.DefaultScale,E.Name,E.Cause,E.StartTime,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived,E.LearnState from Monitors as M inner join Events as E on (M.Id = E.MonitorId) where 1 and ( E.MonitorId = 1 and E.Archived = 0 ) order by E.StartTime asc limit 0, 25
choose an event and view
070217 16:44:40 3 Connect zm@localhost on
3 Init DB zm
3 Query select * from Config order by Id a sc
070217 16:44:43 3 Query select E.*,M.Name as MonitorName,M .Width,M.Height,M.DefaultRate,M.DefaultScale from Events as E inner jo in Monitors as M on E.MonitorId = M.Id where E.Id = '31'
3 Query select E.* from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.StartTime <= '2007-02 -17 16:17:59' and ( E.Id in (31) ) order by E.StartTime desc
3 Query select E.* from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.StartTime >= '2007-02 -17 16:17:59' and ( E.Id in (31) ) order by E.StartTime asc
3 Query select max(Delta)-min(Delta) as Du ration from Frames where EventId = '31'
070217 16:44:44 4 Connect zm@localhost on
4 Init DB zm
4 Query select Name, Value, Type from Conf ig order by Id
4 Query select M.Id, M.Name, E.Frames, max (F.Delta)-min(F.Delta) as Duration from Events as E inner join Monitor s as M on E.MonitorId = M.Id inner join Frames as F on E.Id = F.EventI d where E.Id = 31 group by E.Id
4 Query select FrameId, EventId, Delta fro m Frames where EventId = 31 and FrameId >= 1 order by FrameId
collinm
Posts: 23
Joined: Thu Aug 31, 2006 1:10 am

Post by collinm »

maybe your hd is full?
pdc124
Posts: 15
Joined: Fri Feb 02, 2007 9:53 am

Post by pdc124 »

not full . ~750 K left
Is there a minimum empty space thats necessary ?
Iv


Ive assumed ( an very little knowledge) its to do with processing the graphics files
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

In a console run df and give us the results along with how you installed zm on those partitions would be helpful. 750k is not much room.
pdc124
Posts: 15
Joined: Fri Feb 02, 2007 9:53 am

Post by pdc124 »

Code: Select all

chickcam ~ # df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda3              2829624   2117960    567924  79% /
udev                     59300       160     59140   1% /dev
/dev/hda1                35104      6312     26980  19% /boot
none                     59300         0     59300   0% /dev/shm
chickcam ~ #                 
gentoo linux . Default ebuild installation
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

With that drive it would be a good idea to leave ~10% free for other processes. If the drive had filled up there could be errors that corrupted the database due to it halting from lack of space.
pdc124
Posts: 15
Joined: Fri Feb 02, 2007 9:53 am

Post by pdc124 »

id like to try and get the image replya working - I dont envisage storing a large amount of data ( or if i did I'd move the DB to another machine)

Does this disk space explain the lack of images ?
Locked