Skip to content

System.NotSupportedException: Request 'ping' is not supported. #1413

@anandgmenon

Description

@anandgmenon

I am from the Azure Logic apps team and we use the library in the SFTP connector there.
For one of the users (SFTP server used is in-house system developed using Golang) we are seeing the ListDirectory method intermittently fails with the below exception

System.NotSupportedException: Request 'ping' is not supported.
   at Renci.SshNet.Common.AsyncResult.EndInvoke()
   at Renci.SshNet.SftpClient.EndListDirectory(IAsyncResult asyncResult)
   at Microsoft.Azure.Workflows.ServiceProviders.Sftp.Clients.SftpClientWrapper.EndListDirectory(IAsyncResult asyncResult)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)

Our code looks like this

var authenticationMethods = new List<AuthenticationMethod>();

authenticationMethods.Add(new PasswordAuthenticationMethod(
    username: key.Username,
    password: key.Password));

var sftpConnectionInfo = new ConnectionInfo(
    host: key.Host,
    username: key.Username,
    port: key.Port,
    authenticationMethods: authMethods.ToArray());

client.Connect();

var directoryContents = await Task.Factory
    .FromAsync(
        beginMethod: (asyncCallback, state) => client.BeginListDirectory(
            path: targetDirectory,
            asyncCallback: asyncCallback,
            state: state),
        endMethod: client.EndListDirectory,
        state: null)
   .ConfigureAwait(continueOnCapturedContext: false);

We saw a similar issue #638 and noticed the fix is merged. However we tried with the latest bits from develop branch and noticed the issue persists.

Please provide your inisights on the issue and let us know if there's a workaround or fix possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions