Re: lftp issued “CWD /” results in e rror message but the transfer does not fail

"Kevin R. Bulgrien" <[email protected]> Mon, 26 Aug 2019 10:25:57 -0500 (CDT)
Newsgroups gmane.network.lftp.user
Message-ID <430745059.150.1566833147271.JavaMail.KevinB@CSDI-LAP-KEVINB>
--===============1910635524237855258==
Content-Type: multipart/alternative; 
	boundary="----=_Part_149_162225102.1566833147268"

------=_Part_149_162225102.1566833147268
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Thanks, yes, a tilde following works as desired, however, I feel somewhat=
=20
disappointed that I didn't previously think about simply dropping the=20
trailing slash from the URL. For example:=20

ftps:// server.example.net vs. ftps:// server.example.net /=20

--=20

Kevin R. Bulgrien=20

----- Original Message -----

> From: "Alexander Lukyanov" <[email protected]>
> To: "Kevin R. Bulgrien" <[email protected]>
> Cc: "LFTP Mailing List" <[email protected]>
> Sent: Saturday, August 24, 2019 4:39:21 AM
> Subject: Re: [lftp] lftp issued =E2=80=9CCWD /=E2=80=9D results in error =
message but
> the transfer does not fail

> Try adding a tilde at the end of url.

> =D0=BF=D1=82, 23 =D0=B0=D0=B2=D0=B3. 2019, 18:30 Kevin R. Bulgrien <
> [email protected] >:

> > In a scripted and automated process, it seems beneficial to avoid
>=20
> > generating unwanted error messages that do not indicate an actual
>=20
> > fault, if only to avoid confusion when someone looks at the logs.
>=20

> > Given an lftp command similar to the following:
>=20

> > lftp -vv -d -c set ssl:ca-file /path/to/cert/ftps_cron-bundle.crt;
> > set ssl:check-hostname no; set ftp:ssl-protect-data true; set
> > sftp:connect-program "ssh -a -x -o PubkeyAuthentication=3Dno"; set
> > net:max-retries 2; open -e 'put /path/to/data/upload.txt;' -u
> > username:password ftps:// server.example.net/
>=20

> > The command template works on various servers, but, on one server,
>=20
> > even though the upload is successful, an error message is shown:
>=20

> > ---- CWD path to be sent is `/'
>=20
> > <--- 200 Command OPTS succeed
>=20
> > ---> CWD /
>=20
> > <--- 550 Permission denied
>=20
> > cd: Access failed: 550 Permission denied (/)
>=20

> > How does one prevent lftp from sending CWD / to this server
>=20

> > <--- 230 User logged in
>=20
> > ---> FEAT
>=20
> > <--- 211-Extensions supported
>=20
> > <--- SIZE
>=20
> > <--- XMD5
>=20
> > <--- XSHA1
>=20
> > <--- XSHA256
>=20
> > <--- XSHA512
>=20
> > <--- XQUOTA
>=20
> > <--- LANG EN, ES, FR, GE
>=20
> > <--- MDTM
>=20
> > <--- MLST size*;type*;perm*;create*;modify*;
>=20
> > <--- REST STREAM
>=20
> > <--- TVFS
>=20
> > <--- UTF8
>=20
> > <--- AUTH SSL;TLS-P;
>=20
> > <--- PBSZ
>=20
> > <--- PROT C;P;
>=20
> > <--- 211 end
>=20
> > ---> PWD
>=20
> > <--- 257 "/username/folder" is current directory
>=20
> > ---> PBSZ 0
>=20
> > <--- 200 PBSZ=3D0
>=20
> > ---> PROT P
>=20
> > <--- 200 PRIVATE data channel protection level set
>=20
> > ---> LANG
>=20
> > <--- 200 Default languages set to EN
>=20
> > ---> OPTS UTF8 ON
>=20
> > <--- 200 Command OPTS succeed
>=20
> > ---> OPTS MLST size;type;perm;modify;
>=20
> > ---- CWD path to be sent is `/'
>=20

> > Note that the server automatically sets its default upload
>=20
> > directory based on the username... i.e. /username/folder
>=20

> > The upload should go to this default upload directory without
>=20
> > generating an error message. It does get uploaded, but the
>=20
> > log shows the error message:
>=20

> > cd: Access failed: 550 Permission denied (/)
>=20
> > ---> TYPE I
>=20
> > <--- 200 Transfer mode set to BINARY
>=20
> > ---> PASV
>=20
> > <--- 227 Entering Passive Mode (10,10,35,21,195,225).
>=20
> > ---- Address returned by PASV seemed to be incorrect and has been
> > fixed
>=20
> > ---- Connecting data socket to (nnn.nnn.nnn.nnn) port 50145
>=20
> > ---- Data connection established
>=20
> > ---> ALLO 148891
>=20
> > <--- 200 Command ALLO succeed
>=20
> > ---> STOR upload.txt
>=20
> > <--- 150 Uploading in BINARY file upload.txt
>=20
> > Certificate: ...
>=20
> > Issued by: ...
>=20
> > Trusted
>=20
> > WARNING: Certificate verification: hostname checking disabled
>=20
> > ---- Closing data socket
>=20
> > <--- 226 Transfer completed
>=20
> > ---> SITE UTIME 20190819100016 upload.txt
>=20
> > <--- 550 Command SITE failed
>=20
> > ---> QUIT
>=20
> > ---- Closing control socket
>=20

> > A number of things have been tried. For example, using various
>=20
> > paths with the put command.
>=20

> > * put -O . /path/to/data/upload.txt
>=20
> > * put -O /username/folder /path/to/data/upload.txt
>=20

> > Explicitly placing a cd /username/folder command was also
> > attempted.
>=20

> > Removing -vv and -d are ineffective as well.
>=20

> > How can lftp be made to avoid automatically issuing the "CWD /"
>=20
> > that causes the unwanted and confusing error message that does
>=20
> > not mean an operation intended by the user actually failed?
>=20

> > Alternatively, as opposed to stopping the issuance of the "CWD /",
>=20
> > how might one at least suppress its being treated as an error
>=20
> > without also suppressing real errors?
>=20

> > Experienced on RHEL 7:
>=20

> > $ lftp --version
>=20
> > LFTP | Version 4.4.8 | Copyright (c) 1996-2013 Alexander V.
> > Lukyanov
>=20
> > ...
>=20
> > Libraries used: Readline 6.2
>=20

> > --
>=20

> > Kevin R. Bulgrien
>=20
> > _______________________________________________
>=20
> > lftp mailing list
>=20
> > [email protected]
>=20
> > http://univ.uniyar.ac.ru/mailman/listinfo/lftp
>=20

------=_Part_149_162225102.1566833147268
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><head><style type=3D'text/css'>p { margin: 0; }</style></head><body><=
div style=3D'font-family: arial,helvetica,sans-serif; font-size: 10pt; colo=
r: #000000'>Thanks, &nbsp;yes, a tilde following works as desired, however,=
 I feel somewhat<div>disappointed&nbsp;<span style=3D"font-size: 10pt;">tha=
t I didn't previously think about</span><span style=3D"font-size: 10pt;">&n=
bsp;simply dropping the</span></div><div><span style=3D"font-size: 10pt;">t=
railing slash&nbsp;</span><span style=3D"font-size: 10pt;">from the&nbsp;</=
span><span style=3D"font-size: 10pt;">URL.</span><span style=3D"font-size: =
10pt;">&nbsp; For example:</span></div><div><div><div><div><br></div><div><=
span style=3D"font-family: Helvetica, Arial, sans-serif; font-size: 16px;">=
ftps://</span><a href=3D"http://server.example.net/" rel=3D"noreferrer nore=
ferrer" target=3D"_blank" style=3D"font-family: Helvetica, Arial, sans-seri=
f; font-size: 16px;">server.example.net</a>&nbsp;vs.&nbsp;<span style=3D"fo=
nt-family: Helvetica, Arial, sans-serif; font-size: 16px;">ftps://</span><a=
 href=3D"http://server.example.net/" rel=3D"noreferrer noreferrer" target=
