Issues with automatic uploading - sftp

Forum for questions and support relating to the 1.28.x releases only.
Locked
darmach
Posts: 21
Joined: Thu Aug 13, 2015 8:26 am

Issues with automatic uploading - sftp

Post 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)?
Last edited by darmach on Sat Oct 29, 2016 8:50 am, edited 1 time in total.
darmach
Posts: 21
Joined: Thu Aug 13, 2015 8:26 am

Re: Issues with automatic uploading - sftp

Post 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.
Last edited by darmach on Sat Oct 29, 2016 8:50 am, edited 1 time in total.
darmach
Posts: 21
Joined: Thu Aug 13, 2015 8:26 am

Re: Issues with automatic uploading - sftp

Post by darmach »

Guys, noone here uses sftp uploading?
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Issues with automatic uploading - sftp

Post 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.
darmach
Posts: 21
Joined: Thu Aug 13, 2015 8:26 am

Re: Issues with automatic uploading - sftp

Post by darmach »

I have 1.28.1
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Issues with automatic uploading - sftp

Post by iconnor »

Ok, so what do you get if you go to a command line and do

sudo zmfilter.pl
darmach
Posts: 21
Joined: Thu Aug 13, 2015 8:26 am

Re: Issues with automatic uploading - sftp

Post 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?
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Issues with automatic uploading - sftp

Post 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
darmach
Posts: 21
Joined: Thu Aug 13, 2015 8:26 am

Re: Issues with automatic uploading - sftp

Post 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?
darmach
Posts: 21
Joined: Thu Aug 13, 2015 8:26 am

Re: Issues with automatic uploading - sftp

Post 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?
darmach
Posts: 21
Joined: Thu Aug 13, 2015 8:26 am

Re: Issues with automatic uploading - sftp

Post 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
Locked