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

ERROR when Executing a Job within SQL Server Agent from an SSIS package. SQL Server 2012, Visual Studio 2010 Expand / Collapse
Author
Message
Posted Wednesday, July 16, 2014 5:29 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, August 20, 2014 2:55 PM
Points: 5, Visits: 7
Hello,
I created an SSIS package within Visual Studio 2010 that takes data from cURL, exports to a XML file then imports into a specified database, and it executes fine.
I then created a job within SQL Server Agent, to attempt to schedule this SSIS package. The job I am testing only contains one step; run the package created within SSIS.
When I "Start Job at Step" the first action of "Start Job [Job Name]" is a success. The second action of "Execute Job [Job Name] errors.
Once I go to the Package within SSMS, right click, Reports\Standard Reports\ All Executions, I see my Job failed. I click on "All Messages" for my Job. And I get the following Error:

Execute Process Task:Error: In Executing "\\CRN-EDW-01\InContact\Config File\1.bat" ""at"", The process exit code was "23" while the expected was "0".


For the life of me, I cannot find anything that references this exit code, nor can I figure out what the problem is. I have messed around with user rights within SSMS, as well as sharing the folders that the cURL is trying to access. The thing that really gets me is that the execution of the SSIS Package works fine, yet when it is ran as a job it errors.
Please help :)
Thanks
Post #1593328
Posted Wednesday, July 16, 2014 5:37 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 9:51 AM
Points: 5,446, Visits: 7,616
The exit code comes from something in the .bat file, not SSIS. My guess is you've got a double-hop of some kind going on, messing with the rights to whatever it's doing.


- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Post #1593330
Posted Wednesday, July 16, 2014 5:42 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, August 20, 2014 2:55 PM
Points: 5, Visits: 7
What do you mean by "double-hop"? I apologize, but I am still learning most of this.
I am using the .bat file as a means to pull from cURL. A vendor provided me with the cURL information.
First it accesses the drive where the cURL.exe file is located: \\CRN-EDW-01\InContact\curl-7.28.0\curl
Second it outputs to a certain file: -o \\CRN-EDW-01\InContact\InContact\data\1.xml
Then there is some sort of "k" command that was provided to me by the vendor.

The weird thing is, is that it works fine when executed manually, but as a job it gives the error.
Any ideas?

Thank you!!
Post #1593332
Posted Wednesday, July 16, 2014 5:53 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 9:51 AM
Points: 5,446, Visits: 7,616
Apologies, I forget not everyone has beaten their heads on authentication before. Oops.

I have no idea what cURL is or any of that, unfortunately. I couldn't tell you what's going on under the hood. However, the troubleshooting you've done leads me to believe it's the job causing the issue, not the code itself. The most likely problem when you can manually run something, but a job can't, is one of a few issues.

First, a job runs under the authentication of the SQL Agent. That Agent has a login defined in the services on the box it's installed on. You need to find out that user, and confirm that they have equivalent access that you do to be able to run all the necessary pieces. It may not have access to one or more files/directories.

If that's all well and good, then you need to determine if you're dealing with a Kerberos double-hop issue. Google that and you'll find reams of information on the problem, but the root cause is this: If your network isn't setup the way you need, authentication only can visit one server out. Otherwise it needs the equivalent of a repeater to send that security token to the next place. So, if your .bat is then calling for something on another machine, it may (note, may. Talk to your sysadmins) not be able to pass it along to the next one. Usually my office uses wireshark to determine when there's a problem of this nature.

From there, keep examining security possibilities. That is the 99% cause (in some form) when SQL Agent won't work, but you can manually run things.



- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Post #1593336
Posted Wednesday, July 16, 2014 6:03 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, August 20, 2014 2:55 PM
Points: 5, Visits: 7
Thank you. I will look into the SQL Agent access and post any successes.
My .bat file is not attempting to access any networks, it is only accessing the local machine (Though the server is a VM, but I don't believe that has anything to do with this.)

Post #1593339
Posted Thursday, July 17, 2014 3:44 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, August 20, 2014 2:55 PM
Points: 5, Visits: 7
Thank you again for your help.
After banging our heads for a couple of hours, we simply added "Everyone" as a Read/ Write user to the drive we were accessing the cURL file from within the Job, and BING, it worked!
RESOLVED!
Post #1593858
Posted Friday, July 18, 2014 2:25 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 9:51 AM
Points: 5,446, Visits: 7,616
I'd... be careful of considering that resolved. Even anonymous logins can get access with that security setting. However, you've confirmed, decisively, that it's security.

Now you just need to figure out why at some point.

Glad you got it working, however.



- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Post #1594229
Posted Friday, July 18, 2014 2:28 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, August 20, 2014 2:55 PM
Points: 5, Visits: 7
Kraig
You are correct that Anonymous logins would be a concern, but this server has tight security for login access.
Thank you
Post #1594235
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse