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

Authorizing using http-01 validation (FTP) - upload Failed #2178

Closed
svarga91 opened this issue Jul 24, 2022 · 6 comments
Closed

Authorizing using http-01 validation (FTP) - upload Failed #2178

svarga91 opened this issue Jul 24, 2022 · 6 comments

Comments

@svarga91
Copy link

svarga91 commented Jul 24, 2022

public async Task Upload(string ftpPath, string content)

2022-07-24 13:55:37.736 +02:00 [INF] [xxx.com] Authorizing using http-01 validation (FTP)
2022-07-24 13:55:37.959 +02:00 [INF] Established connection with ftp server at 19.105.158.190:21, encrypted: true
2022-07-24 13:55:38.126 +02:00 [WRN] Upload ftp://19.105.158.190:21/www/.well-known/acme-challenge/2pRO5RqE3-aO3ig3XqUhwNtHDu-2FLfylhG7rxKF1u0 status "Failed"

File is created but is empty.

@WouterTinus
Copy link
Member

Do you have a log from the FTP servers side?

@svarga91
Copy link
Author

svarga91 commented Jul 24, 2022

I tried to use latest version of FluentFTP but still the same issue. File is created but empty.

var status = await client.UploadBytesAsync(Encoding.UTF8.GetBytes(content), uri.PathAndQuery, FtpRemoteExists.Overwrite, true);

I dont have access to ftp logs. I will have to setup some ftp server on localhost.

@WouterTinus
Copy link
Member

You can try adding this code to capture log output from the client side, that might provide some insights:

client.OnLogEvent += (level, message) =>
{
    switch (level)
    {
        case FtpTraceLevel.Verbose:
            _log.Verbose("FTP: {message}", message);
            break;
        case FtpTraceLevel.Info:
            _log.Information("FTP: {message}", message);
            break;
        case FtpTraceLevel.Warn:
            _log.Warning("FTP: {message}", message);
            break;
        case FtpTraceLevel.Error:
            _log.Error("FTP: {message}", message);
            break;
    }
};`

@WouterTinus
Copy link
Member

Additional logs are captured in v2.1.23 and FluentFTP was updated to the latest release.

@svarga91
Copy link
Author

svarga91 commented Oct 3, 2023

Thank you. It looks like old server version issue.
See related robinrodricks/FluentFTP#1219 (comment)

I also got Received an unexpected EOF or 0 bytes from the transport stream.

@svarga91
Copy link
Author

FYI: using the GnuTLS library instead of Microsoft's native TLS solved my problem.
Thank you for such a great tool 😄

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

No branches or pull requests

2 participants