Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get more details in log #712

Open
velle opened this issue Sep 1, 2023 · 7 comments
Open

How to get more details in log #712

velle opened this issue Sep 1, 2023 · 7 comments

Comments

@velle
Copy link

velle commented Sep 1, 2023

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
Copy link
Contributor

Try

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

@velle
Copy link
Author

velle commented Sep 9, 2023

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
Copy link
Contributor

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
Copy link
Author

velle commented Sep 10, 2023

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
Copy link
Contributor

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
Copy link
Author

velle commented Sep 10, 2023

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
Copy link
Contributor

gpatel-fr commented Sep 10, 2023

To be more precise:

  • the server is expecting to talk TLS and only TLS. It accepts a connection and expects a TLS Hello from the client. So it does not say anything
  • the client is connecting in plain text mode, so it expects the FTP server banner.
    Both sides are waiting.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants