Bizarre problem involving a refusal to write images/events

Forum for questions and support relating to the 1.24.x releases only.
Jim March
Posts: 88
Joined: Thu Oct 04, 2007 8:31 am

Bizarre problem involving a refusal to write images/events

Post by Jim March »

Folks,

After much wailing and gnashing of teeth, I gave up on compiling my own setup and switched to the Bluecherry Livecd 2.0 beta. This is an XUbuntu-based livecd with ZM 1.24.

Everything is working a hell of a lot better - I can see video from the cameras at least. But it's refusing to write any data.

I'm booting and loading apps from a 250gig Ext3 partition and I have a 500gig ReiserFS partition for data, automounting correctly at /media/disk

Permissions are set to allow everybody to write to it. On that disk I have /events and /images directories, also with universal-write permissions. This system is just being used for Zoneminder, so that's fine.

At /media/disk/events ZM or "something" has created directories titled "4" and "Cam1". But there's nothing in them (and yeah, I tried turning hidden file view "on"). Zoneminder itself says there's hundreds of "events" but with no data in them.

OK...so I check the Apache event log, and I get:
[Sat Jun 27 19:05:26 2009] [notice] Apache/2.2.9 (Ubuntu) PHP/5.2.6-2ubuntu4.2 with Suhosin-Patch configured -- resuming normal operations
df: `media/disk/events': No such file or directory
df: no file systems processed

[Sat Jun 27 19:08:22 2009] [error] [client 127.0.0.1] Codec for stream 0 does not use global headers but container format requires global headers, referer: http://localhost/?view=watch&mid=1
[Sat Jun 27 19:08:22 2009] [error] [client 127.0.0.1] Codec for stream 0 does not use global headers but container format requires global headers, referer: http://localhost/?view=watch&mid=1
[Sat Jun 27 19:08:23 2009] [error] [client 127.0.0.1] socket_sendto() failed: Connection refused, referer: http://localhost/?view=watch&mid=1
[Sat Jun 27 19:08:23 2009] [error] [client 127.0.0.1] Codec for stream 0 does not use global headers but container format requires global headers
df: `media/disk/events': No such file or directory
df: no file systems processed

[Sat Jun 27 19:12:11 2009] [error] [client 127.0.0.1] socket_sendto() failed: No such file or directory, referer: http://localhost/index.php?view=watch&mid=1
[Sat Jun 27 19:12:12 2009] [error] [client 127.0.0.1] socket_bind() failed: Address already in use, referer: http://localhost/index.php?view=watch&mid=1
[Sat Jun 27 19:12:12 2009] [error] [client 127.0.0.1] socket_bind() failed: Address already in use, referer: http://localhost/index.php?view=watch&mid=1
df: `media/disk/events': No such file or directory
df: no file systems processed

[Sat Jun 27 19:17:28 2009] [error] [client 127.0.0.1] socket_sendto() failed: No such file or directory, referer: http://localhost/index.php?view=watch&mid=1
df: `media/disk/events': No such file or directory
df: no file systems processed
df: `media/disk/events': No such file or directory
df: no file systems processed
df: `media/disk/events': No such file or directory
df: no file systems processed

[Sat Jun 27 19:28:55 2009] [error] [client 127.0.0.1] socket_sendto() failed: No such file or directory, referer: http://localhost/?view=event&eid=12&fil ... c=1&page=1
Obvious problem is in bold.

I see nothing at /var/log/messages or /var/log/dmesg worth noting.

Obviously, under Zoneminder's "Options>Paths>ZM_DIR_EVENTS" I have "media/disk/events", similar for "images".

What the heck is going on here? It can't be a permissions problem, can it? Is ZM 1.24 problematic with ReiserFS? Is it possible I need to switch my mount-point and paths? Right now fstab looks like:

Code: Select all

/dev/sdb1	/media/disk reiserfs auto,user,exec,rw 0 2
...for the disk in question, and I can go manually put files at /media/disk/events and /images with no errors.

Heeeelp! Please...

Jim
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

do a
sudo chown -hR www-data:www-data
&
sudo chmod -R 770
on the mount point

then restart zoneminder
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

automounting correctly at /media/disk
also it HIGHLY recomended to mount it via fstab

because it might sometimes mount as disk-1 disk-2 etc
Jim March
Posts: 88
Joined: Thu Oct 04, 2007 8:31 am

Post by Jim March »

Ummm...I've shown you the FSTAB entry I'm doing for this drive.

I'll try everything else tomorrow though. Thanks.
jhetrick62
Posts: 24
Joined: Thu Jun 04, 2009 2:43 am

Post by jhetrick62 »

I found in my installation where I wanted to store the files on a drive mounted at /storage which is actually /dev/sdb1, you had to install symlinks in the original file locations and reset the zoneminder file locations back to the original /images /events. So I placed links in there to point to my current /storage/zoneminder/events, ect.

That was the only way it worked. I also had to modify the export file to handle this slightly or file exports did not work.

I do however have an issue with ffmpeg not being able to write to that partition it appears (still trouble shooting this). In my next installation, I plan on just building the Ubuntu installation with /var pointed to a large drive all of it's own to see if these problems go away by themselves, rather than creating a custom storage location.

