Topic "returned the exit code 3"

Author Message
bhavank.g
[View user's profile]

Joined: 2016-12-27
Posts: 11
Hi,

I use WinSCP(5.1.7.0) to upload/download files to/from SFTP/FTP locations. I use WinSCP portable exe since 2013 and I use command line to run WinSCP from another integration tool, suddenly today morning all FTP calls are failing with message "returned the exit code 3" on live environment.

Can anyone help me on this issue? I checked error code list at https://winscp.net/eng/docs/sftp_codes but could not understand why its stopped suddenly after 3 years?

Thanks,
Bhavank
Advertisements
Makc666
[View user's profile]

Joined: 2016-12-08
Posts: 52
Location: MSK-RU
Bhavank, you have to look into logs. If you don't have enough information then enable Debug level for logs.

May be your remote host (remote server) switched to a newer SFTP protocol version which WinSCP(5.1.7.0) doesn't know. If so the only way to upgrade to a new version of WinSCP.
bhavank.g
[View user's profile]

Joined: 2016-12-27
Posts: 11
Hi Mack,

I am not sure, how to check logs for WinSCP. Also I use multiple parties FTP locations and all FTP gives this error message which is strange.

Thanks,
Makc666
[View user's profile]

Joined: 2016-12-08
Posts: 52
Location: MSK-RU
https://winscp.net/eng/docs/troubleshooting#scripting

See the line:
Quote:
Turn on session logging using command-line switch /log and check the generated log file to see, if WinSCP actually does what you want it to do.


https://winscp.net/eng/docs/commandline#logging
bhavank.g
[View user's profile]

Joined: 2016-12-27
Posts: 11
Hi,

I checked this but nothing comes to log file in this error message. Also I found this https://winscp.net/eng/docs/message_library_process_terminated_with_exit_code_3 but not sure about what should be slution to error
Makc666
[View user's profile]

Joined: 2016-12-08
Posts: 52
Location: MSK-RU
Try to backup you current WinSCP and then reinstall WinSCP with a new version. May be you have some probmlems with .NET which was updated at your system and now old version of WinSCP is not compatible with a new vewrsion of .NET.

Or wait for any comments from Martin - may be he can give you better comments.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26109
Location: Prague, Czechia
What is the "returned the exit code 3"? Where do you get that? Is that a message from WinSCP (than we need an exact wording) or from some environment that runs WinSCP?

Anyway, you correctly found this topic:
https://winscp.net/eng/docs/message_library_process_terminated_with_exit_code_3

The version you are using suffers from this bug:
https://winscp.net/tracker/show_bug.cgi?id=996

So the first step to resolve your problem would be to upgrade.
bhavank.g
[View user's profile]

Joined: 2016-12-27
Posts: 11
Hi Martin,

I am not sure but restarting Live environment helped to resolve this issue.

Thanks,
Bhavank
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26109
Location: Prague, Czechia
bhavank.g wrote:
I am not sure but restarting Live environment helped to resolve this issue.

If you didn't upgrade, the problem will repeat.
bhavank.g
[View user's profile]

Joined: 2016-12-27
Posts: 11
Hi Martin,

I use portable WinSCP EXE and third party application use WinSCP EXE to transfer files between local server and FTP using scripting.

Can you advise what is the step to upgrade this portable EXE please?

Thanks,
Bhavank
bhavank.g
[View user's profile]

Joined: 2016-12-27
Posts: 11
Hi Martin,

I read on forum to replace Portable EXE with new version EXE. I did same and replace WinSCP(5.1.7.0) EXE with WinSCP(5.9.3). All FTP/SFTP works fine except one SFTP where it gives error of "Password authentication failed". if I use old version EXE then its work fine.

Please advise.

. 2017-01-05 12:45:56.181 Server offered these authentication methods: publickey,password
. 2017-01-05 12:45:56.181 Prompt (password, "SSH password", <no instructions>, "&Password: ")
. 2017-01-05 12:45:56.181 Using stored password.
. 2017-01-05 12:45:56.181 Sent password
. 2017-01-05 12:45:57.351 Password authentication failed
! 2017-01-05 12:45:57.351 Access denied
. 2017-01-05 12:45:57.351 Server offered these authentication methods: publickey,password
. 2017-01-05 12:45:57.351 Prompt (password, "SSH password", <no instructions>, "&Password: ")
. 2017-01-05 12:45:57.351 Disconnected: Unable to authenticate

Thanks,
Bhavank
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26109
Location: Prague, Czechia
bhavank.g wrote:
I read on forum to replace Portable EXE with new version EXE. I did same and replace WinSCP(5.1.7.0) EXE with WinSCP(5.9.3). All FTP/SFTP works fine except one SFTP where it gives error of "Password authentication failed". if I use old version EXE then its work fine.

Do you have any non-ascii characters in a password for this server? The latest version of WinSCP uses UTF-8 for passwords (what is a correct behavior). But some servers still incorrectly use some legacy encoding (like WinSCP used to do too in its old versions). With such servers, you won't be able to login, if the password is not pure ASCII.
bhavank.g
[View user's profile]

Joined: 2016-12-27
Posts: 11
martin wrote:
bhavank.g wrote:
I read on forum to replace Portable EXE with new version EXE. I did same and replace WinSCP(5.1.7.0) EXE with WinSCP(5.9.3). All FTP/SFTP works fine except one SFTP where it gives error of "Password authentication failed". if I use old version EXE then its work fine.

Do you have any non-ascii characters in a password for this server? The latest version of WinSCP uses UTF-8 for passwords (what is a correct behavior). But some servers still incorrectly use some legacy encoding (like WinSCP used to do too in its old versions). With such servers, you won't be able to login, if the password is not pure ASCII.


I checked my password for SFTP and all characters from password string are pure ASCII characters. Please advise further on this.

Thanks,
Bhavank
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26109
Location: Prague, Czechia
bhavank.g wrote:
I checked my password for SFTP and all characters from password string are pure ASCII characters. Please advise further on this.

Enable password logging with /loglevel=* and check that the correct password is used.
Also, is there any special (even if ASCII) character in the password?
bhavank.g
[View user's profile]

Joined: 2016-12-27
Posts: 11
Hi Martin,

I will enable logging with /loglevel=*, There are two special characters from ASCII on password ; and !
bhavank.g
[View user's profile]

Joined: 2016-12-27
Posts: 11
martin wrote:
bhavank.g wrote:
I checked my password for SFTP and all characters from password string are pure ASCII characters. Please advise further on this.

Enable password logging with /loglevel=* and check that the correct password is used.
Also, is there any special (even if ASCII) character in the password?


Hi Martin,

I guess special ASCII character ; is causing issue. I found some difference between working and non working version logs

. 2017-01-09 10:17:02.059 Host name: *** (Port: 22)
. 2017-01-09 10:17:02.059 User name: *** (Password: **, Key file: No, Passphrase: No)

Password Section is Yes on working version Log where as on Non working version it picked Initial characters before ; and shown on log.

Is this identification is true? which causing bug on SFTP connection through new version? Kindly let me know once you have look.

Thanks,
Bhavank
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26109
Location: Prague, Czechia
Yes. The semicolon is a special character since WinSCP 5.2.5.
You have to encode it, see:
https://winscp.net/eng/docs/session_url#special
bhavank.g
[View user's profile]

Joined: 2016-12-27
Posts: 11
Hi Martin,

That's very helpful.

After encoding special character ;(Semicolon) to %3B on password resolved this issue. I will observe this for next few days and provide update.

Thanks,
Bhavank
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26109
Location: Prague, Czechia
I've documented incompatible changes, including this one:
https://winscp.net/eng/docs/incompatible_changes
bhavank.g
[View user's profile]

Joined: 2016-12-27
Posts: 11
Hi Martin,

I have monitored changes applied to mask special character semicolon and it works all good last week. Thank you for your help on this issue.

Thanks,
Bhavank
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