FluentFTP icon indicating copy to clipboard operation
FluentFTP copied to clipboard

NullReferenceException in GetObjectInfo

Open MartinDemberger opened this issue 6 years ago • 0 comments

FTP OS: UNIX

FTP Server: ProFTPD

Computer OS: Windows 10

I have a loop which does a GetObjectInfoAsync, and OpenReadAsync for many files in a row. Very often there is a NullReferenceException in GetObjectInfoAsync because reply.InfoMessages is NULL. When I execute the call of GetObjectInfoAsync again it's working as expected.

The FTP server is hosted by a customer so I can't give you all details about it.

I can debug the request so if you can give me some hint where to look at I can do this.

Logs :

# Connect()
Status:   Connecting to ***:21
Response: 220 ProFTPD 1.3.5rc3 Server (***) [::ffff:***]
Command:  AUTH TLS
Response: 500 AUTH not understood
Exception thrown: 'FluentFTP.FtpSecurityNotAvailableException' in FluentFTP.dll

# Connect()
Command:  QUIT
Response: 221 Goodbye.
Status:   Disposing FtpSocketStream...
Status:   Connecting to ***:21
Response: 220 ProFTPD 1.3.5rc3 Server (***) [::ffff:***]
Command:  USER ***
Response: 331 Password required for ***
Command:  PASS ***
Response: 230 User *** logged in
Command:  FEAT
Response: 211 End
Response: 211-Features:
Response: UTF8
Response: EPRT
Response: EPSV
Response: MDTM
Response: TVFS
Response: MFMT
Response: SIZE
Response: LANG en-US.UTF-8;en-US*
Response: MFF modify;UNIX.group;UNIX.mode;
Response: REST STREAM
Response: MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*;
Status:   Text encoding: System.Text.UTF8Encoding
Command:  OPTS UTF8 ON
Response: 200 UTF8 set to on
Command:  SYST
Response: 215 UNIX Type: L8
Status:   Auto-detected UNIX listing parser

# GetObjectInfo("/***/***1***.jpg", False)
Command:  MLST /***/***1***.jpg
Response: 250 End of list
Response: 250-Start of list for /***/***1***.jpg
Response: 250-modify=20090202103231;perm=adfr;size=1052688;type=file;unique=FD01U30053A;UNIX.group=1001;UNIX.mode=0644;UNIX.owner=1002; /***/***1***.jpg

# OpenReadAsync("***/***1***.jpg", Binary, 0)
Command:  TYPE I
Response: 200 Type set to I

# GetFileSizeAsync("***/***1***.jpg")
Command:  SIZE ***/***1***.jpg
Response: 213 1052688

# OpenPassiveDataStreamAsync(AutoPassive, "RETR ***/***1***.jpg", 0)
Command:  EPSV
Response: 229 Entering Extended Passive Mode (|||46287|)
Status:   Connecting to ***:46287
Command:  RETR ***/***1***.jpg
Response: 150 Opening BINARY mode data connection for ***/***1***.jpg (1052688 bytes)
Status:   Disposing FtpSocketStream...

# GetObjectInfo("/***/***2***.jpg", False)
Status:   There is stale data on the socket, maybe our connection timed out or you did not call GetReply(). Re-connecting...
Status:   The stale data was: 226 Transfer complete
Status:   Disposing FtpSocketStream...

# Connect()
Status:   Connecting to ***:21
Response: 220 ProFTPD 1.3.5rc3 Server (***) [::ffff:***]
Command:  USER ***
Response: 331 Password required for ***
Command:  PASS ***
Response: 230 User *** logged in
Command:  FEAT
Response: 211 End
Response: 211-Features:
Response: UTF8
Response: EPRT
Response: EPSV
Response: MDTM
Response: TVFS
Response: MFMT
Response: SIZE
Response: LANG en-US.UTF-8;en-US*
Response: MFF modify;UNIX.group;UNIX.mode;
Response: REST STREAM
Response: MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*;
Status:   Text encoding: System.Text.UTF8Encoding
Command:  OPTS UTF8 ON
Response: 200 UTF8 set to on
Command:  SYST
Response: 215 UNIX Type: L8
Status:   Auto-detected UNIX listing parser
Command:  MLST /***/***2***.jpg
Response: 250 End of list
Response: 250-Start of list for /***/***2***.jpg
Response: 250-modify=20110510114025;perm=adfr;size=1969962;type=file;unique=FD01U300327;UNIX.group=1001;UNIX.mode=0644;UNIX.owner=1002; /***/***2***.jpg

# OpenReadAsync("***/***2***.jpg", Binary, 0)

# GetFileSizeAsync("***/***2***.jpg")
Command:  SIZE ***/***2***.jpg
Response: 550 SIZE not allowed in ASCII mode

# OpenPassiveDataStreamAsync(AutoPassive, "RETR ***/***2***.jpg", 0)
Command:  EPSV
Response: 229 Entering Extended Passive Mode (|||12148|)
Status:   Connecting to ***:12148
Command:  RETR ***/***2***.jpg
Response: 150 Opening ASCII mode data connection for ***/***2***.jpg (1969962 bytes)
Status:   Disposing FtpSocketStream...

# GetObjectInfo("/***/7***3***.jpg", False)
Command:  MLST /***/7***3***.jpg
Response: 226 Transfer complete
Exception thrown: 'System.NullReferenceException' in FluentFTP.dll
Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.


MartinDemberger avatar Oct 15 '18 20:10 MartinDemberger