Error with SFTP adapter

Girish Patil 1 Reputation point
2022-08-25T10:41:16.17+00:00

I am getting following error while trying to poll the data from SFTP location.

The adapter "SFTP" raised an error message. Details "Microsoft.BizTalk.Adapter.Sftp.SftpAdapterException: Failed to get the list of files to download from the SFTP server. ---> System.InvalidOperationException: Session is not opened
at WinSCP.Session.CheckOpened()
at WinSCP.Session.ListDirectory(String path)
at Microsoft.BizTalk.Adapter.Sftp.SftpFileReceiver.PollSftpServer()

Any idea what needs to be change in order to fix this problem?

BizTalk Server
BizTalk Server
A family of Microsoft server products that support large-scale implementation management of enterprise application integration processes.
{count} votes

3 answers

Sort by: Most helpful
  1. Colin Dijkgraaf 1,601 Reputation points
    2022-08-28T22:36:03.02+00:00

    Try the following, as per my blog article Max worker threads for SFTP, MQSC or DB in BizTalk

    1. Have a dedicated host for receive locations using SFTP
    2. Increase the Maximum Worker threads setting to 500 on that host instance
    3. Check how frequently you poll (the default is 5 seconds), increase the delay if that is not needed.
    4. Put a schedule on to only poll during the periods you need.
    5. Disable message body tracking if it is not needed.
    2 people found this answer helpful.
    0 comments No comments

  2. Züger Armin 0 Reputation points
    2023-03-03T10:09:45.0333333+00:00

    Had the same issue (BizTalk 2016 with latest CU). Increasing the polling interval (5 sec->5min or even more) did the trick.

    0 comments No comments

  3. AG 1 Reputation point
    2022-08-29T08:27:59.067+00:00

    I have the same error, following Colin´s suggestions did not help in my case
    Im using biztalk 2020 CU4 and winscp 15.9.2

    I can connect and download files using winscp console though.

    Any ideas would be greatly appriciated!


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.