Retry on failed attempt?

Advertisement

jpotrz
Joined:
Posts:
2

Retry on failed attempt?

First off, I admit I'm pretty new/basic to all this so please bare with me.
That being said, I have a fairly simple script that logs into an FTP nightly and uploads a file.
Problem is that I'm occasionally (3–4 a month) seeing an error when trying to transfer
< 2023-03-06 01:25:37.651 451 Requested action aborted: internal error in processing.
. 2023-03-06 01:25:37.651 Connection failed.
I guess any thoughts/insight into WHY the connection is failing would be appreciated too. If that error points to the FTP server host, I can go back and talk to them as well.

I'd like for some scripting advice that will wait X seconds and retry that file transfer if the above error is hit.
This is my basic script that works 99% of the time.
option batch on
option confirm off
open XXXXXXXXXXXXXXX -timeout=360
 
lcd "N:\XXX"
cd "\XXXX\XXXXX\"
option transfer binary
put -nopermissions -nopreservetime *.UPD
 
lcd "E:\XXXXXXXX\downloads"
cd "\XXXX\XXXXX\XXXXX\"
option transfer binary
get -nopermissions -nopreservetime -delete *.txt
 
close
exit
Any help that can be provided will be more than appreciated!
Thank you in advance

Reply with quote

Advertisement

jpotrz
Joined:
Posts:
2

Re: Retry on failed attempt?

Thanks for the quick response. Below is the full log for this transaction. I will review the link you sent as well. I just want to understand if this is MY side or the FTP server I'm trying to connect to (so I can yell at them :))
. 2023-03-21 01:29:27.629 --------------------------------------------------------------------------
. 2023-03-21 01:29:27.629 WinSCP Version 5.15.3 (Build 9730) (OS 6.3.9600 - Windows Server 2012 R2 Standard)
. 2023-03-21 01:29:27.629 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2023-03-21 01:29:27.629 Log level: Normal
. 2023-03-21 01:29:27.629 Local account: XXXXXX\YYYYYYY
. 2023-03-21 01:29:27.629 Working directory: C:\Windows\system32
. 2023-03-21 01:29:27.629 Process ID: 11448
. 2023-03-21 01:29:27.630 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe" /console=5.15.3 /consoleinstance=_9764_763 "-script=C:\XXXXXXXXXXXXXXXXXXXXX\CMvX_SFTP_UPLOAD.txt" 
. 2023-03-21 01:29:27.630 Time zone: Current: GMT-5, Standard: GMT-6 (Central Standard Time), DST: GMT-5 (Central Daylight Time), DST Start: 3/12/2023, DST End: 11/5/2023
. 2023-03-21 01:29:27.630 Login time: Tuesday, March 21, 2023 1:29:27 AM
. 2023-03-21 01:29:27.630 --------------------------------------------------------------------------
. 2023-03-21 01:29:27.630 Script: Retrospectively logging previous script records:
> 2023-03-21 01:29:27.630 Script: option batch on
< 2023-03-21 01:29:27.630 Script: batch           on        
> 2023-03-21 01:29:27.630 Script: option confirm off
< 2023-03-21 01:29:27.630 Script: confirm         off       
> 2023-03-21 01:29:27.630 Script: open ftp://XXXXXXXXXXXX:***@VFTP.XXXXXXXX.COM -timeout=360
. 2023-03-21 01:29:27.630 --------------------------------------------------------------------------
. 2023-03-21 01:29:27.630 Session name: XXXXXXXXXXXX@VFTP.XXXXXXXX.COM (Ad-Hoc site)
. 2023-03-21 01:29:27.630 Host name: VFTP.XXXXXXXX.COM (Port: 21)
. 2023-03-21 01:29:27.630 User name: XXXXXXXXXXXX (Password: Yes, Key file: No, Passphrase: No)
. 2023-03-21 01:29:27.630 Transfer Protocol: FTP
. 2023-03-21 01:29:27.630 Ping type: Dummy, Ping interval: 30 sec; Timeout: 360 sec
. 2023-03-21 01:29:27.630 Disable Nagle: No
. 2023-03-21 01:29:27.630 Proxy: None
. 2023-03-21 01:29:27.630 Send buffer: 262144
. 2023-03-21 01:29:27.630 UTF: Auto
. 2023-03-21 01:29:27.630 FTPS: None [Client certificate: No]
. 2023-03-21 01:29:27.630 FTP: Passive: Yes [Force IP: Auto]; MLSD: Auto [List all: Auto]; HOST: Auto
. 2023-03-21 01:29:27.630 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2023-03-21 01:29:27.630 Cache directory changes: Yes, Permanent: Yes
. 2023-03-21 01:29:27.630 Recycle bin: Delete to: No, Overwritten to: No, Bin path: 
. 2023-03-21 01:29:27.630 Timezone offset: 0h 0m
. 2023-03-21 01:29:27.630 --------------------------------------------------------------------------
. 2023-03-21 01:29:27.631 Connecting to VFTP.XXXXXXXX.COM ...
. 2023-03-21 01:29:27.669 Connected with VFTP.XXXXXXXX.COM. Waiting for welcome message...
< 2023-03-21 01:29:27.716 220 Serv-U FTP Server v15.3.2 ready...
> 2023-03-21 01:29:27.716 USER XXXXXXXXXXXX
< 2023-03-21 01:29:27.742 331 User name okay, need password.
> 2023-03-21 01:29:27.742 PASS **********
< 2023-03-21 01:29:28.295 451 Requested action aborted: internal error in processing.
. 2023-03-21 01:29:28.295 Connection failed.

Reply with quote

martin
Site Admin
martin avatar

Re: Retry on failed attempt?

The 451 "Internal error" response to PASS command indeed looks like a server-side problem.

Reply with quote

Advertisement

You can post new topics in this forum