Discussion:
issue with SITE commands and retries
Mattias Bergvall
2014-06-10 08:58:12 UTC
Permalink
Hi!
Thanks for lftp. A great piece of software.


We need an option to completely disable retries. The option net:max-retries
= 0 unfortunately means unlimited retries.

I have an issue with LFTP (Version 4.4.15) when it comes to “misbehaving”
mainframe remote sites.
The problem occurs when the FTP server/proxy (IBM FTP CS V1R13) fails to
get exclusive permissions to the target dataset (file).
The server then issues a 125 message and terminates the connection. (Which
I think is incorrect behavior, but that's not the point).

What happens next is that lftp reconnects again (I have net:max-retries =
1. I don’t want it to retry!) and does NOT issue the SITE commands that
were in the command file, prior to the put command.
This time, the FTP server does not have a problem, so lftp successfully
sends the file, but it then gets the wrong record length on the remote side
☹.

This is my command file:

set ftp:use-feat false
set dns:fatal-timeout 50
set net:max-retries 1
set cmd:fail-exit true
set ftp:sync-mode true
set ftp:use-site-utime false
set net:connection-limit 1
open 10.0.0.2
set net:socket-bind-ipv4 172.17.0.2
site SBD=(IBM-278,ISO8859-1)
site LRECL=240
site RECFM=FB
put -a /var/tmp/vidare_tmp.21077.21504tina1399629722_00b996a43ed577108682
-o \'BQY0P.QY300A10.FEFI(+1)\'



and the resulting log:


---- Resolving host address...
---- 1 address found: 10.0.0.2
---- Connecting to 10.0.0.2 (10.0.0.2) port 21
<--- 220 blaha FTP Proxy, Authorized use only, use ***@host to login
---> USER ***@MVS3
<--- 331-TCPFTPD1 IBM FTP CS V1R13 at mvs3ibm.sys.bla.ha, 10:02:08 on
2014-05-09.
<--- 331-Connection will close if idle for more than 5 minutes.
<--- 331 Send password please.
<--- 230 US00000 is logged on. Working directory is "US00000.".
---> PWD
<--- 257 "'US00000.'" is working directory.
---> TYPE I
<--- 200 Type set to I
---> SITE SBD=(IBM-278,ISO8859-1)
200 SITE command was accepted
---> SITE LRECL=240
200 SITE command was accepted
---> SITE RECFM=FB
200-BLOCKSIZE must be a multiple of LRECL for RECFM FB
200-BLOCKSIZE being set to 6000
200 SITE command was accepted
---> TYPE A
<--- 200 Type set to A
---> PASV
<--- 227 Entering Passive Mode (10.0.0.2,201,78)
---- Connecting data socket to (10.0.0.2) port 51534
---- Data connection established
---> ALLO 4579
<--- 202 ALLO not necessary, you may proceed
---> STOR 'BQY0P.QY300A10.FEFI(+1)'
<--- 125-FTP Server unable to obtain EXCLUSIVE use of
BQY0P.QY300A10.FEFI.G0100V00 which is held by: UNKNOWN UNKNOWN UNKNOWN
on UNKNOWN
<--- 125 Data set BQY0P.QY300A10.FEFI.G0100V00 is not available
---- Closing data socket
**** Peer closed connection
---- Closing control socket
---- Connecting to 10.0.0.2 (10.0.0.2) port 21
<--- 220 blaha FTP Proxy, Authorized use only, use ***@host to login
---> USER ***@MVS3
<--- 331-TCPFTPD1 IBM FTP CS V1R13 at mvs3ibm.sys.bla.ha, 10:02:38 on
2014-05-09.
<--- 331-Connection will close if idle for more than 5 minutes.
<--- 331 Send password please.
<--- 230 US00000 is logged on. Working directory is "US00000.".
---> TYPE I
<--- 200 Type set to I
---> SIZE 'BQY0P.QY300A10.FEFI(+1)'
<--- 501 command aborted -- FTP server not configured for SIZE
---> TYPE A
copy: put rolled back to 0, seeking get accordingly
<--- 200 Type set to A
---> PASV
<--- 227 Entering Passive Mode (10.0.0.2,202,240)
---- Connecting data socket to (10.0.0.2) port 51952
---- Data connection established
---> STOR 'BQY0P.QY300A10.FEFI(+1)'
<--- 125 Storing data set BQY0P.QY300A10.FEFI.G0100V00
---- Closing data socket
<--- 250 Transfer completed successfully.
---> QUIT
---- Closing control socket



As you can see, the SITE commands are not sent again after the second login
has been made after the connection loss.

Is there a way I can disable the reconnection and instead have LFTP fail
with non-zero result when the connection gets dropped? I would really
appreciate that.
It’s IBM on a mainframe I’m talking to. They are a bank. They don’t care
that they violate the RFC. We are their only customer that has issues with
this.



Thanks!

Mattias
Alexander V. Lukyanov
2014-06-11 09:37:34 UTC
Permalink
I have an issue with LFTP (Version 4.4.15) when it comes to “misbehaving”
mainframe remote sites.
The problem occurs when the FTP server/proxy (IBM FTP CS V1R13) fails to
get exclusive permissions to the target dataset (file).
The server then issues a 125 message and terminates the connection. (Which
I think is incorrect behavior, but that's not the point).
What happens next is that lftp reconnects again (I have net:max-retries =
1. I don’t want it to retry!) and does NOT issue the SITE commands that
The problem with retries should be fixed in 4.5.2.

You can also try this patch for 4.5.2 which adds "ftp:site" setting for
tuning the connection after login. For your case it would be

set ftp:site "SBD=(IBM-278,ISO8859-1) LRECL=240 RECFM=FB"

(note the double spaces).

--
Alexander.
Mattias Bergvall
2014-06-13 13:21:42 UTC
Permalink
Thanks Alexander.
I've upgraded to 4.5.2 now.

Will the ftp:site option be available in 4.5.3?


BR
Mattias Bergvall
Post by Mattias Bergvall
Post by Mattias Bergvall
I have an issue with LFTP (Version 4.4.15) when it comes to “misbehaving”
mainframe remote sites.
The problem occurs when the FTP server/proxy (IBM FTP CS V1R13) fails to
get exclusive permissions to the target dataset (file).
The server then issues a 125 message and terminates the connection.
(Which
Post by Mattias Bergvall
I think is incorrect behavior, but that's not the point).
What happens next is that lftp reconnects again (I have net:max-retries =
1. I don’t want it to retry!) and does NOT issue the SITE commands that
The problem with retries should be fixed in 4.5.2.
You can also try this patch for 4.5.2 which adds "ftp:site" setting for
tuning the connection after login. For your case it would be
set ftp:site "SBD=(IBM-278,ISO8859-1) LRECL=240 RECFM=FB"
(note the double spaces).
--
Alexander.
Loading...