Page 1 of 1

FTP update errors

Posted: Mon 01 Jul 2013 5:34 pm
by bbrasmussen
I have successfully set up Cumulus and FTP web updates for my website. I'm trying to add another station data from a remote location. I have the port forwarding setup and the FTP log says it logs on successfully, but it doesn't complete the operation of copying files. Can anyone help? Perhaps I need to modify my vsftpd.conf settings on my ftp server. Here's the ftp debug log:

Code: Select all

14:18:02:109 ! HighLevelAsync 0
14:18:02:171 02F68A20 Socket handle created 892
14:18:02:171 TWSocket will connect to 71.199.25.253:2001
14:18:02:203 02F68A20 TriggerDataSent 892
14:18:02:281 FTP Response: 220 (vsFTPd 2.3.5)
14:18:02:281 >|220 (vsFTPd 2.3.5)|

14:18:02:281 FTP Session Connected, code = 0
14:18:02:281 ! HighLevelAsync 0
14:18:02:281 FTP Command: USER www-data
14:18:02:281 02F68A20 TriggerDataSent 892
14:18:02:328 FTP Response: 331 Please specify the password.
14:18:02:328 >|331 Please specify the password.|

14:18:02:328 ! HighLevelAsync 0
14:18:02:328 FTP Command: PASS
14:18:02:328 02F68A20 TriggerDataSent 892
14:18:02:765 FTP Response: 230 Login successful.
14:18:02:765 >|230 Login successful.|

14:18:02:765 ! HighLevelAsync 0
14:18:02:765 ! HighLevelAsync done
14:18:02:796 Getting directory listing
14:18:02:796 FTP Command: PWD
14:18:02:796 02F68A20 TriggerDataSent 892
14:18:02:843 FTP Response: 257 "/var/www"
14:18:02:843 >|257 "/var/www"|

14:18:03:796 ! HighLevelAsync 0
14:18:03:796 FTP Command: PASV
14:18:03:796 02F68A20 TriggerDataSent 892
14:18:03:828 FTP Response: 227 Entering Passive Mode (192,168,1,51,206,138).
14:18:03:828 >|227 Entering Passive Mode (192,168,1,51,206,138).|

14:18:03:828 ! HighLevelAsync 0
14:18:03:828 ! Data Socket Connect
14:18:03:828 02F691E0 Socket handle created 848
14:18:03:828 TWSocket will connect to 192.168.1.51:52874
14:18:03:828 FTP Command: NLST
14:18:03:828 02F68A20 TriggerDataSent 892
14:18:24:843 ! Data Session Connected (Get)
14:18:24:843 02F691E0 TCustomWSocket.Shutdown 1 848
14:18:24:843 ! Data Session closed
14:18:24:843 ! Next3GetAsync
14:18:25:296 Changing directory to /var/www/k7bbr.net/weather/draper
14:18:25:296 FTP Command: CWD /var/www/k7bbr.net/weather/draper
14:18:25:296 02F68A20 TriggerDataSent 892
14:18:55:718 ! Aborting
14:18:55:718 FTP Session Closed
It seems to fail every time when it tries to CWD. I've verified that those directories are all owned by the correct linux user. Thanks for your help.

Re: FTP update errors

Posted: Mon 01 Jul 2013 5:41 pm
by steve
I think I saw the same thing recently on another ftp server. Instead of giving an error message for the CWD, it unhelpfully just timed out. A relative ftp directory path is usually safer than an absolute one like you're using. You're already in /var/www, so you could just try k7bbr.net/weather/draper for the directory (with no leading slash).

Re: FTP update errors

Posted: Mon 01 Jul 2013 5:48 pm
by bbrasmussen
Thanks. I'll try the relative path.

I also saw that it initially connects on the correct IP address and port (a WAN address), and then after entering passive mode it tries to use a LAN IP address which is not correct 192.168.1.51:52874. Could that be the reason for the timeout? It's trying to connect to a different address and port. Is there any way to force it to use the original correct one that it uses initially?

Re: FTP update errors

Posted: Mon 01 Jul 2013 5:56 pm
by steve
That IP address is coming from the server, so perhaps you have it misconfigured. If it is actually on your local network at that address, I'm not sure it would make any difference.

Re: FTP update errors

Posted: Mon 01 Jul 2013 6:01 pm
by bbrasmussen
Looks like I need to fix the configuration. That is the correct local IP address, but obviously won't help me when I'm connecting remotely. That explains why I can connect from my local station but when I connect remotely from the second station I'm timing out. I'll see if I can fix the vsftpd.conf settings so it gives out the correct address. Thanks!

Re: FTP update errors

Posted: Mon 01 Jul 2013 6:05 pm
by steve
I hadn't appreciated what you meant by "I'm trying to add another station data from a remote location". It looks like that IP address from the server is the problem, then.

Re: FTP update errors

Posted: Mon 01 Jul 2013 11:31 pm
by bbrasmussen
Thanks again for your help. I made a couple of changes to the vsftp.conf file on my server to use pasv_addr_resolve=YES and then supplied a pasv_address as well as pasv_min_port and pasv_max_ports. Works great now.

From the man page for vsftpd:
pasv_address
Use this option to override the IP address that vsftpd will advertise in response to the PASV command. Provide a numeric IP address, unless pasv_addr_resolve is enabled, in which case you can provide a hostname which will be DNS resolved for you at startup.
Default: (none - the address is taken from the incoming connected socket)


Which is what was happening - the address from the incoming socket was given to Cumulus and it was trying to use that address in passive mode which was obviously not connecting to the correct place.

On a side note - Thanks for the software! It's a great program and much better than those other overpriced options!