Yes, the 426 causes an infinite retry despite max-retries.
I changed the command stream to include your settings and it still
loops. In fact, the looping is instantaneous - there is no delays
between the retry attempts.
Here is the result (I've numbered the output lines):
1 lftp <<Ctrl-D
2 debug 10
3 set cmd:trace yes
4 set cmd:at-exit "kill all"
5 set cmd:fail-exit no
6 set cmd:move-background no
7 set cmd:save-cwd-history no
8 set cmd:save-rl-history no
9 set cmd:verbose no
10 set dns:fatal-timeout 10s
11 set ftp:passive-mode on
12 set net:max-retries 3
13 set net:persist-retries 1
14 set net:reconnect-interval-base 60
15 set net:reconnect-interval-max 60
16 set net:reconnect-interval-multiplier 1
17 set xfer:log no
18 set cmd:trace yes
19 set cmd:default-protocol ftp
20 open ibm01 || exit 255
21 set cmd:trace no
22 user ${IDPASSWD}
23 set cmd:trace yes
24 ls > /dev/null || exit 254
25 put -a file_will_not_truncate.rpt -o
SRAYROVER/SRY260E18.S000000000 || exit 251
26 put -a file_will_not_truncate.rpt -o
SRAYROVER/SRY260E18.S000000000 || exit 251
27 put -a file_will_truncate.rpt -o
SRAYROVER/SRY260E18.S000000001 || exit 252
28 quit
29 Ctrl-D
Start of output:
30 notice: cannot open //.netrc: No such file or directory
31 ---- Resolving host address...
32 ---- 1 address found: 10.0.0.1
33 notice: cannot open //.netrc: No such file or directory
34 ---- dns cache hit
35 ---- Connecting to ibm01 (10.0.0.1) port 21
36 <--- 220-QTCP at IBM01.
37 <--- 220 Connection will close if idle more than 5 minutes.
38 ---> FEAT
39 <--- 211-Feature listing follows:
40 <--- AUTH TLS
41 <--- CCC
42 <--- PBSZ
43 <--- PROT
44 <--- 211 End of feature listing.
45 ---> AUTH TLS
46 <--- 431 Requested security mechanism not available at this
time.
47 ---> USER ftp1
48 <--- 331 Enter password.
49 ---> PASS mypassword
50 <--- 230 FTP1 logged on.
51 ---> PWD
52 <--- 257 "QGPL" is current library.
53 ---> PASV
54 <--- 227 Entering Passive Mode (10,0,0,1,80,122).
55 ---- Connecting data socket to (10.0.0.1) port 20602
56 ---- Data connection established
57 ---> LIST
58 <--- 125 List started.
59 ---- Got EOF on data connection
60 ---- Closing data socket
61 <--- 250 List completed.
Done with ls command to test user/password, now do the first put:
62 copy: get hit eof
63 copy: waiting for put confirmation
64 copy: put confirmed store
65 copy: get is finished - all done
66 copy: get hit eof
67 copy: waiting for put confirmation
68 ---> PASV
69 <--- 227 Entering Passive Mode (10,0,0,1,237,161).
70 ---- Connecting data socket to (10.0.0.1) port 60833
71 ---- Data connection established
72 ---> ALLO 206
73 <--- 202 ALLO subcommand not required.
74 ---> STOR SRAYROVER/SRY260E18.S000000000
75 <--- 150 Sending file to member S000000000 in file SRY260E18 in
library SRAYROVER.
76 ---- Closing data socket
77 <--- 226 File transfer completed successfully.
As expected, now do second put:
78 copy: put confirmed store
79 copy: get is finished - all done
80 copy: get hit eof
81 copy: waiting for put confirmation
82 ---> PASV
83 <--- 227 Entering Passive Mode (10,0,0,1,252,204).
84 ---- Connecting data socket to (10.0.0.1) port 64716
85 ---- Data connection established
86 ---> STOR SRAYROVER/SRY260E18.S000000000
87 <--- 150 Sending file to member S000000000 in file SRY260E18 in
library SRAYROVER.
88 ---- Closing data socket
89 <--- 226 File transfer completed successfully.
Again, as expected, now do third put which will receive a 426 reply due
to truncation:
90 copy: put confirmed store
91 copy: get is finished - all done
92 copy: get hit eof
93 copy: waiting for put confirmation
94 ---> PASV
95 <--- 227 Entering Passive Mode (10,0,0,1,99,9).
96 ---- Connecting data socket to (10.0.0.1) port 25353
97 ---- Data connection established
98 ---> STOR SRAYROVER/SRY260E18.S000000001
99 <--- 150 Sending file to member S000000001 in file SRY260E18 in
library SRAYROVER.
100 ---- Closing data socket
101 <--- 426-Records written to file SRY260E18 in library SRAYROVER
have been truncated. Data in file may not be valid.
102 <--- 426 Data transfer ended.
Note the value of retries after this failure:
103 try_time=1271427916, retries=0
104 ---> TYPE I
105 <--- 200 Representation type is binary IMAGE.
106 ---> SIZE SRAYROVER/SRY260E18.S000000001
107 <--- 500 Subcommand SIZE not valid.
108 copy: get hit eof
109 copy: waiting for put confirmation
110 ---> TYPE A
111 copy: put rolled back to 0, seeking get accordingly
112 copy: get position was 217
113 copy: get hit eof
114 copy: waiting for put confirmation
115 <--- 200 Representation type is ASCII nonprint.
116 ---> PASV
117 <--- 227 Entering Passive Mode (10,0,0,1,161,32).
118 ---- Connecting data socket to (10.0.0.1) port 41248
119 ---- Data connection established
120 ---> STOR SRAYROVER/SRY260E18.S000000001
121 <--- 150 Sending file to member S000000001 in file SRY260E18 in
library SRAYROVER.
122 ---- Closing data socket
123 <--- 426-Records written to file SRY260E18 in library SRAYROVER
have been truncated. Data in file may not be valid.
124 <--- 426 Data transfer ended.
Retry failed, note retries count:
125 try_time=1271427917, retries=0
126 ---> TYPE I
127 <--- 200 Representation type is binary IMAGE.
128 copy: get hit eof
129 copy: waiting for put confirmation
130 ---> TYPE A
131 copy: put rolled back to 0, seeking get accordingly
132 copy: get position was 217
133 copy: get hit eof
134 copy: waiting for put confirmation
135 <--- 200 Representation type is ASCII nonprint.
136 ---> PASV
137 <--- 227 Entering Passive Mode (10,0,0,1,99,97).
138 ---- Connecting data socket to (10.0.0.1) port 25441
139 ---- Data connection established
140 ---> STOR SRAYROVER/SRY260E18.S000000001
141 <--- 150 Sending file to member S000000001 in file SRY260E18 in
library SRAYROVER.
142 ---- Closing data socket
143 <--- 426-Records written to file SRY260E18 in library SRAYROVER
have been truncated. Data in file may not be valid.
144 <--- 426 Data transfer ended.
Failed again, retries still = 0
145 try_time=1271427917, retries=0
146 ---> TYPE I
147 <--- 200 Representation type is binary IMAGE.
148 copy: get hit eof
149 copy: waiting for put confirmation
150 ---> TYPE A
151 copy: put rolled back to 0, seeking get accordingly
152 copy: get position was 217
153 copy: get hit eof
154 copy: waiting for put confirmation
155 <--- 200 Representation type is ASCII nonprint.
156 ---> PASV
157 <--- 227 Entering Passive Mode (10,0,0,1,204,115).
158 ---- Connecting data socket to (10.0.0.1) port 52339
159 ---- Data connection established
160 ---> STOR SRAYROVER/SRY260E18.S000000001
161 <--- 150 Sending file to member S000000001 in file SRY260E18 in
library SRAYROVER.
162 ---- Closing data socket
163 <--- 426-Records written to file SRY260E18 in library SRAYROVER
have been truncated. Data in file may not be valid.
164 <--- 426 Data transfer ended.
Same:
165 try_time=1271427917, retries=0
166 ---> TYPE I
167 <--- 200 Representation type is binary IMAGE.
168 copy: get hit eof
169 copy: waiting for put confirmation
170 ---> TYPE A
171 copy: put rolled back to 0, seeking get accordingly
172 copy: get position was 217
173 copy: get hit eof
174 copy: waiting for put confirmation
175 <--- 200 Representation type is ASCII nonprint.
176 ---> PASV
177 <--- 227 Entering Passive Mode (10,0,0,1,69,34).
178 ---- Connecting data socket to (10.0.0.1) port 17698
179 ---- Data connection established
180 ---> STOR SRAYROVER/SRY260E18.S000000001
181 <--- 150 Sending file to member S000000001 in file SRY260E18 in
library SRAYROVER.
182 ---- Closing data socket
183 <--- 426-Records written to file SRY260E18 in library SRAYROVER
have been truncated. Data in file may not be valid.
184 <--- 426 Data transfer ended.
and again:
185 try_time=1271427917, retries=0
186 ---> TYPE I
187 <--- 200 Representation type is binary IMAGE.
188 copy: get hit eof
189 copy: waiting for put confirmation
190 ---> TYPE A
191 copy: put rolled back to 0, seeking get accordingly
192 copy: get position was 217
193 copy: get hit eof
194 copy: waiting for put confirmation
195 <--- 200 Representation type is ASCII nonprint.
196 ---> PASV
197 <--- 227 Entering Passive Mode (10,0,0,1,21,42).
198 ---- Connecting data socket to (10.0.0.1) port 5418
199 ---- Data connection established
200 ---> STOR SRAYROVER/SRY260E18.S000000001
201 <--- 150 Sending file to member S000000001 in file SRY260E18 in
library SRAYROVER.
202 ---- Closing data socket
203 <--- 426-Records written to file SRY260E18 in library SRAYROVER
have been truncated. Data in file may not be valid.
204 <--- 426 Data transfer ended.
205 try_time=1271427917, retries=0
and on it goes.....