Forum Discussion

ragera4's avatar
ragera4
New Contributor II
8 years ago

Connecting Windows based SFTP servers using SnapLogic

Hello,

We’re trying to connect with Windows-based SFTP server in order to read data files, but getting the error as -

“error”: “Unable to read from sftp://sftp server//readme.txt
“reason”: “Cannot open input stream for sftp://sftp server/readme.txt”
“resolution”: “Check for URL syntax and file access permission”

This is a very critical time of our program and any help or lead would be much appreciated.

Thanks!

11 Replies

  • tszrejter's avatar
    tszrejter
    New Contributor

    On our Linux based node servers, we have found that often we need to first make the SFTP connection directly from the host, as it will often prompt you to store the fingerprint of the server. Making the initial connection from a snap does not seem to allow us to do that. You may want to try validating that the Windows server can make the SFTP connection first before trying in your snap.

    Tim

  • Assuming that you ARE using the basic file permission, and the domain name like “sftp server” is the one on the valid and recognized CA cert, you might want to validate that the port number is right, and that the case of the file names and directories are right. Some ssl implementations are touchy.

    • ragera4's avatar
      ragera4
      New Contributor II

      Thanks for the response @stephenknilans.

      Port number, file names, and directories are correct, but still, we’re getting the same error.

      Furthermore, in the above post, I’ve replaced the actual server name with “sftp server” just to any client-related information.

      Please let us know!

      • stephenknilans's avatar
        stephenknilans
        Contributor

        I figured you just changed the name. I’ve been hiding such information also on my side. I’m just someone trying to help. I don’t know what to say at this point, but I am sure snaplogic support can look into it more.

        Steve

  • del's avatar
    del
    Contributor III

    I’ve found that sometimes FTP connections don’t interpret the file paths the same when logging on with an FTP UI client vs. when logging on with a service application like SnapLogic. The UI client might place you into the logged-in account’s home directory where /readme.txt might work while the application might require a full start-from-root path. So you might look at modifying the path to sftp://server name/repository path/login name/readme.txt or something similar.

    • Joy's avatar
      Joy
      New Contributor II

      Have you found a way to search the account’s home directory without hard coding that portion of the path?

      • stephenknilans's avatar
        stephenknilans
        Contributor

        Joy,

        One way you can you this on windows is to pretend that the directory in the home directory is the ROOT of what you want, and prefix it with:

        %LOCALAPPDATA%....

        SO, if you were a user with a home directory of \users\joy and wanted to save things in JUNK, just use:

        %LOCALAPPDATA%....\JUNK

        If HENRY had a directory \users\HENRY, the directory would be \users\HENRY\JUNK. Just realize that this is based on the user that actually STARTED the process.

        There are supposedly simpler ways, but this was the first one I found that worked for ME.

  • tstack's avatar
    tstack
    Former Employee

    There might be more information in the stack trace, you can click the ‘Show Details…’ link in the Pipeline Execution Statistics dialog to reveal that extra stuff.

  • ricardoTyson's avatar
    ricardoTyson
    New Contributor II

    well you most likely solved it already but for anyone that comes to your post something similar happened to me, it was all fine but the snaplex I was using was the wrong one, It was set by default to one that pointed to google cloud and all I had to do was changing the snaplex to one that we had that pointed to aws, and it just worked! (and putting the url between double quotes, having the = button pressed)