Export Events problem - creating empty files...
Export Events problem - creating empty files...
v1.24.2, Debian testing.
The data hard drive is dying and I would like to export the archived events before I install a replacement. Either in jpg or video, don't mind.
I select all the archive pics from the filter view, the thumbnails appear and I click 'Export' at the bottom.
I then tick all the boxes in the "Export Options" box and choose Tar as format. Click Export.
I get "Export Succeeded - Download", click download and receive a .tgz file.
Unfortunately, it's empty. Filesize of 54 bytes, just the tgz wrapper with no files inside it.
I've ensured /var/cache/zoneminder/temp is world-writeable, and it's creating two files in there ok;
cradle:/var/cache/zoneminder/temp# ls -l
total 4
-rw-r--r-- 1 www-data www-data 45 2010-08-19 12:12 zmExport.tar.gz
-rw-r--r-- 1 www-data www-data 0 2010-08-19 12:12 zmFileList.txt
But as you can see, zmFileList.txt is empty, suggesting something went wrong before tar and gzip got to work.
Can't find anything useful in the logs.
What have I missed?
(Tested same process on another server running 1.22.3 and that works fine)
The data hard drive is dying and I would like to export the archived events before I install a replacement. Either in jpg or video, don't mind.
I select all the archive pics from the filter view, the thumbnails appear and I click 'Export' at the bottom.
I then tick all the boxes in the "Export Options" box and choose Tar as format. Click Export.
I get "Export Succeeded - Download", click download and receive a .tgz file.
Unfortunately, it's empty. Filesize of 54 bytes, just the tgz wrapper with no files inside it.
I've ensured /var/cache/zoneminder/temp is world-writeable, and it's creating two files in there ok;
cradle:/var/cache/zoneminder/temp# ls -l
total 4
-rw-r--r-- 1 www-data www-data 45 2010-08-19 12:12 zmExport.tar.gz
-rw-r--r-- 1 www-data www-data 0 2010-08-19 12:12 zmFileList.txt
But as you can see, zmFileList.txt is empty, suggesting something went wrong before tar and gzip got to work.
Can't find anything useful in the logs.
What have I missed?
(Tested same process on another server running 1.22.3 and that works fine)
Ahh, found this is apache's error_log
Code: Select all
[Thu Aug 19 12:24:51 2010] [error] [client 10.0.0.242] PHP Warning: array_merge(): Argument #1 is not an array in / usr/share/zoneminder/skins/classic/includes/export_functions.php on line 255, referer: http://10.0.3.10/zm/index.php ?view=export&eids[]=226962&eids[]=226959&eids[]=226955&eids[]=226952&eids[]=224012&eids[]=224010&eids[]=224003&eids[ ]=223999&eids[]=223993&eids[]=220351&eids[]=220341&eids[]=220230&eids[]=220226&eids[]=220220&eids[]=212598&eids[]=21 2572&eids[]=212535&eids[]=212453&eids[]=211699&eids[]=211698&eids[]=211695&eids[]=211696&eids[]=211681&eids[]=211589 &eids[]=211514&eids[]=203878&eids[]=60110&eids[]=60109&eids[]=60103&eids[]=60100&eids[]=60092&eids[]=60088&eids[]=60 083&eids[]=60077&eids[]=60071&eids[]=60061&eids[]=60058&eids[]=60049&eids[]=60052&eids[]=60044&eids[]=60041&eids[]=6 0035&eids[]=43909&eids[]=41838&eids[]=41832&eids[]=34998&eids[]=34730&eids[]=34121&eids[]=30652&eids[]=30645&eids[]= 30634&eids[]=30629&exportFile=undefined&generated=0
The problem is that the behavior of array_merge changed in PHP5. Zoneminder's export function breaks.
The line in question is in /usr/share/zoneminder/skins/classic/includes/export_functions.php
$exportFileList = array_merge( $exportFileList, exportFileList( $eid ), $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc );
Various howtos suggest adding (array) before the variables. I've tried that and it fails for but not being a php coder I'm a bit hit and miss here.
Anyone fancy fixing this line to adhere to the php5 standards?
The line in question is in /usr/share/zoneminder/skins/classic/includes/export_functions.php
$exportFileList = array_merge( $exportFileList, exportFileList( $eid ), $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc );
Various howtos suggest adding (array) before the variables. I've tried that and it fails for but not being a php coder I'm a bit hit and miss here.
Anyone fancy fixing this line to adhere to the php5 standards?
Single event export was broken too - in a different way. I've fixed that by some quick hackery;
Line 161 of /usr/share/zoneminder/skins/classic/includes/export_functions.php
Because /data/ is my zoneminder root path and for some reason this wasn't being prepended by the export function so it couldn't find the files.
After error_log entries of
PHP Warning: opendir(events/6/60109): failed to open dir: No such file or directory in /usr/share/zoneminder/skins/classic/includes/export_functions.php on line 163, referer:
Multiple exports are still broken for me as above, though.
Line 161 of /usr/share/zoneminder/skins/classic/includes/export_functions.php
Code: Select all
$eventPath = getEventPath( $event );
to
$eventPath = '/data/' . getEventPath( $event );
After error_log entries of
PHP Warning: opendir(events/6/60109): failed to open dir: No such file or directory in /usr/share/zoneminder/skins/classic/includes/export_functions.php on line 163, referer:
Multiple exports are still broken for me as above, though.
-
- Posts: 7
- Joined: Sun Nov 27, 2005 11:56 am
Export Failed from Multiple Events Fixed
Hi, I had the same problem and have it fixed. Just modify line 255 from the file zm/skins/classic/includes/export_functions.php from:
$exportFileList = array_merge( $exportFileList, exportFileList( $eid ), $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc );
to:
$exportFileList = array_merge( $exportFileList, exportFileList( $eid , $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc ));
Good luck!
$exportFileList = array_merge( $exportFileList, exportFileList( $eid ), $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc );
to:
$exportFileList = array_merge( $exportFileList, exportFileList( $eid , $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc ));
Good luck!
Re: Export Events problem - creating empty files...
I'm now having this same problem when exporting a single event. The tar file downloads fine but it is empty.
Here is my apache2 error log. Had to remove some paths because the forum thought they were links.
I am checking all of the boxes and selecting tar format in the export window.
Here is my apache2 error log. Had to remove some paths because the forum thought they were links.
Code: Select all
[Tue Jun 07 15:50:08 2011] [error] [client 192.168.57.8] PHP Warning: Missing argument 2 for exportFileList(), called in /usr/share/zoneminder/skins/classic/includes/export_functions.php on line 255 and defined in /usr/share/zoneminder/skins/classic/includes/export_functions.php on line 153, referer: index.php?view=export&eids[]=24
[Tue Jun 07 15:50:08 2011] [error] [client 192.168.57.8] PHP Warning: Missing argument 3 for exportFileList(), called in /usr/share/zoneminder/skins/classic/includes/export_functions.php on line 255 and defined in /usr/share/zoneminder/skins/classic/includes/export_functions.php on line 153, referer: index.php?view=export&eids[]=24
[Tue Jun 07 15:50:08 2011] [error] [client 192.168.57.8] PHP Warning: Missing argument 4 for exportFileList(), called in /usr/share/zoneminder/skins/classic/includes/export_functions.php on line 255 and defined in /usr/share/zoneminder/skins/classic/includes/export_functions.php on line 153, referer: index.php?view=export&eids[]=24
[Tue Jun 07 15:50:08 2011] [error] [client 192.168.57.8] PHP Warning: Missing argument 5 for exportFileList(), called in /usr/share/zoneminder/skins/classic/includes/export_functions.php on line 255 and defined in /usr/share/zoneminder/skins/classic/includes/export_functions.php on line 153, referer: index.php?view=export&eids[]=24
[Tue Jun 07 15:50:08 2011] [error] [client 192.168.57.8] PHP Warning: Missing argument 6 for exportFileList(), called in /usr/share/zoneminder/skins/classic/includes/export_functions.php on line 255 and defined in /usr/share/zoneminder/skins/classic/includes/export_functions.php on line 153, referer: index.php?view=export&eids[]=24
[Tue Jun 07 15:50:08 2011] [error] [client 192.168.57.8] PHP Notice: Undefined variable: exportDetail in /usr/share/zoneminder/skins/classic/includes/export_functions.php on line 178, referer: index.php?view=export&eids[]=24
[Tue Jun 07 15:50:08 2011] [error] [client 192.168.57.8] PHP Notice: Undefined variable: exportFrames in /usr/share/zoneminder/skins/classic/includes/export_functions.php on line 189, referer: index.php?view=export&eids[]=24
[Tue Jun 07 15:50:08 2011] [error] [client 192.168.57.8] PHP Notice: Undefined variable: exportImages in /usr/share/zoneminder/skins/classic/includes/export_functions.php on line 200, referer: index.php?view=export&eids[]=24
[Tue Jun 07 15:50:08 2011] [error] [client 192.168.57.8] PHP Notice: Undefined variable: exportVideo in /usr/share/zoneminder/skins/classic/includes/export_functions.php on line 216, referer: index.php?view=export&eids[]=24
[Tue Jun 07 15:50:08 2011] [error] [client 192.168.57.8] PHP Notice: Undefined variable: exportMisc in /usr/share/zoneminder/skins/classic/includes/export_functions.php on line 232, referer: index.php?view=export&eids[]=24
[Tue Jun 07 15:50:08 2011] [error] [client 192.168.57.8] PHP Warning: array_merge(): Argument #3 is not an array in /usr/share/zoneminder/skins/classic/includes/export_functions.php on line 255, referer: index.php?view=export&eids[]=24
[Tue Jun 07 15:50:08 2011] [error] [client 192.168.57.8] PHP Warning: Invalid argument supplied for foreach() in /usr/share/zoneminder/skins/classic/includes/export_functions.php on line 269, referer: index.php?view=export&eids[]=24
-
- Posts: 678
- Joined: Wed Dec 16, 2009 4:32 pm
- Location: Israel
Re: Export Failed from Multiple Events Fixed
Is this fixed in ZoneMinder 1.24.4?amppjunior wrote:Hi, I had the same problem and have it fixed. Just modify line 255 from the file zm/skins/classic/includes/export_functions.php from:
$exportFileList = array_merge( $exportFileList, exportFileList( $eid ), $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc );
to:
$exportFileList = array_merge( $exportFileList, exportFileList( $eid , $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc ));
Good luck!
mastertheknife
Kfir Itzhak.