Page 1 of 1

Issues with automatic uploading - sftp

Posted: Thu Aug 13, 2015 8:56 am
by darmach
Hi,
I recently started using zoneminder, on Debian Jessie with USB webcams.
One of the issue I encountered is not being able to upload to external server via sftp.

I have enabled debug logging in options, and receiving following errors:

Code: Select all

2015-08-13 10:51:37.595370	zmdc	31816	ERR	'zmfilter.pl ' exited abnormally, exit status 9	zmdc.pl	
2015-08-13 10:51:36.537490	zmfilter	31963	INF	Uploading to 456.456.456:1212 using SFTP	zmfilter.pl	
2015-08-13 10:51:36.311340	zmfilter	31963	INF	Creating upload file '/tmp/Hall-1-50.tar', 155 files	zmfilter.pl	
2015-08-13 10:51:31.132340	zmfilter	31963	INF	Scanning for events	zmfilter.pl	
2015-08-13 10:51:30.104470	zmdc	31963	INF	'zmfilter.pl' started at 15/08/13 10:51:30	zmdc.pl	
2015-08-13 10:51:30.102540	zmdc	31816	INF	'zmfilter.pl' starting at 15/08/13 10:51:30, pid = 31963	zmdc.pl	
2015-08-13 10:51:30.056130	zmdc	31816	INF	Starting pending process, zmfilter.pl	zmdc.pl	
2015-08-13 10:51:25.895840	zmdc	31816	ERR	'zmfilter.pl ' exited abnormally, exit status 9	zmdc.pl	
2015-08-13 10:51:24.884480	zmfilter	31931	INF	Uploading to 456.456.456:1212 using SFTP	zmfilter.pl	
2015-08-13 10:51:24.669750	zmfilter	31931	INF	Creating upload file '/tmp/Hall-1-50.tar', 155 files	zmfilter.pl	
2015-08-13 10:51:19.480760	zmfilter	31931	INF	Scanning for events	zmfilter.pl	
2015-08-13 10:51:18.541370	zmdc	31931	INF	'zmfilter.pl' started at 15/08/13 10:51:18	zmdc.pl	
2015-08-13 10:51:18.541360	zmdc	31816	INF	'zmfilter.pl' starting at 15/08/13 10:51:18, pid = 31931	zmdc.pl	
2015-08-13 10:51:18.493400	zmdc	31816	INF	Starting pending process, zmfilter.pl	zmdc.pl
The sftp connection works outside of the zoneminder - with same credentials I've entered in zoneminder options.
I found that this error is often caused by missing dependency: libnet-sftp-foreign-perl , but I have this package installed.

Can anyone advise?
Is it possible to enable higher level of logging (this doesnt look like debug at all)?

Re: Issues with automatic uploading - sftp

Posted: Sat Aug 15, 2015 11:47 am
by darmach
Quick update:
From the server point of view I see that sftp user does log in:

Code: Select all

Aug 15 12:44:04 dXXXX2 sshd[6850]: Accepted password for sftpuser from 178.138.315.210 port 60995 ssh2 
Aug 15 12:44:04 dXXXX2 sshd[6850]: pam_unix(sshd:session): session opened for user user by (uid=0)  
Aug 15 12:44:04 dXXXX2 sshd[6850]: pam_unix(sshd:session): session closed for user user 
But no files are being uploaded.

Re: Issues with automatic uploading - sftp

Posted: Mon Aug 17, 2015 7:22 am
by darmach
Guys, noone here uses sftp uploading?

Re: Issues with automatic uploading - sftp

Posted: Tue Aug 18, 2015 3:09 pm
by iconnor
Which version?

I seem to recall that jessie comes with 1.26.5.

Your next step would be running the command from a command prompt so that you can see error output.

Re: Issues with automatic uploading - sftp

Posted: Tue Aug 18, 2015 3:38 pm
by darmach
I have 1.28.1

Re: Issues with automatic uploading - sftp

Posted: Tue Aug 18, 2015 6:51 pm
by iconnor
Ok, so what do you get if you go to a command line and do

sudo zmfilter.pl

Re: Issues with automatic uploading - sftp

Posted: Tue Aug 18, 2015 7:39 pm
by darmach
I did enable autoupload filter (I disabled is before, as it did generate a lot of logons to the remote server, each time I was spammed with logon info emails), with debug logging disabled (shall I enable it?) I get this output:

....And it seems that zmfilter output "looks too spamy for a new user, please remove..."

I did send you the output via email, maybe you could post it here for the others to see?

Re: Issues with automatic uploading - sftp

Posted: Tue Aug 18, 2015 8:30 pm
by iconnor
I think the relevant bit is

Insecure argument '/monitoring' on 'stat' method call while running with -T switch at /usr/bin/zmfilter.pl line 824.

and then it hangs up. Google isn't returning any results...

might have to post a bug to the net::SFTP maintainers

Re: Issues with automatic uploading - sftp

Posted: Fri Aug 21, 2015 2:51 am
by darmach
Well, the sftp does work outside of zoneminder without problems. User is jailed into home directory on remote host, and monitoring directory exist in there (right now with 777 permissions)

Maybe I've entered the path into configuration wrong? UPLOAD_REM_DIR is set to /monitoring as I thought it will use jailed home dir as a root for the directory structure on that user, should I entere here full path?

Re: Issues with automatic uploading - sftp

Posted: Sun Aug 23, 2015 12:10 pm
by darmach
iconnor wrote:I think the relevant bit is
Insecure argument '/monitoring' on 'stat' method call while running with -T switch at /usr/bin/zmfilter.pl line 824.
and then it hangs up. Google isn't returning any results...
might have to post a bug to the net::SFTP maintainers
is net::SFTP a perl module? A newbie question - but where to file such bug?

Re: Issues with automatic uploading - sftp

Posted: Sun Aug 23, 2015 8:08 pm
by darmach
I found out (after a chat with net::SFTP maintaner) that net::SFTP::Foreign is being sued in here. And it seems that someone opened this issue 2 days ago :D
https://rt.cpan.org/Public/Bug/Display.html?id=106559