The process exit code was "1" while the expected was "0".

Advertisement

gridironcoach
Guest

The process exit code was "1" while the expected was "0".

Hello,

I am calling the winscp.com via an SSIS Agent Job. The job works like a charm when I run it manually but it fails when I schedule the job. Keep in mind that I am using a proxy account and I've run the script manually using the same credentials.

The following are the arguments in the SSIS: /script=C:\winscpscripts\fileput.txt

The following is the fileput.txt:
option batch abort
option confirm off
open ADTFundraising
put *.txt
exit



The following is from the error log:
Started: 8:47:00 AM
Error: 2009-11-09 08:47:03.99
Code: 0xC0029151
Source: Execute Process Task Execute Process Task
Description: In Executing "C:\Program Files\WinSCP\WinSCP.com" "/script=C:\winscpscripts\fileput.txt" at "C:\winscpscripts\Fundraising\Output", The process exit code was "1" while the expected was "0".
End Error
DTExec: The package execution returned DTSER_FAILURE (1).
Started: 8:47:00 AM




Thanks

Advertisement

mortimar71
Joined:
Posts:
2
Location:
Minnesota

Re: The process exit code was "1" while the expected was "0".

gridironcoach wrote:

Hello,

I am calling the winscp.com via an SSIS Agent Job. The job works like a charm when I run it manually but it fails when I schedule the job. Keep in mind that I am using a proxy account and I've run the script manually using the same credentials.

The following are the arguments in the SSIS: /script=C:\winscpscripts\fileput.txt

The following is the fileput.txt:
option batch abort
option confirm off
open ADTFundraising
put *.txt
exit



The following is from the error log:
Started: 8:47:00 AM
Error: 2009-11-09 08:47:03.99
Code: 0xC0029151
Source: Execute Process Task Execute Process Task
Description: In Executing "C:\Program Files\WinSCP\WinSCP.com" "/script=C:\winscpscripts\fileput.txt" at "C:\winscpscripts\Fundraising\Output", The process exit code was "1" while the expected was "0".
End Error
DTExec: The package execution returned DTSER_FAILURE (1).
Started: 8:47:00 AM




Thanks

I am also running a WinSCP.com/WinSCP.exe command inside an SSIS package and using SSAS job scheduler to run my package via a proxy account, and I am having the same issue. I can run the package in debug through SSIS or run the script through a command prompt and have success with both, however the SSAS job will not run without error.

I thought perhaps the issue was that the WinSCP.com wanted to popup a screen (even with option batch on and option confirm off) and this could not be done via the SSAS job scheduler so I switched to using the WinSCP.exe with the /script=C:\filepath\WinSCP_scriptfile.txt. However, I am still receiving the same message.

Error: 2009-11-09 11:45:06.01 Code: 0xC0029151 Source: Execute WinSCP script Execute Process Task Description: In Executing "C:\Program Files\WinSCP\WinSCP.exe" "/script=C:\AESOPExtractFiles\WinSCP_AesopSFTP.txt" at "", The process exit code was "1" while the expected was "0". End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 11:45:03 AM Finished: 11:45:06 AM Elapsed: 2.453 seconds. The package execution failed. The step failed.

If I take the Open and put commands out of my script the job runs fine. I put the Open command back in without the put to test if the connection or the file copy was the issue, and I am still receiving the error.

My script is as follows:

option batch on
option confirm off
open sftp://User:Password@Server:22
close
exit

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: The process exit code was "1" while the expected was "0".

Please read FAQ. If that does not help, come back.

mortimar71
Joined:
Posts:
2
Location:
Minnesota

Re: The process exit code was "1" while the expected was "0".

martin wrote:

Please read FAQ. If that does not help, come back.

Thank you,

I was able to get my job to run successfully by making my proxy user account a PowerUser.

Melissa

westmont
Guest

The process exit code was "1" while the expected was "0".

We have been running a SSIS package as a SQL Job for months successfully and now are getting the "The process exit code was "1" while the expected was "0" error when it tries to upload the file to WINSCP

Here's the error messages:


Started: 10:20:00 PM Error: 2010-06-04 22:20:57.87 Code: 0xC0029151
Source: Execute Process Task 1 Execute Process Task
Description: In Executing "C:\Program Files (x86)\WinSCP\WinSCP.exe"
"/script="c:\Program Files (x86)\WinScp\IRIS.txt"" at "C:\Program Files (x86)\WinSCP\",
The process exit code was "1" while the expected was "0".
End Error DTExec: The package execution returned DTSER_FAILURE (1).
Started: 10:20:00 PM Finished: 10:20:57 PM Elapsed: 57.766 seconds.
The package execution failed. The step failed.



[Execute Process Task] Error: In Executing
"C:\Program Files (x86)\WinSCP\WinSCP.exe"
"/script="c:\Program Files (x86)\WinScp\IRIS.txt""
at "C:\Program Files (x86)\WinSCP\",
The process exit code was "1" while the expected was "0".



The only thing that we think could have happened was someone went to the same ftp site on a different server(32bit server) using a newer version of WINSCP (4.2.5). It has the same host key as this server (64bit) that were having now getting the error on (Winscp 4.1.3). Could this have caused this error?

We are on a 64 bit Windows Server, SQL Server 2005.


I've looked at the FAQ that you've mention in the previous post but wasn't able to figure out the solution.

The host key under is the same key we're using in the the script file.

Not sure what to look at next to troubleshoot this problem.

Thanks

Advertisement

martin
Site Admin
martin avatar

Re: The process exit code was "1" while the expected was "0".

westmont wrote:

Not sure what to look at next to troubleshoot this problem.
Log file would be useful for beginning.

helent
Guest

Re: The process exit code was "1" while the expected was "0"

Hello,
I was given to understand that this bug was resolved in version 4.2.9.
Having installed this I am finding that it has resolved the issue in the Development area but still persists when launched via sql server agent.

Here is the result from the log file:
In Executing "C:\Program Files (x86)\WinSCP\WinSCP.com" "-script=D:\Scripts\FTPScript.txt" at "C:\", The process exit code was "1" while the expected was "0".

Is this the same bug?
Thanks,
Helen

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: The process exit code was "1" while the expected was "0"

helent wrote:

I was given to understand that this bug was resolved in version 4.2.9.
Having installed this I am finding that it has resolved the issue in the Development area but still persists when launched via sql server agent.
Please post a full log file showing the problem.

To generate log file, enable logging, log in to your server and do the operation and only the operation that causes the error. For posting extensive logs you may use pastebin or similar application. 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 may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.

manomurthy_k@...
Guest

job execution problem is sqlserver agent

i have received the following error
pls give the solution

Error: 2009-11-09 11:45:06.01 Code: 0xC0029151 Source: Execute WinSCP script Execute Process Task Description: In Executing "C:\Program Files\WinSCP\WinSCP.exe" "/script=C:\AESOPExtractFiles\WinSCP_AesopSFTP.txt" at "", The process exit code was "1" while the expected was "0". End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 11:45:03 AM Finished: 11:45:06 AM Elapsed: 2.453 seconds. The package execution failed. The step failed.

Advertisement

Mamata
Guest

winscp sftp task fails when run as a scheduled job

I have a package that downloads file from remote site. The remote site is FTP or SFTP. My sql server agent service is run under the local system user. The FTP task runs fine but the SFTP task fails with a message
Execute Process Task Description: In Executing "C:\Program Files (x86)\WinSCP\WinSCP.exe" "/script=D:\Loadcmd\FTPCommandFile.FTP", The process exit code was "1" while the expected was "0". End Error DTExec: The package execution returned DTSER_FAILURE (1).

Can you please help. Why does the sftp fail whereas the ftp works fine.

tritournament
Guest

The process exit code was "1" while the expected was "0".

I have followed all the steps given in the documentation but im still getting the above error.

My log file:
<?xml version="1.0" ?>
- <dtslogs>
<dtslog />
- <dtslog>
- <record>
<event>PackageStart</event>
<message>Beginning of package execution.</message>
<source>sftp</source>
<sourceid>{E0C158EA-80F3-4681-978D-45F27B6D214D}</sourceid>
<executionid>{3C6B81BB-B252-4B95-8020-4A43C4DCCF7C}</executionid>
<starttime>5/31/2011 5:00:30 PM</starttime>
<endtime>5/31/2011 5:00:30 PM</endtime>
<datacode>0</datacode>
<databytes>0x</databytes>
</record>
- <record>
<event>PackageEnd</event>
<message>End of package execution.</message>
<source>sftp</source>
<sourceid>{E0C158EA-80F3-4681-978D-45F27B6D214D}</sourceid>
<executionid>{3C6B81BB-B252-4B95-8020-4A43C4DCCF7C}</executionid>
<starttime>5/31/2011 5:00:36 PM</starttime>
<endtime>5/31/2011 5:00:36 PM</endtime>
<datacode>0</datacode>
<databytes>0x</databytes>
</record>
</dtslog>
</dtslogs>


my error:


Error:Out\xxx.pdfIn Executing "C:\Documents and Settings\yyy\My Documents\Downloads\winscp433\WinSCP.exe" "-script=C:\Documents and Settings\yyyy\Desktop\myscript.txt" at "C:\test", The process exit code was "1" while the expected was "0".


some one plz hep me in fixing it...plz

Advertisement

anonym
Guest

Re: winscp sftp task fails when run as a scheduled job

Hi prikryl,

I can understand you are an admin.
Please kindly get up from you throne and cater to the users requirement.
your answer to most of your questions is refer to FAQ. If the stupid brief FAQ had some proper examples and bit more details probably users need not start a thread.

I have to run winscp in a sql job but to automatically accept the host key i cannot find one piece of decent code. what does switch of open command mean, I have them in my script, tried but didnt work.

what more a user can ask if you think your FAQ is bible probably we should shift to another tool.

If you can give solutions to our query then please do so if you want us to refer to FAQ please dont even
bother saying it again - it is irritating.



Regards,
FAQ

c01dfu510n
Guest

I'm sorry if this is already a known issue but i think there is a problem with automation using c# in the beta 5.0.5 version.

This is what i do to create a process and initialize it:

            Process p = new Process();
            p.StartInfo.FileName = fileName;
            p.StartInfo.Arguments = args;
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardInput = true;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.CreateNoWindow = false;
            p.StartInfo.RedirectStandardError = true;

            p.Start();

            p.StandardInput.WriteLine("option batch abort");
            p.StandardInput.WriteLine("option confirm off");
                ...
            p.StandardInput.Close();

            string output = p.StandardOutput.ReadToEnd();
                // Wait until WinSCP finishes
            p.WaitForExit();

When I use 4.3.5 I get p.ExitCode = 0 but when I use 5.0.5 I get p.ExitCode = 1.

Please assist.

c01dfu510n
Guest

c01dfu510n wrote:

I'm sorry if this is already a known issue but i think there is a problem with automation using c# in the beta 5.0.5 version.

This is what i do to create a process and initialize it:

            Process p = new Process();
            p.StartInfo.FileName = fileName;
            p.StartInfo.Arguments = args;
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardInput = true;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.CreateNoWindow = false;
            p.StartInfo.RedirectStandardError = true;

            p.Start();

            p.StandardInput.WriteLine("option batch abort");
            p.StandardInput.WriteLine("option confirm off");
                ...
            p.StandardInput.Close();

            string output = p.StandardOutput.ReadToEnd();
                // Wait until WinSCP finishes
            p.WaitForExit();

When I use 4.3.5 I get p.ExitCode = 0 but when I use 5.0.5 I get p.ExitCode = 1.

Please assist.

I forgot to mention I use win7 home premium 64bit

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

c01dfu510n wrote:

I'm sorry if this is already a known issue but i think there is a problem with automation using c# in the beta 5.0.5 version.

This is what i do to create a process and initialize it:

When I use 4.3.5 I get p.ExitCode = 0 but when I use 5.0.5 I get p.ExitCode = 1.

Please assist.
Can you send me an email, so I can send you back a debug version of WinSCP to track the problem? Please include link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.

You will find my address (if you log in) in my forum profile.

Advertisement

DB
Guest

Re: The process exit code was "1" while the expected was "0".

gridironcoach wrote:

Hello,

I am calling the winscp.com via an SSIS Agent Job. The job works like a charm when I run it manually but it fails when I schedule the job. Keep in mind that I am using a proxy account and I've run the script manually using the same credentials.

The following are the arguments in the SSIS: /script=C:\winscpscripts\fileput.txt

The following is the fileput.txt:
option batch abort
option confirm off
open ADTFundraising
put *.txt
exit



The following is from the error log:
Started: 8:47:00 AM
Error: 2009-11-09 08:47:03.99
Code: 0xC0029151
Source: Execute Process Task Execute Process Task
Description: In Executing "C:\Program Files\WinSCP\WinSCP.com" "/script=C:\winscpscripts\fileput.txt" at "C:\winscpscripts\Fundraising\Output", The process exit code was "1" while the expected was "0".
End Error
DTExec: The package execution returned DTSER_FAILURE (1).
Started: 8:47:00 AM




Thanks

