SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Execute Process Task - The process exit code was "2" while the expected was "0"


Execute Process Task - The process exit code was "2" while the expected was "0"

Author
Message
gdebbe
gdebbe
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 58
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?
BSql_Dev
BSql_Dev
SSC-Enthusiastic
SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)

Group: General Forum Members
Points: 171 Visits: 146
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
Hesten Erwin
Hesten Erwin
SSC Journeyman
SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)

Group: General Forum Members
Points: 83 Visits: 105
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!!!
BSql_Dev
BSql_Dev
SSC-Enthusiastic
SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)

Group: General Forum Members
Points: 171 Visits: 146
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.
Manko T
Manko T
Valued Member
Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)

Group: General Forum Members
Points: 51 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!!!

olu-699940
olu-699940
Valued Member
Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)

Group: General Forum Members
Points: 52 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.
AmolNaik
AmolNaik
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1671 Visits: 1234
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
olu-699940
olu-699940
Valued Member
Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)

Group: General Forum Members
Points: 52 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
SQL Juice Man
SQL Juice Man
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 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!
athmaram_p
athmaram_p
SSC Rookie
SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)

Group: General Forum Members
Points: 25 Visits: 104
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search