in reply to Net::FTP insanity

Hi,

Thanks for the responses.

1. Increasing the timeout just makes the call wait a longer or shorter duration before it borks.
2. Commenting PASV out does nothing.
3. The debug just prints out the FTP conversation, and fails with my die() message.
4. The script fails at put() each and every time.


When I check the FTP server, I see that it creates the file for me, but it just sits at 0kb until the session terminates. I've found some nice Net::FTP code here abouts (better error handling than I have), and will also try a solution that I understand...watching packets on the wire to see what's cutting on the network.

I suspected a possible permission error, but read/write is set on the virtual folder, and a bash FTP works fine. That said, it may be time for a system() call to see if I get a similar error.

Replies are listed 'Best First'.
Re^2: Net::FTP insanity
by syphilis (Archbishop) on Nov 22, 2007 at 11:57 UTC
    Just on the "Passive" aspect again (which may be a red herring) - what happens if you set Passive => 1 in the new() constructor ?

    Here's what perldoc Net::FTP has to say about that:
    Passive - If set to a non-zero value then all data transfers will be done using passive mode. This is not usually required except for some *dumb* servers, and some firewall configurations. This can also be set by the environment variable "FTP_PASSIVE".
    Update: You might want to try that (both with and) without the $ftp->pasv();

    Cheers,
    Rob
      Hi Rob,

      I'll give that a go. I've changed the timeout on my app to 3600s, and have Wireshark streaming its way from the web. I want to see if the timeout change verifies my memory theory, or if I'm just full of nonsense. Waiting an hour for a verdict is a *bit* annoying :-)
Re^2: Net::FTP insanity
by NoSignal (Acolyte) on Nov 22, 2007 at 11:36 UTC
    ...just a thought, but does Net::FTP attempt to copy to memory and then write to disk from RAM? Is that any different to the way an FTP command from the command line would do things? I'm thinking that it could be sending the file to memory on my laptop before uploading the file to the server, leading to the timeout, because the FTP server isn't seeing any activity after the file name has been put on disk.