I am encountering the same issue. I am running 4.3.5 on Win 2008 R2 64-bit. I can run the SSIS package in Business Intelligence, but when I script it as a job it errors with the error mentioned in this thread. I've compared the WINSCP log files from successful run and failed, but they are identical (sans the time stamp). It has got to do with the permissions the SQL Agent running the task has but I cant figure it out for the life of me. We use the built in Network Service to run jobs, but I checked location security and permissions and dont seem to see where the problem is.
I would really appreciate any ideas anyone might have.

DB
Guest

Re: The process exit code was "1" while the expected was "0".

Quick update. I figured out my issue, in the SSIS package, I had ProtectionLevel set to an encrypted level. When I changed it to DontSaveSensitive the package ran as scheduled.
Hope this can help someone else.

Guest

you may check your script if it is correctly configured~

srinukonatham
Guest

When I use 4.3.5 I get p.ExitCode = 0 but when I use 5.0.5 I

I am getting the same error using 5.0.5 with same code.
I would appreciate if any solution for this problem.

martin wrote:

c01dfu510n wrote:

I'm sorry if this is already a known issue but i think there is a problem with automation using c# in the beta 5.0.5 version.

This is what i do to create a process and initialize it:

When I use 4.3.5 I get p.ExitCode = 0 but when I use 5.0.5 I get p.ExitCode = 1.

Please assist.
Can you send me an email, so I can send you back a debug version of WinSCP to track the problem? Please include link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.

You will find my address (if you log in) in my forum profile.

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: When I use 4.3.5 I get p.ExitCode = 0 but when I use 5.0.5 I

srinukonatham wrote:

I am getting the same error using 5.0.5 with same code.
I would appreciate if any solution for this problem.
Thanks for your post.
This issue is being tracked already:
https://winscp.net/tracker/794

nagendra
Guest

The process exit code was "1" while the expected was "0".

I am using 4.3.7.1679 , when i executed my ssis i was able to doneload files from SFTP but after sometimes now i am receiving eror The process exit code was "1" while the expected was "0".

Let me know how to resolve this.

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: The process exit code was "1" while the expected was "0".

nagendra wrote:

I am using 4.3.7.1679 , when i executed my ssis i was able to doneload files from SFTP but after sometimes now i am receiving eror The process exit code was "1" while the expected was "0".

Let me know how to resolve this.
Sorry, your post does not include enough information.

Please read how to troubleshoot problems with WinSCP. If it turns out that you are not able to help yourself, read how to ask for support or report bugs efficiently, so others can help you.

rickm
Joined:
Posts:
3

Re: The process exit code was "1" while the expected was "0".

I am trying to implement an SSIS sftp transfer via WinSCP and get a return value of 1 even though the transfer works. The SSIS package fails when run as a sql agent job even though the file transfer works. If I run the package interactively using my domain account everything works and the return value is zero. The job is run under a proxy pointing to a domain account. I've narrowed the failure down to the open command of a stored session.

The problem appears to be this record in the log.

. 2012-03-27 10:50:31.868 Script: Failed

I've read the forum posts and faqs but haven't been able to correct the problem. Any guidance you can provide?

Environment:

Windows Server 2008 R2 Enterprise 64 bit
WinSCP v 4.3.7
Configuration in ini file
Description: Script and log

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: The process exit code was "1" while the expected was "0".

rickm wrote:

I am trying to implement an SSIS sftp transfer via WinSCP and get a return value of 1 even though the transfer works. The SSIS package fails when run as a sql agent job even though the file transfer works. If I run the package interactively using my domain account everything works and the return value is zero. The job is run under a proxy pointing to a domain account. I've narrowed the failure down to the open command of a stored session.
Thanks for your report.
I have sent you an email with a debug version of WinSCP to address you have used to register on this forum.

rickm
Joined:
Posts:
3

Re: The process exit code was "1" while the expected was "0".

martin wrote:

rickm wrote:

I am trying to implement an SSIS sftp transfer via WinSCP and get a return value of 1 even though the transfer works. The SSIS package fails when run as a sql agent job even though the file transfer works. If I run the package interactively using my domain account everything works and the return value is zero. The job is run under a proxy pointing to a domain account. I've narrowed the failure down to the open command of a stored session.
Thanks for your report.
I have sent you an email with a debug version of WinSCP to address you have used to register on this forum.

I resolved the problem while trying to get your debug version working. It turned out that the stored session referenced a local directory that the service user could not access. I edited the ini file to point the local directory to somewhere that the service user could access and the problem went away. An error indicator indicating an access violation would be helpful in the log.

FYI, the winscp.com program does not obey WINSCPTRACE.

Thanks for the quick turnaround!

martin
Site Admin
martin avatar

Re: The process exit code was "1" while the expected was "0".

rickm wrote:

An error indicator indicating an access violation would be helpful in the log.
That's exactly the reason why I would like to get the debug log file, despite you already resolved your issue. Please. Thanks.

rickm
Joined:
Posts:
3

Re: The process exit code was "1" while the expected was "0".

martin wrote:

rickm wrote:

An error indicator indicating an access violation would be helpful in the log.
That's exactly the reason why I would like to get the debug log file, despite you already resolved your issue. Please. Thanks.

I can't get debug logging to work under SQL Server agent for some reason, so can't send you the logs from the exact scenario. I can try and duplicate it outside of SQL Server agent, but am concerned that it won't be an accurate representation.

Advertisement

martin
Site Admin
martin avatar

Re: The process exit code was "1" while the expected was "0".

Thanks, let me know if you succeed.

lellenburg
Guest

The process exit code was "1" while the expected was "0"

I am getting the following error message and confirmed the proxy user is a Power User. The package runs fine under windows credentials. Any ideas?

In Executing "C:\Program Files (x86)\WinSCP\WinSCP.exe" "/script=C:\SQLPackages\NOR20335\SFTPDownload.txt" at "", The process exit code was "1" while the expected was "0".

Please let me know if there is anything else I can provide to assist in trouble shooting. Thanks!

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: The process exit code was "1" while the expected was "0"

lellenburg wrote:

I am getting the following error message and confirmed the proxy user is a Power User. The package runs fine under windows credentials. Any ideas?

In Executing "C:\Program Files (x86)\WinSCP\WinSCP.exe" "/script=C:\SQLPackages\NOR20335\SFTPDownload.txt" at "", The process exit code was "1" while the expected was "0".

Please let me know if there is anything else I can provide to assist in trouble shooting. Thanks!
First, please start a new topic. And post your script and a session log file.

dtempleton
Guest

solved

For me it was a permissions issue. Go to Environment --> Directories, then change Local directory to something the SQLAgentUser can access. I used C:\temp. Click the dropdown for Save, and choose "Set defaults".

Advertisement

hanumanthareddy
Guest

sql agent job in not working in sql server 2008

Hi All,
Please help me Urgency

Message
Executed as user: CATOM-GMAPDVW69\SYSTEM.
Microsoft (R) SQL Server Execute Package Utility
Version 9.00.5000.00 for 32-bit Copyright (C) Microsoft Corp 1984-2005.
All rights reserved.
Started: 2:18:00 AM
Error: 2013-01-02 02:18:30.49
Code: 0xC0029151
Source: Rename File Execute Process Task
Description: In Executing "D:\SMOReports\Pankaj Pawar\Outstanding Change\OutStanding_rename.bat" "" at "",
The process exit code was "1" while the expected was "0".
End Error DTExec: The package execution returned DTSER_FAILURE (1).
Started: 2:18:00 AM Finished: 2:18:31 AM Elapsed: 30.859 seconds.
The package execution failed.
The step failed.

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: sql agent job in not working in sql server 2008

hanumanthareddy wrote:

Hi All,
Please help me Urgency
...
Please start a new thread and attach a full log file showing the problem (using the latest version of WinSCP).

To generate log file, use /log=path_to_log_file command-line argument. 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 may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.

hanumanthareddy
Guest

Auto Mail configuration

Hi All,

Please help me.


How to set Automail Configuration in sql server 2008.

eeman82
Guest

Solution to problems with SQL Server Agent connecting winSCP

I've read several stories about failure connection to WinSCP. The problem lies not within SQL Server or SSIS, it's the configuration of WinSCP. You have to change the configuratiefile settings for WinSCP so SQL Server can connect to WinSCP (see attachmentin Dutch).

Without this option your SFTP connection will work when you try it in SSIS and will fail when you schedule the task with SQL Server Agent.

Hope this works for you,
Gr. Erik

Description: WinSCP configuration

WinSCP.png

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Solution to problems with SQL Server Agent connecting winSCP

eeman82 wrote:

I've read several stories about failure connection to WinSCP. The problem lies not within SQL Server or SSIS, it's the configuration of WinSCP. You have to change the configuratiefile settings for WinSCP so SQL Server can connect to WinSCP (see attachmentin Dutch).

Without this option your SFTP connection will work when you try it in SSIS and will fail when you schedule the task with SQL Server Agent.
Thanks for sharing this.
This is described in the article in my very first post of this topic.
Reposting:
https://winscp.net/eng/docs/faq_scheduler

Closing this topic.

Advertisement

This topic is locked: you cannot edit posts or make replies