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

Advertisement

nashtf
Joined:
Posts:
2

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

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?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,276
Location:
Prague, Czechia

Re: Fail to send using passphrase when executed from SSIS Script Task in a deployed package

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.

Reply with quote

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.

        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);
            }
        }

Reply with quote

martin
Site Admin
martin avatar

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".

Reply with quote

Advertisement

You can post new topics in this forum