Topic "Error Code 1"

Author Message
jd

Guest


Hello,

I am new to using WinSCP. I am using Windows Task Scheduler to get files using SFTP from a remote server. The schedule task always ends with error code 0x1. Can someone please help me to understand why this is happening. Below is the log file

. 2008-03-26 23:00:00.441 --------------------------------------------------------------------------
. 2008-03-26 23:00:00.441 WinSCP Version 4.0.5 (Build 354) (OS 5.2.3790 Service Pack 2)
. 2008-03-26 23:00:00.441 Login time: Wednesday, March 26, 2008 11:00:00 PM
. 2008-03-26 23:00:00.457 --------------------------------------------------------------------------
. 2008-03-26 23:00:00.457 Session name: <removed>
. 2008-03-26 23:00:00.457 Host name: <removed> (Port: 22)
. 2008-03-26 23:00:00.457 User name: <removed> (Password: Yes, Key file: No)
. 2008-03-26 23:00:00.457 Tunnel: No
. 2008-03-26 23:00:00.457 Transfer Protocol: SFTP (SCP)
. 2008-03-26 23:00:00.457 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2008-03-26 23:00:00.457 Proxy: none
. 2008-03-26 23:00:00.457 SSH protocol version: 2; Compression: No
. 2008-03-26 23:00:00.457 Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2008-03-26 23:00:00.457 Ciphers: aes,blowfish,3des,WARN,des; Ssh2DES: No
. 2008-03-26 23:00:00.457 SSH Bugs: -,-,-,-,-,-,-,-
. 2008-03-26 23:00:00.457 SFTP Bugs: -,-,-
. 2008-03-26 23:00:00.457 Return code variable: Autodetect; Lookup user groups: Yes
. 2008-03-26 23:00:00.457 Shell: default, EOL: 0
. 2008-03-26 23:00:00.457 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2008-03-26 23:00:00.457 Alias LS: No, Ign LS warn: Yes, Scp1 Comp: No
. 2008-03-26 23:00:00.457 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2008-03-26 23:00:00.457 Cache directory changes: Yes, Permanent: Yes
. 2008-03-26 23:00:00.457 DST mode: 1
. 2008-03-26 23:00:00.457 --------------------------------------------------------------------------
. 2008-03-26 23:00:00.457 Looking up host "<removed>"
. 2008-03-26 23:00:00.504 Connecting to <removed> port 22
. 2008-03-26 23:00:00.566 Server version: SSH-2.0-5.1.0.558 SSH Tectia Server
. 2008-03-26 23:00:00.566 We claim version: SSH-2.0-WinSCP_release_4.0.5
. 2008-03-26 23:00:00.582 Using SSH protocol version 2
. 2008-03-26 23:00:07.082 Using Diffie-Hellman with standard group "group1"
. 2008-03-26 23:00:07.082 Doing Diffie-Hellman key exchange
. 2008-03-26 23:00:07.488 Host key fingerprint is:
. 2008-03-26 23:00:07.488 ssh-rsa 1536 ae:23:2d:a4:46:74:40:32:b4:23:dd:ad:99:9a:09:60
. 2008-03-26 23:00:07.488 Initialised AES-128 client->server encryption
. 2008-03-26 23:00:07.488 Initialised HMAC-SHA1 client->server MAC algorithm
. 2008-03-26 23:00:07.488 Initialised AES-128 server->client encryption
. 2008-03-26 23:00:07.488 Initialised HMAC-SHA1 server->client MAC algorithm
! 2008-03-26 23:00:07.754 Using username "<removed>".
. 2008-03-26 23:00:08.223 Session password prompt (<removed> password: )
. 2008-03-26 23:00:08.223 Using stored password.
. 2008-03-26 23:00:08.223 Sent password
. 2008-03-26 23:00:08.738 Access granted
. 2008-03-26 23:00:08.770 Opened channel for session
. 2008-03-26 23:00:08.817 Started a shell/command
. 2008-03-26 23:00:08.817 --------------------------------------------------------------------------
. 2008-03-26 23:00:08.817 Using SFTP protocol.
. 2008-03-26 23:00:08.832 Doing startup conversation with host.
> 2008-03-26 23:00:08.832 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2008-03-26 23:00:08.863 Type: SSH_FXP_VERSION, Size: 34, Number: -1
. 2008-03-26 23:00:08.863 SFTP version 3 negotiated.
. 2008-03-26 23:00:08.863 Unknown server extension newline@vandyke.com=0x0D0A
. 2008-03-26 23:00:08.863 We believe the server has signed timestamps bug
. 2008-03-26 23:00:08.863 We will use UTF-8 strings for status messages only
. 2008-03-26 23:00:08.863 Getting current directory name.
. 2008-03-26 23:00:08.863 Getting real path for '.'
> 2008-03-26 23:00:08.863 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2008-03-26 23:00:08.910 Type: SSH_FXP_NAME, Size: 31, Number: 16
. 2008-03-26 23:00:08.910 Real path is '/HOME'
. 2008-03-26 23:00:08.910 Startup conversation with host finished.
. 2008-03-26 23:00:08.910 Cached directory change via "/HOME" to "/HOME".
. 2008-03-26 23:00:08.910 Getting current directory name.
. 2008-03-26 23:00:08.942 Listing directory "/HOME".
> 2008-03-26 23:00:08.942 Type: SSH_FXP_OPENDIR, Size: 14, Number: 267
< 2008-03-26 23:00:08.988 Type: SSH_FXP_HANDLE, Size: 17, Number: 267
> 2008-03-26 23:00:08.988 Type: SSH_FXP_READDIR, Size: 17, Number: 524
< 2008-03-26 23:00:09.020 Type: SSH_FXP_NAME, Size: 207, Number: 524
> 2008-03-26 23:00:09.020 Type: SSH_FXP_READDIR, Size: 17, Number: 780
< 2008-03-26 23:00:09.067 Type: SSH_FXP_STATUS, Size: 22, Number: 780
< 2008-03-26 23:00:09.067 Status/error code: 1
> 2008-03-26 23:00:09.067 Type: SSH_FXP_CLOSE, Size: 17, Number: 1028
. 2008-03-26 23:00:09.067 Listing directory "/HOME".
> 2008-03-26 23:00:09.067 Type: SSH_FXP_OPENDIR, Size: 14, Number: 1291
< 2008-03-26 23:00:09.098 Type: SSH_FXP_STATUS, Size: 21, Number: 1028
. 2008-03-26 23:00:09.098 Discarding reserved response
< 2008-03-26 23:00:09.145 Type: SSH_FXP_HANDLE, Size: 17, Number: 1291
> 2008-03-26 23:00:09.145 Type: SSH_FXP_READDIR, Size: 17, Number: 1548
< 2008-03-26 23:00:09.192 Type: SSH_FXP_NAME, Size: 207, Number: 1548
> 2008-03-26 23:00:09.192 Type: SSH_FXP_READDIR, Size: 17, Number: 1804
< 2008-03-26 23:00:09.223 Type: SSH_FXP_STATUS, Size: 22, Number: 1804
< 2008-03-26 23:00:09.223 Status/error code: 1
> 2008-03-26 23:00:09.223 Type: SSH_FXP_CLOSE, Size: 17, Number: 2052
. 2008-03-26 23:00:09.223 Closing connection.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
What error code 0x1? Do you mean the code in the log or exit code of WinSCP process?
_________________
Martin Prikryl
jd

