Empty zip files uploaded to ftp server
Empty zip files uploaded to ftp server
I have the purgewhenfull filer set to upload events to my ftp server...everything appears to work and but the zip files on the ftp server are empty. Nothing stands out in the logs. I confirmed and reinstalled zip perl module. Any ideas?
-
- Posts: 247
- Joined: Sun Jan 16, 2005 11:26 am
Thanks for the reply. I manually ftp'd files and they show up on the server. I am well below my alloted disk space on the server. I don't see any zip files in /tmp. But I may be looking when there is no filter activity. I'm going to change the archive to tar.gz and see what happens. The filter has both delete and upload options checked...could the filter be deleting the images prior to compressing them?
-
- Posts: 247
- Joined: Sun Jan 16, 2005 11:26 am
Have you tried running zmfilter.pl manually from the command line?
Preferably as the apache web user. This should give you some errors if there aren't any in /tmp/zmfilter.log
Note:if you run manually as root remember to remove or change permissions on the log file etc or it wont run from zoneminder next time due to permissions on the log file.
I'm sure I had this before and it was something silly, but cant remember what it was now.
Is it to do with whether ftp is using passive transfer or not? Try playing about with manually ftping files with various options for passive and the other obscure options, and see if you can reproduce a zero file size at the ftp server.
Preferably as the apache web user. This should give you some errors if there aren't any in /tmp/zmfilter.log
Note:if you run manually as root remember to remove or change permissions on the log file etc or it wont run from zoneminder next time due to permissions on the log file.
I'm sure I had this before and it was something silly, but cant remember what it was now.
Is it to do with whether ftp is using passive transfer or not? Try playing about with manually ftping files with various options for passive and the other obscure options, and see if you can reproduce a zero file size at the ftp server.
Did you find an answer? I have the same problem.
When I use tar as compression it doesn't upload anything (says: [Tar error: Cowardly refusing to create empty archive!]), when i choose zip it uploads 1k empty zip files and when i choose not to use compression it still uploads 1k empty zip files or gives the tar error. Also switching pasive mode has no effect.
zmfilter.log says:
and when I run zmfilter.pm from shell it says:
This is on Debian Lenny running zoneminder 1.23.2-2+lenny1
When I use tar as compression it doesn't upload anything (says: [Tar error: Cowardly refusing to create empty archive!]), when i choose zip it uploads 1k empty zip files and when i choose not to use compression it still uploads 1k empty zip files or gives the tar error. Also switching pasive mode has no effect.
zmfilter.log says:
Code: Select all
05/09/2008 12:31:30.853611 zmfilter[7621].INF [Archiving event 6385]
05/09/2008 12:31:30.854356 zmfilter[7621].INF [Creating upload file '/tmp/Office-cam2-6385.zip']
05/09/2008 12:31:30.854975 zmfilter[7621].INF [Uploading to FTP.SERVER.NAME]
Code: Select all
Net::FTP>>> Net::FTP(2.75)
Net::FTP>>> Exporter(5.58)
Net::FTP>>> Net::Cmd(2.26)
Net::FTP>>> IO::Socket::INET(1.29)
Net::FTP>>> IO::Socket(1.29)
Net::FTP>>> IO::Handle(1.25)
Net::FTP=GLOB(0x8ff3dd8)<<< 220---------- Welcome to Pure-FTPd [TLS] ----------
Net::FTP=GLOB(0x8ff3dd8)<<< 220-You are user number 1 of 50 allowed.
Net::FTP=GLOB(0x8ff3dd8)<<< 220-Local time is now 12:31. Server port: 21.
Net::FTP=GLOB(0x8ff3dd8)<<< 220-This is a private system - No anonymous login
Net::FTP=GLOB(0x8ff3dd8)<<< 220-IPv6 connections are also welcome on this server.
Net::FTP=GLOB(0x8ff3dd8)<<<220>>> user USERNAME
Net::FTP=GLOB(0x8ff3dd8)<<<331>>> PASS ....
Net::FTP=GLOB(0x8ff3dd8)<<< 230-User USERNAME has group access to: GROUPNAME
Net::FTP=GLOB(0x8ff3dd8)<<<230>>> TYPE I
Net::FTP=GLOB(0x8ff3dd8)<<<200>>> CWD /uploads
Net::FTP=GLOB(0x8ff3dd8)<<<250>>> ALLO 22
Net::FTP=GLOB(0x8ff3dd8)<<<200>>> PASV
Net::FTP=GLOB(0x8ff3dd8)<<<227>>> STOR Office-cam1-6385.zip
Net::FTP=GLOB(0x8ff3dd8)<<< 150 Accepted data connection
Net::FTP=GLOB(0x8ff3dd8)<<< 226-File successfully transferred
Net::FTP=GLOB(0x8ff3dd8)<<<226>>> QUIT
Net::FTP=GLOB(0x8ff3dd8)<<< 221-Goodbye. You uploaded 1 and downloaded 0 kbytes.
Net::FTP=GLOB(0x8ff3dd8)<<< 221 Logout.
-
- Posts: 247
- Joined: Sun Jan 16, 2005 11:26 am
-
- Posts: 247
- Joined: Sun Jan 16, 2005 11:26 am
-
- Posts: 247
- Joined: Sun Jan 16, 2005 11:26 am
I'm having the same problem. Zip files are very small, but upload to the ftp site. Tar files get the "Cowardly refusing to create empty archive!" error, so of course ftp doesn't send anything for that file type.
This is without a doubt an incorrect passed path problem.
Is there any way to get a debug file to output the full command line of the tar and/or zip file creation parameters?
Messed with the path options within the options for the ftp page with no success or change in the limited error messages seen.
Thanks!
This is without a doubt an incorrect passed path problem.
Is there any way to get a debug file to output the full command line of the tar and/or zip file creation parameters?
Messed with the path options within the options for the ftp page with no success or change in the limited error messages seen.
Thanks!
Tried to look up the zip file being made in /tmp but that's impossible. Selected a long recording (3 seconds) but what zmfilter.log says is:
so the file is created, uploaded and deleted in almost no time at all.
So I agree with mitch and think it's a path error.
my perl skills are very limited, but dugg around in zmfilter.pl anyway.
around line 716 the zip process is done I think, the info on line 720 is printed in the zmfilter.log, but the info on line 725 is not:
So I guess that the loop is not run:
again my perl skills are very poor so can anyone point out to me if there is an error in those lines?
Code: Select all
05/14/08 08:30:07.341948 zmfilter[1289].INF [Scanning for events using filter '_TempFilter1210746606']
05/14/08 08:30:07.353667 zmfilter[1289].INF [Creating upload file '/tmp/Office-cam1-2466.zip']
05/14/08 08:30:07.354310 zmfilter[1289].INF [Uploading to FTP.SERVER.NAME]
So I agree with mitch and think it's a path error.
my perl skills are very limited, but dugg around in zmfilter.pl anyway.
around line 716 the zip process is done I think, the info on line 720 is printed in the zmfilter.log, but the info on line 725 is not:
Code: Select all
Info( "Adding $image_file\n" );
Code: Select all
foreach my $image_file ( <arch_image_path> )
{
Info( "Adding $image_file\n" );
my $member = $zip->addFile( $image_file );
last unless ( $member );
$member->desiredCompressionMethod( (ZM_UPLOAD_ARCH_COMPRESS)?&COMPRESSION_DEFLATED:&COMPRESSION_STORED );
}
-
- Posts: 247
- Joined: Sun Jan 16, 2005 11:26 am
I'm no expert either, but try putting extra debug statements in to see if you can find out what path it is using:
if ( ZM_UPLOAD_ARCH_FORMAT eq "zip" )
{
$arch_file .= '.zip';
my $zip = Archive::Zip->new();
Info( "Creating upload file '$arch_file'\n" );
#ADD LINE BELOW
Info( "Searching images in '$arch_image_path'\n" );
my $status = &AZ_OK;
foreach my $image_file ( <*$arch_image_path> )
{
Info( "Adding $image_file\n" );
my $member = $zip->addFile( $image_file );
last unless ( $member );
$member->desiredCompressionMethod( (ZM_UPLOAD_ARCH_COMPRESS)?&COMPRESSION_DEFLATED:&COMPRESSION_STORED );
}
$status = $zip->writeToFileNamed( $arch_file );
if ( ZM_UPLOAD_ARCH_FORMAT eq "zip" )
{
$arch_file .= '.zip';
my $zip = Archive::Zip->new();
Info( "Creating upload file '$arch_file'\n" );
#ADD LINE BELOW
Info( "Searching images in '$arch_image_path'\n" );
my $status = &AZ_OK;
foreach my $image_file ( <*$arch_image_path> )
{
Info( "Adding $image_file\n" );
my $member = $zip->addFile( $image_file );
last unless ( $member );
$member->desiredCompressionMethod( (ZM_UPLOAD_ARCH_COMPRESS)?&COMPRESSION_DEFLATED:&COMPRESSION_STORED );
}
$status = $zip->writeToFileNamed( $arch_file );