CFFTP Inconsistency

On December 21, 2007, in ColdFusion, by Anuj Gakhar

I’ve got a scheduled task running that generates a file and sends the file over to a FTP server every day. I have been expereincing some very inconsistent behaviour with the way this works.

Almost 50% of the time, the FTP connections gets opened and then when it tries to upload the file, it fails. If I just go in and re-run the scheduled task, there is a chance that it might work in the first attempt but if not, it works in the second attempt. When I try to access the FTP server via other means like command prompt or FTP clients, I never get any kind of timeouts or connection problems.  I tried increasing the timout on CFFTP tag but didnt help as well.

Does anyone know if this is something to do with the CFFTP tag ? has anyone else come across this before. ?

Tagged with:  

9 Responses to CFFTP Inconsistency

  1. Andrew says:

    Exact same happens to be on CF8
    I have about 30 scheduled FTP jobs and they randomly fail at different times.
    A lot of them fail when doing Close, which seems odd.

  2. There is a Release Candidate for CF8.0.1 available now. Try it out – hammer it – break it – and let Adobe know if any issues persist.

  3. Anuj Gakhar says:

    Andrew/Peter,

    The server I am talking about is still on CF7. But looks like the problem exists on CF8 as well. It is a pain having to monitor the scheduled tasks to see if it worked or not.

  4. Andrew says:

    One thing that helped this a bit was to put 5 second delay between doing each FTP open/close.
    When I didn’t have the delay it would fail 90% of the time, with the delay I get fail rate of about 5%
    Also, make sure you put your entire open/changedir/upload in try/catch and close connection when changedir or upload fails. If you don’t do that, all subsequent ftp open operations would fail (at least it did that for me).

  5. Anuj Gakhar says:

    Andrew, I have got all my code inside a try/catch and I get alert emails everytime it fails (and I get emails everyday 🙂 ) . But one thing I didnt try is the 5 second delay. I could do a thread.sleep() between subsequent calls.
    I will try that and let you know.
    Cheers.

  6. Anuj Gakhar says:

    @Andrew, as an update, I tried the delay thing and I dont think it helped. I can still see the inconsistency. I am gonna leave this open until I find some alternative or a solution.

  7. Radek says:

    Anuj, maybe its all about passive/active setting? I don’t trust ColdFusion inthis matter as sometimes you really can’t get full control of what is going on.

  8. Anuj Gakhar says:

    I agree Radek. I dont think CFFTP is very reliable.

  9. Bobby Heath says:

    Did you ever get this to work reliably? I am on CF8 and I am having the same issues.

Leave a Reply to Andrew Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2011 Anuj Gakhar
%d bloggers like this: