Skip to content

Intermittent non-specific exception from GetListingInternal() #1776

@carden-jeremy

Description

@carden-jeremy

I do daily checks of a public FTP folder to look for updated weather data, and sometimes, FluentFtp throws an exception when I call GetListing(). We have logged 77 of these exceptions since March 2025. When it works successfully, the recursive query currently returns 21,609 files.

I realize the problem could be the fault of the FTP server, but I'd appreciate it if we could get a more clear exception message from FluentFtp than "Object reference not set to an instance of an object".

Path to the FTP I'm trying to list recursively:
ftp.cpc.ncep.noaa.gov/precip/CPC_UNI_PRCP/GAUGE_CONUS/V1.0/

Exception:

Message: Object reference not set to an instance of an object.

   at FluentFTP.AsyncFtpClient.GetListingInternal(String listcmd, FtpListOption options, Boolean retry, CancellationToken token)
   at FluentFTP.AsyncFtpClient.GetListing(String path, FtpListOption options, CancellationToken token)
   at FluentFTP.AsyncFtpClient.GetListingRecursive(String path, FtpListOption options, CancellationToken token)
   at FluentFTP.AsyncFtpClient.GetListing(String path, FtpListOption options, CancellationToken token)
   at FtpClientTools.GetListOfFilesOnFtpAsync(String fullPathToFtpFolder, Boolean recursive, String username, String password)

My code:

bool recursive = true;
FtpListItem[] fileListing = await myAsyncFtpClient.GetListing(ftpPath, recursive ? FtpListOption.Recursive : FtpListOption.Auto);

FluentFtp v53.0.1

Thank you

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions