Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL job failed Expand / Collapse
Author
Message
Posted Saturday, July 6, 2013 9:04 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, November 20, 2014 2:13 AM
Points: 37, Visits: 123
I did an SFTP to command the job via winSCP.

I manage to run execute it in SSIS.

When I try to schedule it in SQL Agent, I'm getting this error:

Code: 0xC002914C Source: Execute Process Task Execute Process Task Description: The process timed out. End Error DTExec: The package execution returned DTSER_FAILURE (1).

I did set password EncryptSensitiveWithPassword.

In the SQL agent job it manage to pump in the data to my local folder but will hit the error as above to SFTP over.

Execute in SSIS is successful.

How can I fix this?
Post #1470960
Posted Sunday, July 7, 2013 3:42 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 12:39 AM
Points: 13,630, Visits: 11,503
Maybe a permission issue with the SQL Agent account?
Did you use a proxy to run the SSIS job step?

You can try to log the details of the winscp command to a log file. Add > log.txt add the end of your command.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1470995
Posted Monday, July 8, 2013 5:57 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Yesterday @ 10:40 AM
Points: 64, Visits: 805
At a guess, I would say that WinSCP is prompting for a password it never receives.

How are you logging into your target SFTP server? Are you using its in-built stored sessions to store a password (or private key)?

If so, the sessions are stored in a user-specific registry key (HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\Sessions). This will not be the same for your user as for the user running your SQL Server Agent.

Two options I can think of (if this is indeed the issue):

1. Define a proxy account for the user that stored the session in WinSCP, and run the WinSCP step/job under that proxy account

2. Export the WinSCP user-specific registry keys and import them into the user hive for the user running your SQL Server Agent

For example, if your SQL Server Agent is running as NETWORK SERVICE:
1. Open REGEDIT
2. Navigate to the "HKEY_CURRENT_USER\Software\Martin Prikryl" key
3. Right-click the "WinSCP 2" key and choose Export - specify a filename
4. Open that file with a good text editor
5. Replace all instances on "HKEY_CURRENT_USER" with "HKEY_USERS\S-1-5-20" and save
6. In REGEDIT, go to File >> Import, and select your edited .reg file

Now NETWORK SERVICE should have the same saved sessions as your own user account.

(I should point out that manual fudging of the Registry, without knowing what you are doing and without a really good, thoroughly tested backup is a really bad idea -- make sure you test this on a non-essential test server, and have a good backup of your production first)

HTH
J.
Post #1471131
Posted Monday, July 8, 2013 8:15 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, November 20, 2014 2:13 AM
Points: 37, Visits: 123
i hit error accessing the registry during importing.
Post #1471413
Posted Tuesday, July 9, 2013 6:52 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 12:26 AM
Points: 5,308, Visits: 12,336
girl_bj0619 (7/8/2013)
i hit error accessing the registry during importing.


The package failed with a registry-access error while you were performing an import?

What was the error message?



Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.

It is better to keep your mouth shut and appear stupid than to open it and remove all doubt. (Mark Twain)
Post #1471589
Posted Tuesday, July 9, 2013 7:36 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, November 20, 2014 2:13 AM
Points: 37, Visits: 123
Cannot import. Error accessing the registry.
Post #1471913
Posted Wednesday, July 10, 2013 12:27 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 12:26 AM
Points: 5,308, Visits: 12,336
girl_bj0619 (7/9/2013)
Cannot import. Error accessing the registry.


You did not answer my first question and your error message was not the exact error message which you received.

If you provide only snippets of detail rather than the full story, it makes it very difficult for me to understand what is going on.



Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.

It is better to keep your mouth shut and appear stupid than to open it and remove all doubt. (Mark Twain)
Post #1471960
Posted Wednesday, July 10, 2013 12:35 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, November 20, 2014 2:13 AM
Points: 37, Visits: 123
I hit that error on after trying on steps number:

6. In REGEDIT, go to File >> Import, and select your edited .reg file

That's the error I get.
Post #1471964
Posted Wednesday, July 10, 2013 12:55 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 12:26 AM
Points: 5,308, Visits: 12,336
Right - sounds like you have limited rights on that PC. Can you find someone with local admin rights who can do it for you?


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.

It is better to keep your mouth shut and appear stupid than to open it and remove all doubt. (Mark Twain)
Post #1471976
Posted Wednesday, July 10, 2013 2:57 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Yesterday @ 10:40 AM
Points: 64, Visits: 805
girl_bj0619 (7/9/2013)
Cannot import. Error accessing the registry.


If you don't have the OS privileges to globally edit your Registry, you'll need the assistance of your server administrators. If you can't get their assistance, you will have to go with the first option of running your job with a proxy account.

Of course, if you don't have the SQL Server privileges to create a proxy account, you're going to need to ask your DBA.

Otherwise, perhaps you can do your SFTP using an .NET Script Task, linking in a reputable SFTP library. http://winscp.net/eng/docs/library_ssis has an example. However, you may need to ask your server administrators to import the library into the central store for .NET assemblies (the GAC).
Post #1472373
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse