lavv17 / lftp

sophisticated command line file transfer program (ftp, http, sftp, fish, torrent)
http://lftp.yar.ru
GNU General Public License v3.0
1.08k stars 159 forks source link

How to get more details in log #712

Open velle opened 10 months ago

velle commented 10 months ago

I asked this on Unix.StackExchange.com 9 months ago (link to post), but got no feedback. I hope its ok to ask here.

Even with the log level 9, I only get very little output in the log:

2022-11-28 18:03:10 ftp.dataforsyningen.dk ---- Resolving host address...
2022-11-28 18:03:10 ftp.dataforsyningen.dk ---- IPv6 is not supported or configured
2022-11-28 18:03:10 ftp.dataforsyningen.dk ---- 1 address found: 188.64.158.165
2022-11-28 18:03:16 ftp.dataforsyningen.dk ---- Connecting to ftp.dataforsyningen.dk (188.64.158.165) port 990
2022-11-28 18:04:16 ---- Closing control socket 

The last line comes after I press ctrl+c. Is that really all that is logged? If not, how can I get to see more info, that will help me solve the issue.

Sincerely

gpatel-fr commented 9 months ago

Try

lftp -d ftps://ftp.dataforsyningen.dk

velle commented 9 months ago

Try

lftp -d ftps://ftp.dataforsyningen.dk

Could you please explain what that is supposed to do? I can see in the manual entry, that "-d" is an option, but I don't see what it's supposed to do.

I tried running lftp with and without "-d", and I don't see any difference.

gpatel-fr commented 9 months ago

lftp -h can help you here. -d turns on debugging, but it's not what matters; the difference comes from using the ftps:// prefix that says to lftp that it should use implicit tls.

velle commented 9 months ago

First of all. By adding the ftps prefix to the protocol (ftps://ftp.dataforsyningen.dk) I actually managed to connect properly. Thanks :)

With regards to the -d flag. Unfortunately I did not consider calling lftp -h, and only looked in the man pages. In any case, is it not an error that the meaning of this flag is not described in the man pages as well? Or is there a good explanation why it is left out of the man pages?

gpatel-fr commented 9 months ago

I find in the man page:

OPTIONS -d Switch on debugging mode.

as of your original question, it seems IMO answered: you could not have more info in the logs because the software is stuck trying to establish a TLS connection while it is already connected in TLS mode. Maybe it could detect this use case and display an error before trying to connect, but implicit TLS mode is not loved much (some want it to disappear in fact) so there is not much work on it.

For reference, I am not the project owner and have only contributed a small unmerged PR, so I'm not at all speaking for the project.

velle commented 9 months ago

I find in the man page:

OPTIONS -d Switch on debugging mode.

Appologies. I actually looked several times, but still missed it. But it is there. It is just in the very bottom, after the very long part about the commands inside lftp (some of which also take a -d parameter).

the software is stuck trying to establish a TLS connection while it is already connected in TLS mode

I did not understand that until just now, and I'm not even sure if I fully understand now. But thanks :) So exactly where does it hang? Does it actually send any messages to the server? Or does it not even get that far?

I assumed that this negotiation consisted of several steps with several messages back and forth, where server and client would agree which protocol and which version, or eventually decide that they could not agree on a solution. I expected to see each step/message in that negotiation, when on the highest logging level.

I was able to connect with FileZilla, and got a whole lot of logging details from FileZilla. My original plan was to get a detailed log from lftp too, and then by comparing FileZilla and lftp logs, I could tell what was different / what went wrong with my lftp attempt.

For reference, I am not the project owner and have only contributed a small unmerged PR, so I'm not at all speaking for the project.

I appreciate very much that you are replying :)

gpatel-fr commented 9 months ago

To be more precise:

edit: I wrote first 'the server is connecting in plain text...', it was decidedly written too fast.