Re: lftp issued “CWD /” results in e rror message but the transfer does not fail
Alexander Lukyanov <[email protected]> Sat, 24 Aug 2019 12:39:21 +0300
| Newsgroups | gmane.network.lftp.user |
|---|---|
| Message-ID | <CANnoEwphufOkpV58GhZfixU+-bcMthwvk4VLL5Dx=6MgLZ7nfg@mail.gmail.com> |
--===============5038617087681569325== Content-Type: multipart/alternative; boundary="000000000000310a970590d9b385" --000000000000310a970590d9b385 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 <kevinb@= systemsdesignusa.com>: > In a scripted and automated process, it seems beneficial to avoid > generating unwanted error messages that do not indicate an actual > fault, if only to avoid confusion when someone looks at the logs. > > Given an lftp command similar to the following: > > 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/ > > The command template works on various servers, but, on one server, > even though the upload is successful, an error message is shown: > > ---- CWD path to be sent is `/' > <--- 200 Command OPTS succeed > ---> CWD / > <--- 550 Permission denied > cd: Access failed: 550 Permission denied (/) > > How does one prevent lftp from sending CWD / to this server > > <--- 230 User logged in > ---> FEAT > <--- 211-Extensions supported > <--- SIZE > <--- XMD5 > <--- XSHA1 > <--- XSHA256 > <--- XSHA512 > <--- XQUOTA > <--- LANG EN, ES, FR, GE > <--- MDTM > <--- MLST size*;type*;perm*;create*;modify*; > <--- REST STREAM > <--- TVFS > <--- UTF8 > <--- AUTH SSL;TLS-P; > <--- PBSZ > <--- PROT C;P; > <--- 211 end > ---> PWD > <--- 257 "/username/folder" is current directory > ---> PBSZ 0 > <--- 200 PBSZ=3D0 > ---> PROT P > <--- 200 PRIVATE data channel protection level set > ---> LANG > <--- 200 Default languages set to EN > ---> OPTS UTF8 ON > <--- 200 Command OPTS succeed > ---> OPTS MLST size;type;perm;modify; > ---- CWD path to be sent is `/' > > Note that the server automatically sets its default upload > directory based on the username... i.e. /username/folder > > The upload should go to this default upload directory without > generating an error message. It does get uploaded, but the > log shows the error message: > > cd: Access failed: 550 Permission denied (/) > ---> TYPE I > <--- 200 Transfer mode set to BINARY > ---> PASV > <--- 227 Entering Passive Mode (10,10,35,21,195,225). > ---- Address returned by PASV seemed to be incorrect and has been fixed > ---- Connecting data socket to (nnn.nnn.nnn.nnn) port 50145 > ---- Data connection established > ---> ALLO 148891 > <--- 200 Command ALLO succeed > ---> STOR upload.txt > <--- 150 Uploading in BINARY file upload.txt > Certificate: ... > Issued by: ... > Trusted > WARNING: Certificate verification: hostname checking disabled > ---- Closing data socket > <--- 226 Transfer completed > ---> SITE UTIME 20190819100016 upload.txt > <--- 550 Command SITE failed > ---> QUIT > ---- Closing control socket > > A number of things have been tried. For example, using various > paths with the put command. > > * put -O . /path/to/data/upload.txt > * put -O /username/folder /path/to/data/upload.txt > > Explicitly placing a cd /username/folder command was also attempted. > > Removing -vv and -d are ineffective as well. > > How can lftp be made to avoid automatically issuing the "CWD /" > that causes the unwanted and confusing error message that does > not mean an operation intended by the user actually failed? > > Alternatively, as opposed to stopping the issuance of the "CWD /", > how might one at least suppress its being treated as an error > without also suppressing real errors? > > Experienced on RHEL 7: > > $ lftp --version > LFTP | Version 4.4.8 | Copyright (c) 1996-2013 Alexander V. Lukyanov > ... > Libraries used: Readline 6.2 > > -- > > Kevin R. Bulgrien > _______________________________________________ > lftp mailing list > [email protected] > http://univ.uniyar.ac.ru/mailman/listinfo/lftp > --000000000000310a970590d9b385 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto"><div>Try adding a tilde at the end of url.<br><br><div cl= ass=3D"gmail_quote"><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 <<a href=3D"mailto:kev= [email protected]">[email protected]</a>>:<br></div><bl= ockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #= ccc solid;padding-left:1ex">In a scripted and automated process, it seems b= eneficial 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 'put /path/to/data/upload.txt;' -u username:password ftps:/= /<a href=3D"http://server.example.net/" rel=3D"noreferrer noreferrer" targe= t=3D"_blank">server.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> =C2=A0 ---- CWD path to be sent is `/'<br> =C2=A0 <--- 200 Command OPTS succeed<br> =C2=A0 ---> CWD /<br> =C2=A0 <--- 550 Permission denied<br> =C2=A0 cd: Access failed: 550 Permission denied (/)<br> <br> How does one prevent lftp from sending CWD / to this server<br> <br> =C2=A0 <--- 230 User logged in<br> =C2=A0 ---> FEAT<br> =C2=A0 <--- 211-Extensions supported<br> =C2=A0 <---=C2=A0 =C2=A0 =C2=A0SIZE<br> =C2=A0 <---=C2=A0 =C2=A0 =C2=A0XMD5<br> =C2=A0 <---=C2=A0 =C2=A0 =C2=A0XSHA1<br> =C2=A0 <---=C2=A0 =C2=A0 =C2=A0XSHA256<br> =C2=A0 <---=C2=A0 =C2=A0 =C2=A0XSHA512<br> =C2=A0 <---=C2=A0 =C2=A0 =C2=A0XQUOTA<br> =C2=A0 <---=C2=A0 =C2=A0 =C2=A0LANG EN, ES, FR, GE<br> =C2=A0 <---=C2=A0 =C2=A0 =C2=A0MDTM<br> =C2=A0 <---=C2=A0 =C2=A0 =C2=A0MLST size*;type*;perm*;create*;modify*;<b= r> =C2=A0 <---=C2=A0 =C2=A0 =C2=A0REST STREAM<br> =C2=A0 <---=C2=A0 =C2=A0 =C2=A0TVFS<br> =C2=A0 <---=C2=A0 =C2=A0 =C2=A0UTF8<br> =C2=A0 <---=C2=A0 =C2=A0 =C2=A0AUTH SSL;TLS-P;<br> =C2=A0 <---=C2=A0 =C2=A0 =C2=A0PBSZ<br> =C2=A0 <---=C2=A0 =C2=A0 =C2=A0PROT C;P;<br> =C2=A0 <--- 211 end<br> =C2=A0 ---> PWD<br> =C2=A0 <--- 257 "/username/folder" is current directory<br> =C2=A0 ---> PBSZ 0<br> =C2=A0 <--- 200 PBSZ=3D0<br> =C2=A0 ---> PROT P<br> =C2=A0 <--- 200 PRIVATE data channel protection level set<br> =C2=A0 ---> LANG<br> =C2=A0 <--- 200 Default languages set to EN<br> =C2=A0 ---> OPTS UTF8 ON<br> =C2=A0 <--- 200 Command OPTS succeed<br> =C2=A0 ---> OPTS MLST size;type;perm;modify;<br> =C2=A0 ---- 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> =C2=A0 cd: Access failed: 550 Permission denied (/)<br> =C2=A0 ---> TYPE I<br> =C2=A0 <--- 200 Transfer mode set to BINARY<br> =C2=A0 ---> PASV<br> =C2=A0 <--- 227 Entering Passive Mode (10,10,35,21,195,225).<br> =C2=A0 ---- Address returned by PASV seemed to be incorrect and has been fi= xed<br> =C2=A0 ---- Connecting data socket to (nnn.nnn.nnn.nnn) port 50145<br> =C2=A0 ---- Data connection established<br> =C2=A0 ---> ALLO 148891<br> =C2=A0 <--- 200 Command ALLO succeed<br> =C2=A0 ---> STOR upload.txt<br> =C2=A0 <--- 150 Uploading in BINARY file upload.txt<br> =C2=A0 Certificate: ...<br> =C2=A0 Issued by: ...<br> =C2=A0 Trusted<br> =C2=A0 WARNING: Certificate verification: hostname checking disabled<br> =C2=A0 ---- Closing data socket<br> =C2=A0 <--- 226 Transfer completed<br> =C2=A0 ---> SITE UTIME 20190819100016 upload.txt<br> =C2=A0 <--- 550 Command SITE failed<br> =C2=A0 ---> QUIT<br> =C2=A0 ---- 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 /"<b= r> 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> --000000000000310a970590d9b385-- --===============5038617087681569325== 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 --===============5038617087681569325==--