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 12»»

Execute Process Task - The process exit code was "2" while the expected was "0" Expand / Collapse
Author
Message
Posted Wednesday, October 01, 2008 1:26 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, September 08, 2010 6:05 AM
Points: 1, Visits: 55
I have an SSIS that includes an Execute Process Task. The task has the executable, arguments, and working directory properties populated by myself and all other propeties are defaulted. The SSIS package and task run successfully when I manually run them from Visual Studio. I also have imported the SSIS Package Into Integrations Services and can successfully run the package if I execute it manually. When I run the SSIS package from a job, the job completes successfully, but the Execute Process Task does not run. I get the following text included in the message form the job history as it relates to the Execute Process Task:

The process exit code was "2" while the expected was "0". End Error DTExec: The package execution returned DTSER_SUCCESS (0). Started: 1:58:37 PM Finished: 1:59:17 PM Elapsed: 40.594 seconds. The package executed successfully. The step succeeded.

I believe this is related to Proxies, Credentials, Server Logins and/or Local user security. Can anyone help?
Post #579345
Posted Tuesday, March 31, 2009 1:59 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, April 09, 2014 8:42 AM
Points: 23, Visits: 137
Hi,

I had the problem Exit code not 0 in Execute process task. I first checked on command prompt that its working from command prompt.
Then I just changed the path from network style "\\sql-srv\myprojekt\proj.exe" to normal file style "D:\project\proj.exe" and it starts working.

Its strange but it worked for me

Regards

Post #686775
Posted Tuesday, March 31, 2009 3:31 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Sunday, February 16, 2014 8:48 PM
Points: 19, Visits: 93
I am also getting a similar error!

My Execute Process Task is supposed to run a batch file, which in turn is supposed to Process a Cognos cube.
The batch file contains "path to .exe" -n "Output path"

When I run the package manually, through BIDS, it is fine. The success value is set to 0.
When I run it using a SQL Server Agent Job, it fails. It reports the following error: In Executing "Path to batch file" ""at"", The process exit code was "1" while the expected was "0".
If I change the SuccessValue to 1, the Manual execution of the task/package fails. When running it using a SQL Server Agent Job, the job doesn't report an error anymore, but the cube does not update.

What am I supposed to do?
Why are these errors occurring?
Is there any way to get better or more descriptive error messages?

Please advise!

Sorry for joining in on your post, hopefully we can both get answers for our errors!!!
Post #686810
Posted Tuesday, March 31, 2009 6:03 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, April 09, 2014 8:42 AM
Points: 23, Visits: 137
I dont know exactly I am new to SSIS and trying to learn.

But it can be problem of credentials but in my case as i said before that I just changed the path and it started working.

Post #686917
Posted Monday, June 15, 2009 3:59 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, August 22, 2013 12:07 PM
Points: 9, Visits: 50
I'm wondering if you ever figured out what the problem was. Interestingly enough, I'm also encountering the same problem trying to run a batch file with WinSCP. I can run the package without any issue manually (by right-clicking and run package from SQL Server), but as soon as I tried to schedule it on the Sql Server Agent Jobs, it gives me that same error msg.

Description: In Executing "C:\Scripts\hrxfer.bat" "" at "", The process exit code was "1" while the expected was "0". End Error DTExec: The package execution returned DTSER_SUCCESS (0). Started: 2:55:00 PM Finished: 2:55:02 PM Elapsed: 1.516 seconds. The package executed successfully. The step succeeded.

Any help is appreciated.



Hesten Erwin (3/31/2009)
I am also getting a similar error!

My Execute Process Task is supposed to run a batch file, which in turn is supposed to Process a Cognos cube.
The batch file contains "path to .exe" -n "Output path"

When I run the package manually, through BIDS, it is fine. The success value is set to 0.
When I run it using a SQL Server Agent Job, it fails. It reports the following error: In Executing "Path to batch file" ""at"", The process exit code was "1" while the expected was "0".
If I change the SuccessValue to 1, the Manual execution of the task/package fails. When running it using a SQL Server Agent Job, the job doesn't report an error anymore, but the cube does not update.