Guest


Thanks for the reply.

I thought that the line in the log file "2008-03-26 23:00:09.223 Status/error code: 1" was causing the schedule task to exit with error code 0x1.

But looks like it might not be the same from your comment. Can you please provide details of what the difference in error codes means when it is in the log file and when WinSCP Process exits, so that I can handle the error accordingly.

Thanks for your time and help.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Just ignore the error codes in the log. They mean nothing to you. If you are getting exit code 1, please post the output of the script.
_________________
Martin Prikryl
JD

Guest


prikryl wrote:
Just ignore the error codes in the log. They mean nothing to you. If you are getting exit code 1, please post the output of the script.


Thanks for the info. Can you provide or point me in the right direction, the various Exit Code from WinSCP Process, since I need to handle notification in my code depending on WinSCP process exit code.

What I am seeing is sometimes WinSCP when run from schedule task automatically fails to connect to the SFTP server, but if I run the same schedule task manually (i.e. right click on schedule task and select run) it runs fine if I ran it right after the task failed. I have tried to run it manually 1 min, 5 min, 15 min after the failed job and it runs fine. On various occassion the automatic scheduled task has run fine ok. I am trying to figure out why this happens intermitently so need to get more details from the process. Is there a way to do verbose logging from a batch file.

Thanks for your time and help.
JD
Guest




[quote="JD"]
prikryl wrote:
Just ignore the error codes in the log. They mean nothing to you. If you are getting exit code 1, please post the output of the script.


Here is the log file from one of the scheduled task

. 2008-04-03 11:30:01.439 --------------------------------------------------------------------------
. 2008-04-03 11:30:01.439 WinSCP Version 4.0.5 (Build 354) (OS 5.2.3790 Service Pack 2)
. 2008-04-03 11:30:01.439 Login time: Thursday, April 03, 2008 11:30:01 AM
. 2008-04-03 11:30:01.439 --------------------------------------------------------------------------
. 2008-04-03 11:30:01.439 Session name: removed@removed.com
. 2008-04-03 11:30:01.439 Host name: removed.com (Port: 22)
. 2008-04-03 11:30:01.439 User name: removed (Password: Yes, Key file: No)
. 2008-04-03 11:30:01.439 Tunnel: No
. 2008-04-03 11:30:01.439 Transfer Protocol: SFTP (SCP)
. 2008-04-03 11:30:01.439 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2008-04-03 11:30:01.439 Proxy: none
. 2008-04-03 11:30:01.439 SSH protocol version: 2; Compression: No
. 2008-04-03 11:30:01.439 Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2008-04-03 11:30:01.439 Ciphers: aes,blowfish,3des,WARN,des; Ssh2DES: No
. 2008-04-03 11:30:01.439 SSH Bugs: -,-,-,-,-,-,-,-
. 2008-04-03 11:30:01.439 SFTP Bugs: -,-,-
. 2008-04-03 11:30:01.439 Return code variable: Autodetect; Lookup user groups: Yes
. 2008-04-03 11:30:01.439 Shell: default, EOL: 0
. 2008-04-03 11:30:01.439 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2008-04-03 11:30:01.439 Alias LS: No, Ign LS warn: Yes, Scp1 Comp: No
. 2008-04-03 11:30:01.439 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2008-04-03 11:30:01.439 Cache directory changes: Yes, Permanent: Yes
. 2008-04-03 11:30:01.439 DST mode: 1
. 2008-04-03 11:30:01.439 --------------------------------------------------------------------------
. 2008-04-03 11:30:01.454 Looking up host "removed.com"
. 2008-04-03 11:30:01.486 Connecting to removed port 22
. 2008-04-03 11:30:01.517 Selecting events 63 for socket 472
. 2008-04-03 11:30:01.517 Waiting for the server to continue with the initialisation
. 2008-04-03 11:30:01.517 Looking for incoming data
. 2008-04-03 11:30:01.517 Looking for network events
. 2008-04-03 11:30:01.517 Detected network event
. 2008-04-03 11:30:01.517 Enumerating network events for socket 472
. 2008-04-03 11:30:01.517 Enumerated 18 network events for socket 472
. 2008-04-03 11:30:01.517 Detected network write event on socket 472 with error 0
. 2008-04-03 11:30:01.517 Detected network connect event on socket 472 with error 0
. 2008-04-03 11:30:01.517 Looking for network events
. 2008-04-03 11:30:16.517 Timeout waiting for network events
. 2008-04-03 11:30:16.517 Waiting for data timed out, asking user what to do.
. 2008-04-03 11:30:16.517 Asking user:
. 2008-04-03 11:30:16.517 Host has not answered for 15 seconds.
. 2008-04-03 11:30:16.517
. 2008-04-03 11:30:16.517 Wait for another 15 seconds? ()
. 2008-04-03 11:30:16.517 Attempt to close connection due to fatal exception:
* 2008-04-03 11:30:16.517 Terminated by user.
. 2008-04-03 11:30:16.517 Closing connection.
. 2008-04-03 11:30:16.517 Selecting events 0 for socket 472

Thanks
JD
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
There are only two exit codes 0 for success and 1 for error.

As for the failing script. It just looks like the server was unresponsive at the time. Since 4.1 beta, you can use -timeout switch to increase the server response timeout (from default 15s).
_________________
Martin Prikryl
guest

Guest


okay im using WinSCP to ssh my iPhone and when I try deleting customize in /var/root/customize it always says error 1 cannot delete. i have this in the wrong folder and would just like to delete this. please help.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
guest wrote:
okay im using WinSCP to ssh my iPhone and when I try deleting customize in /var/root/customize it always says error 1 cannot delete. i have this in the wrong folder and would just like to delete this. please help.

Does the error message says anything else? Can you post a full message?
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License