1

I have a C# terminal application that I've been running on my personal development pc so far. The application makes use of FTP to retrieve some files. For simple downloads of specific files through FTP I just make use of a regular System.Net.WebClient and fill out NetworkCredentials with username and password, but the application also makes use of FluentFTP for some of the more intricate FTP uploads needed.

This is basically how I connect using FluentFTP:

using (FtpClient ftp = new FtpClient(FTP_URL)
{
ftp.Credentials = new NetworkCredential(USER, PASSWORD);
ftp.Connect(); //Or run any ftp command... 
}

When I run the terminal program on a windows 2019 server, and it tries to connect using FluentFTP, it stops the connection suddenly with a FluentFTP.FTPCommandException and no other information written in the Exception stack. I tried logging the FTP-trace and this is what I got: FTP-Trace log on Windows 2019 Server It seems to suddenly cut out without an error code.

I've tested it on my local development machine and it works here: FTP-Trace log on local development pc

I tried to look if it was something related to login or similar, but when the login credentials are wrong, this is the result. It comes with a 530 Response: FTP-Trace log on local developmen pc when password is wrong

I thought about firewall and port problems on the server as well, but what baffles me is that the simple downloading via FTP through System.Net.WebClient seems to work fine on the server.

If there's anyone who has any ideas how I might tackle this roadblock then I'd very much appreciate the help!

EDIT

I've copied out the properties of the FtpClient when running on the server and the local pc, and it seems like there are some differences :

Local pc

Capabilities=SIZE, MDTM

HashAlgorithms=NONE

EncryptionMode=None

DataConnectionEncryption=True

PlainTextEncryption=False

SslProtocols=Default

SystemType=Windows_NT

ServerType=Unknown

ServerOS=Windows 

  Windows server

Capabilities=NONE

HashAlgorithms=NONE

EncryptionMode=None

DataConnectionEncryption=True

PlainTextEncryption=False

SslProtocols=Default

SystemType=UNKNOWN

ServerType=Unknown

ServerOS=Unknown

Yous0147
  • 301
  • 3
  • 10
  • What message does the `FTPCommandException` carry? + Please don't post logs as images, post them as a text. – Martin Prikryl Apr 30 '19 at 06:05
  • The odd thing is that the FTPCommandException doesn't carry any message. It only shows the stack of methods leading up to where the exception happens – Yous0147 Apr 30 '19 at 07:24
  • Did you try to capture the connecting using a tool like Wireshark? – Martin Prikryl Apr 30 '19 at 07:24
  • No I've not tried that yet, it's not something I'm used to doing, but I'll check and see if I can do that – Yous0147 Apr 30 '19 at 07:35
  • I could see the connection through wireshark but there wasn't much in terms of added information from what is already written on the trace. It seems like the request just makes it QUIT right after a PASS request is made. It's no problem anymore though, I tried moving the code over to another server and there it works fine. The former Windows server was on Azure, and it seems like something there made it not work right – Yous0147 Apr 30 '19 at 08:18

0 Answers0