What am I supposed to do?
Why are these errors occurring?
Is there any way to get better or more descriptive error messages?

Please advise!

Sorry for joining in on your post, hopefully we can both get answers for our errors!!!
Post #735352
Posted Thursday, July 02, 2009 10:09 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, April 04, 2010 12:34 AM
Points: 2, Visits: 34
We have a Process Task component setup in a couple SSIS jobs to call a GNU (gpg.exe) for decryption. The process works fine if we start the SQL Agent job (both manually or schedule) under the proxy setup account only when we leave a login session open on the server (login is the proxy account).

The process fails if there are no login session open on the server.
The exact error has to do with the gpg.exe unable to find a particular security file.

It appears the issue is associated with a need to find the security key file in the %PATH% . Is the path specified in the system enviroment available to SSIS? if not how can one specify the path? Thanks.
Post #746426
Posted Monday, July 06, 2009 4:20 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, October 21, 2013 11:43 PM
Points: 945, Visits: 1,234
Manko T,

It's probably related to the permission issues on the file directory, since the Jobs runs under the credentials of SQL Server agent, check to see if that credentials has the access to the file location.

Hope this helps.

Cheers,
Amol


Amol Naik
Post #748162
Posted Tuesday, July 07, 2009 6:23 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, April 04, 2010 12:34 AM
Points: 2, Visits: 34
Thanks for your input. The user context under which the SSIS job runs has access to the server ( system admin rights)

I actually tried different combinations of scenarios and came to the following conclusion - that might just have to do with the GnuPG application specifically - or may be a limitation of windows/SSIS.

1. The job when run by sqlAgent was unable to determine any enviroment variables and registry settings, unless the server have an existing login session of the user credentials the job runs as. the job runs under a user credential that has sys admin rights.

2. The failure of the Job was because the GnuPG application was unable to access certain files stored in the %APPDATA%\gnupg of the user credentials under which the SSIS job runs,.

3. The GnuPG application provide an option to specify the homeDir as one of the arguments the executeable (C-style args). this was then used to overcome the limitation experienced in 2 above.

I hope this will be helpful to others experiencing similar issues

rgds

Olu

Post #748464
Posted Wednesday, August 05, 2009 11:16 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, September 13, 2013 11:29 AM
Points: 1, Visits: 47
I experienced the same problem with SSIS and GnuPG for Windows (OpenSource PGP encryption tool), where the SSIS package would run locally but would not run when executed as a job by the SQL Server Agent. Two things solved my problem:

1. Because GnuPG for Windows stores encryption keys locally to the account that creates the keys, you need to login and create the GnuPG keys with the account that the SQL Server Agent will use when it executes the package.

2. In the SSIS “Execute Process Task”, I had to use a local path to the gpg.exe file vs. a UNC path.
Example, I used: "C:\Program Files\GNU\GnuPG\gpg.exe"
instead of...
"\\[server name]\C$\Program Files\GNU\GnuPG\gpg.exe”

Hope this helps!
Post #765697
Posted Wednesday, October 20, 2010 2:16 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 28, 2013 1:29 PM
Points: 3, Visits: 103
Hi Everyone

I am also having some issues with automating the PGP Decryption using SSIS package.

Here are steps I am doing:

1) Used Execute Process Task Editor
2) Passed the GNU executable as an Executable value to Execute Process Task
3) Entered the following text in the Arguments
--passpharse-fd 0 --output \\<OutputFile Location>\test.101019.txt --decrypt \\<EncryptedFile Location>\test.101019.txt.gpg

4) Set the Success Value to 2

When I execute the task, it is running successfully but I unable to find OUTPUT file in the specified location.

Please help me in resolving this issue.

Thanks
Ram
Post #1008019
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse