Azure logic app SFTP Get File Content Using Path fails with bad gateway

Alex_404 21 Reputation points
2021-03-08T16:09:58.91+00:00

I have a logic app which previously was getting a .zip file from an FTP server. Now the server is changed to a new SFTP server and I'm trying to update the app in the azure web portal. I'm using an SFTP connection with password. The app reads the file's metadata first and this task is working - it returns the file's timestamp and size.

Next task is "Get File Content Using Path" - targeting the same file. This task fails with error 502 - Bad Gateway: Failed to read file.

I have manually checked the file with WinSCP - the .zip file is fine, I can read or copy it.

Any ideas what this could be?

The weird part is the metadata working. I've seen mentions of IP not being whitelisted causing this - but shouldn't metadata task fail in that case too? Also, I'm modifying an app that was working before, although with an FTP server.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,842 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Mike Urnun 9,666 Reputation points Microsoft Employee
    2021-03-10T09:00:50.683+00:00

    Hi @Alex_404 - Welcome to MS QnA, and thank you for posting here!

    I'm not sure exactly what kind of SFTP server you're running, but based on my findings, this issue can happen if your SFTP server has its ExtractableCount setting set to 1 which is usually its default value: https://www.ibm.com/support/pages/message-extractable-count-set-1-default

    If you locate this setting in your SFTP server configs and are able to change it, can you increase it to 3 (or 4?) and then try running your Logic App workflow again?

    The SFTP-SSH connector works well when a higher value is set for the ExtractableCount setting on the SFTP server side, especially, If you have chunking enabled and/or processing large files. Also, note that Logic Apps uses different operation sequence from WinSCP, so the two have different behaviors. I hope this is helpful, let me know if any questions :)


  2. Alberto Chayo 1 Reputation point
    2022-10-12T18:14:12.353+00:00

    @Alex_404 , I am experiencing a similar issue. Please let us know if the proposed solution (or any other) worked.

    0 comments No comments