=3D"_blank" style=3D"font-family: Helvetica, Arial, sans-serif; font-size: =
16px;">server.example.net</a>/</div><div></div><div><br></div><div></div><d=
iv></div><div><div><span name=3D"x"></span>--<br><br>Kevin R. Bulgrien</div=
><div id=3D"ea9888ce-e6e7-4221-81cf-04ae291aac60"><br></div><hr id=3D"zwchr=
"><blockquote style=3D"border-left:2px solid #1010FF;margin-left:5px;paddin=
g-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:=
none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"=
Alexander Lukyanov" &lt;[email protected]&gt;<br><b>To: </b>"Kevin R. Bulgr=
ien" &lt;[email protected]&gt;<br><b>Cc: </b>"LFTP Mailing List" =
&lt;[email protected]&gt;<br><b>Sent: </b>Saturday, August 24, 2019 4:39:21=
 AM<br><b>Subject: </b>Re: [lftp] lftp issued =E2=80=9CCWD /=E2=80=9D resul=
ts in error message but the transfer does not fail<br><br><div dir=3D"auto"=
><div>Try adding a tilde at the end of url.<br><br><div class=3D"gmail_quot=
e"><div dir=3D"ltr" class=3D"gmail_attr">=D0=BF=D1=82, 23 =D0=B0=D0=B2=D0=
=B3. 2019, 18:30 Kevin R. Bulgrien &lt;<a href=3D"mailto:kevinb@systemsdesi=
gnusa.com" target=3D"_blank">[email protected]</a>&gt;:<br></div>=
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">In a scripted and automated process, it seem=
s beneficial to avoid<br>
generating unwanted error messages that do not indicate an actual<br>
fault, if only to avoid confusion when someone looks at the logs.<br>
<br>
Given an lftp command similar to the following:<br>
<br>
lftp -vv -d -c set ssl:ca-file /path/to/cert/ftps_cron-bundle.crt; set ssl:=
check-hostname no; set ftp:ssl-protect-data true; set sftp:connect-program =
"ssh -a -x -o PubkeyAuthentication=3Dno"; set net:max-retries 2; open -e 'p=
ut /path/to/data/upload.txt;' -u username:password ftps://<a href=3D"http:/=
/server.example.net/" rel=3D"noreferrer noreferrer" target=3D"_blank">serve=
r.example.net/</a><br>
<br>
The command template works on various servers, but, on one server,<br>
even though the upload is successful, an error message is shown:<br>
<br>
&nbsp; ---- CWD path to be sent is `/'<br>
&nbsp; &lt;--- 200 Command OPTS succeed<br>
&nbsp; ---&gt; CWD /<br>
&nbsp; &lt;--- 550 Permission denied<br>
&nbsp; cd: Access failed: 550 Permission denied (/)<br>
<br>
How does one prevent lftp from sending CWD / to this server<br>
<br>
&nbsp; &lt;--- 230 User logged in<br>
&nbsp; ---&gt; FEAT<br>
&nbsp; &lt;--- 211-Extensions supported<br>
&nbsp; &lt;---&nbsp; &nbsp; &nbsp;SIZE<br>
&nbsp; &lt;---&nbsp; &nbsp; &nbsp;XMD5<br>
&nbsp; &lt;---&nbsp; &nbsp; &nbsp;XSHA1<br>
&nbsp; &lt;---&nbsp; &nbsp; &nbsp;XSHA256<br>
&nbsp; &lt;---&nbsp; &nbsp; &nbsp;XSHA512<br>
&nbsp; &lt;---&nbsp; &nbsp; &nbsp;XQUOTA<br>
&nbsp; &lt;---&nbsp; &nbsp; &nbsp;LANG EN, ES, FR, GE<br>
&nbsp; &lt;---&nbsp; &nbsp; &nbsp;MDTM<br>
&nbsp; &lt;---&nbsp; &nbsp; &nbsp;MLST size*;type*;perm*;create*;modify*;<b=
r>
&nbsp; &lt;---&nbsp; &nbsp; &nbsp;REST STREAM<br>
&nbsp; &lt;---&nbsp; &nbsp; &nbsp;TVFS<br>
&nbsp; &lt;---&nbsp; &nbsp; &nbsp;UTF8<br>
&nbsp; &lt;---&nbsp; &nbsp; &nbsp;AUTH SSL;TLS-P;<br>
&nbsp; &lt;---&nbsp; &nbsp; &nbsp;PBSZ<br>
&nbsp; &lt;---&nbsp; &nbsp; &nbsp;PROT C;P;<br>
&nbsp; &lt;--- 211 end<br>
&nbsp; ---&gt; PWD<br>
&nbsp; &lt;--- 257 "/username/folder" is current directory<br>
&nbsp; ---&gt; PBSZ 0<br>
&nbsp; &lt;--- 200 PBSZ=3D0<br>
&nbsp; ---&gt; PROT P<br>
&nbsp; &lt;--- 200 PRIVATE data channel protection level set<br>
&nbsp; ---&gt; LANG<br>
&nbsp; &lt;--- 200 Default languages set to EN<br>
&nbsp; ---&gt; OPTS UTF8 ON<br>
&nbsp; &lt;--- 200 Command OPTS succeed<br>
&nbsp; ---&gt; OPTS MLST size;type;perm;modify;<br>
&nbsp; ---- CWD path to be sent is `/'<br>
<br>
Note that the server automatically sets its default upload<br>
directory based on the username... i.e. /username/folder<br>
<br>
The upload should go to this default upload directory without<br>
generating an error message. It does get uploaded, but the<br>
log shows the error message:<br>
<br>
&nbsp; cd: Access failed: 550 Permission denied (/)<br>
&nbsp; ---&gt; TYPE I<br>
&nbsp; &lt;--- 200 Transfer mode set to BINARY<br>
&nbsp; ---&gt; PASV<br>
&nbsp; &lt;--- 227 Entering Passive Mode (10,10,35,21,195,225).<br>
&nbsp; ---- Address returned by PASV seemed to be incorrect and has been fi=
xed<br>
&nbsp; ---- Connecting data socket to (nnn.nnn.nnn.nnn) port 50145<br>
&nbsp; ---- Data connection established<br>
&nbsp; ---&gt; ALLO 148891<br>
&nbsp; &lt;--- 200 Command ALLO succeed<br>
&nbsp; ---&gt; STOR upload.txt<br>
&nbsp; &lt;--- 150 Uploading in BINARY file upload.txt<br>
&nbsp; Certificate: ...<br>
&nbsp; Issued by: ...<br>
&nbsp; Trusted<br>
&nbsp; WARNING: Certificate verification: hostname checking disabled<br>
&nbsp; ---- Closing data socket<br>
&nbsp; &lt;--- 226 Transfer completed<br>
&nbsp; ---&gt; SITE UTIME 20190819100016 upload.txt<br>
&nbsp; &lt;--- 550 Command SITE failed<br>
&nbsp; ---&gt; QUIT<br>
&nbsp; ---- Closing control socket<br>
<br>
A number of things have been tried. For example, using various<br>
paths with the put command.<br>
<br>
* put -O . /path/to/data/upload.txt<br>
* put -O /username/folder /path/to/data/upload.txt<br>
<br>
Explicitly placing a cd /username/folder command was also attempted.<br>
<br>
Removing -vv and -d are ineffective as well.<br>
<br>
How can lftp be made to avoid automatically issuing the "CWD /"<br>
that causes the unwanted and confusing error message that does<br>
not mean an operation intended by the user actually failed?<br>
<br>
Alternatively, as opposed to stopping the issuance of the "CWD /",<br>
how might one at least suppress its being treated as an error<br>
without also suppressing real errors?<br>
<br>
Experienced on RHEL 7:<br>
<br>
$ lftp --version<br>
LFTP | Version 4.4.8 | Copyright (c) 1996-2013 Alexander V. Lukyanov<br>
...<br>
Libraries used: Readline 6.2<br>
<br>
--<br>
<br>
Kevin R. Bulgrien<br>
_______________________________________________<br>
lftp mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank" rel=3D"noreferrer">l=
[email protected]</a><br>
<a href=3D"http://univ.uniyar.ac.ru/mailman/listinfo/lftp" rel=3D"noreferre=
r noreferrer" target=3D"_blank">http://univ.uniyar.ac.ru/mailman/listinfo/l=
ftp</a><br>
</blockquote></div></div></div>
</blockquote><br></div></div></div></div></div></body></html>
------=_Part_149_162225102.1566833147268--

--===============1910635524237855258==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
lftp mailing list
[email protected]
http://univ.uniyar.ac.ru/mailman/listinfo/lftp

--===============1910635524237855258==--