Jeff
Jim March
Posts: 88
Joined: Thu Oct 04, 2007 8:31 am

Post by Jim March »

Well this command doesn't work:

sudo chown -hR www-data:www-data

Can anybody tell me what he was trying to do?

>> I found in my installation where I wanted to store the files on a drive mounted at /storage which is actually /dev/sdb1, you had to install symlinks in the original file locations and reset the zoneminder file locations back to the original /images /events. So I placed links in there to point to my current /storage/zoneminder/events, ect.<<

I've never even done symlinks before but my google-fu is strong. I'll figure it out.

Of course, since you didn't mention what the original locations WERE, I'll have to reboot with the LiveCD, write 'em down, reboot...sigh.

>>That was the only way it worked. I also had to modify the export file to handle this slightly or file exports did not work.<<

I have no idea at ALL what that sentence above means. Any clues?

>> I do however have an issue with ffmpeg not being able to write to that partition it appears (still trouble shooting this). In my next installation, I plan on just building the Ubuntu installation with /var pointed to a large drive all of it's own to see if these problems go away by themselves, rather than creating a custom storage location.<<

Sigh.
jhetrick62
Posts: 24
Joined: Thu Jun 04, 2009 2:43 am

Post by jhetrick62 »

I'm running mine on Ubuntu so if bluecherry is based on that, your files should be found at /var/cache/zoneminder then the subdirectories should be events, images and temp.

a symlink to a location such as mine where I put the files on /storage/zoneminder would look like this:
sudo ln -s /storage/zoneminder/events

This should create a link that reads like this upon an ls -l of the directory:
events > /storage/zoneminder/events

This tells the system when it looks to write in the location /var/cache/zoneminder/events to instead place the file in the other directory. This should work if v 1.24 files are stored in the same location as 1.22.3 which I'm using. Then the file location settings in zm options should be set to /events.

Jeff
Jim March
Posts: 88
Joined: Thu Oct 04, 2007 8:31 am

Post by Jim March »

OK, let's use the actual locations I'm dealing with. We'll do "events" only.

By default, the Bluecherry setup stores to:

/var/www/events

I need to save it to:

/media/disk/events

From everything I've read on symlinks, the syntax:

sudo ln -s /media/disk/events

...is invalid. But I just tried it, I'm going to reboot and see what happens. Be right back...
Jim March
Posts: 88
Joined: Thu Oct 04, 2007 8:31 am

Post by Jim March »

Yeah, like I thought, that doesn't work at all. Stands to reason: how would it know "events" is linked to "/media/disk/events"?

OK. Please, can you provide working syntax based on the directories actually involved?
Jim March
Posts: 88
Joined: Thu Oct 04, 2007 8:31 am

Post by Jim March »

WAIT: in the syntax you used, did you change directory over to where the "events" symlink needs to be?
jhetrick62
Posts: 24
Joined: Thu Jun 04, 2009 2:43 am

Post by jhetrick62 »

Yes, cd to /var/www first.
Jim March
Posts: 88
Joined: Thu Oct 04, 2007 8:31 am

Post by Jim March »

Why not say so?

For that matter, why not believe me when I tell you what directories I'm seeing on my actual system?

SIGH. Sorry...it's just, this is driving me slowly insane. NOBODY wants to give exact working syntax around here for some reason.
Jim March
Posts: 88
Joined: Thu Oct 04, 2007 8:31 am

Post by Jim March »

Looks like it's fixed. For those googling later, symlinks are NOT THE ANSWER, at least not as stated above. Every reference to symlinks above, esp. the syntax, is a garbled mess guaranteed not to work.

What worked was transferring everything at /var/www over to the external disk, empty the /var/www directory out completely and then alter fstab to mount the external disk at /var/www like so:

/dev/sdb1 /var/www reiserfs auto,user,exec,rw 0 2

...where it used to be:

/dev/sdb1 /media/disk reiserfs auto,user,exec,rw 0 2

In addition, set the permissions of the blank directory at /var/www with the following two ACTUAL commands:

sudo chown -hR www-data /var/www

sudo chmod -R 770 /var/www


These are the actual commands "kingofkya" above tried to get across, but in mangled fashion because he's drunk or something.

Sigh.

Look, fried syntax and garbled instructions are a chronic problem on this forum and related to zoneminder in general. As one horrific example, all of the "compile it yourself" instructions in the wiki fail miserably.

The zoneminder developers have done a terrible job with documentation and semi-competent folk are trying desperately to fill in the gaps.

Some time in the next week or so, if I have the time I'll try and document using the Bluecherry LiveCD to produce a working system, as I appear to have now.

Much thanks to the guys at the Tucson Free Users Group mailing list for the re-mounting idea as opposed to symlinks.
jhetrick62
Posts: 24
Joined: Thu Jun 04, 2009 2:43 am

Post by jhetrick62 »

Maybe because I answered your post the last 2 times on my BB while driving!

Don't be so un-grateful for real!
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

nope :lol: i was just tired it was like 2:00am when i replied

Maybe because I answered your post the last 2 times on my BB while driving!

Don't be so un-grateful for real!
Good i am note the only one that does we

Edit: the other thing it get old when questions are repeated over and over despite the fact its in the docs or first page of forum search results.(Don't feel bad i did the same thing).
Locked