Topic "Fail to send using passphrase when executed from SSIS Script Task in a deployed package"

Author Message
nashtf
[View user's profile]

Joined: 2017-09-06
Posts: 2
I'm using a C# script task in SSIS 2012 which uses a WinSCP assembly. It works fine using SFTP without a public key, but passing the Passphrase parameter causes it to fail. I've tried generating the SessionOptions first before opening the connection, but it fails. I've eliminated possibility of file paths and permissions as it runs perfectly well from my local machine, but it fails when deployed to the server. Server packages work perfectly fine when there is a password passed in, but fail with Passphrase. Is there an issue with the Passphrase parameter and certain build versions?
Advertisements
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26705
Location: Prague, Czechia
Sorry, but "fail" is too vague.

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
Guest




I don't even get to creating the session. I've stripped down my code to this and it fails. The exception message doesn't even get printed to the report when running through Integration Services Catalogs. This runs perfectly fine on my local machine through Visual Studio debug mode.

Code:
        public void Main()
        {
            try
            {
                SessionOptions sessionOptions = new SessionOptions
                {
                    Protocol = Protocol.Sftp,
                    HostName = "host.site.com",
                    UserName = "user",
                    SshHostKeyFingerprint = "ssh-rsa 2048 fingerprint"
                    PrivateKeyPassphrase = "password",
                    SshPrivateKeyPassphrase = @"C:\Path\To\Key"
                };
            }
            catch (Exception e)
            {
                Dts.Events.FireError(-1, "Session setup", e.Message, String.Empty, 0);
            }
        }
nashtf
[View user's profile]

Joined: 2017-09-06
Posts: 2
The path is of course a valid path to the server, not a local path. Just put a local path for placeholder purposes.
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26705
Location: Prague, Czechia
Still, "it fails" is too value. You must get some error message or some error code at least. I do not believe that all information that you have is "it fails".
Advertisements

You can post new topics in this forum

Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License