SFTP protocol violation: Invalid message number

Advertisement

bkskidmore@chattanooga.gov
Joined:
Posts:
1

SFTP protocol violation: Invalid message number

I just upgraded to WinSCP 6.1 and now I'm getting the following error for a couple of my SFTP sites.
SFTP protocol violation: Invalid message number
Is there something I can do to fix this problem. As information, I've connected to the problematic sites with another program successfully.

Thank you

Reply with quote

Advertisement

ssstevens@aurorak12.org
Joined:
Posts:
4
Location:
Colorado

Also getting 'SFTP protocol violation: Invalid message number' error after upgrading to 6.1

I am also getting the same error message when connecting to one server. This started right after upgrading to 6.1
I tried changing the Preferred SFTP protocol version to 5, as suggested, but still got the error.
Log file is attached.

If I use FileZilla, I am able to connect successfully – but I would rather use WinSCP.
Are there other workarounds available?
Thanks
  • OIC-SFTP-Server.log (20.18 KB, Private file)

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Also getting 'SFTP protocol violation: Invalid message number' error after upgrading to 6.1

Thanks both. Can you please post session log file on Debug 2 level? A log file from a working session from an older version of WinSCP might be useful too.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Also getting 'SFTP protocol violation: Invalid message number' error after upgrading to 6.1

Thanks. Imo, it's clearly a bug on the server side. The server "supports" vendor-id SFTP extension. It first sends its own nonsense vendor information:
. Server software: ${pom.artifactId} ${pom.version} (0) by ${pom.groupId}
And when WinSCP sends its own vendor information (that's new in WinSCP 6.1), the server just fails totally.

For a start, can you try decreasing SFTP version to 3 (or even lower)? It might prevent the server from sending its vendor information, what would in turn prevent WinSCP from sending its.
https://winscp.net/eng/docs/ui_login_sftp

If you have means for contacting the server vendor, please report the problem to them.

Reply with quote

martin
Site Admin
martin avatar

Re: Also getting 'SFTP protocol violation: Invalid message number' error after upgrading to 6.1

Let us know what their response was.

Reply with quote

Advertisement

EDISean
Joined:
Posts:
6
Location:
Germany

I have the same issue, but your solutions didn't work :-(

Hi,

I also get the message:
SFTP protocol violation: Invalid message number 8 (expected 200).
The numbers change, but the message stays the same.
I can't change anything on the server side because "Everything is fine with our server. It must be a problem with your client"...
FileZilla works fine, but we need a way to have the transfer scripted because of reasons ;-)

I've attached the log of a failed attempt.
Maybe someone can see what the issue is?
I've tried reducing the SFTP-version but the error stays the same (if I go down to 2, I get the messsage that I should use 3,4,5 or 6).
  • Unified-Post-Prod.log (19.87 KB, Private file)

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: I have the same issue, but your solutions didn't work :-(

Thanks for the log.
The server supports vendor-id SFTP extension. So WinSCP uses the extension to provide the server with its information using SSH_FXP_EXTENDED request (with "sequence number" 200). To this, the server should respond with SSH_FXP_EXTENDED_REPLY response with the same sequence number. (Or with an error using SSH_FXP_STATUS response, though that is not expected in this case). Instead, the server "responds" with SSH_FXP_EXTENDED message with sequence number 8. This is totally wrong:
  • SSH_FXP_EXTENDED is not a valid response to SSH_FXP_EXTENDED request.
  • SSH_FXP_EXTENDED is a request message. It can only ever be sent by the client, never by the server.
  • The "response" uses wrong sequence number. In that session, WinSCP didn't sent any request with sequence number 8.
It's irrelevant that FileZilla "works", as FileZilla does not support the vendor-id extension. So it does not trigger the bug in the server.

Reply with quote

EDISean
Joined:
Posts:
6
Location:
Germany

Erm...

Hi, thanks for the quick analysis.

Is there anything I can do on my side to get it to work?
Or does the Server-side need to change something?

Thanks again for the quick reply.

Reply with quote

Advertisement

EDISean
Joined:
Posts:
6
Location:
Germany

It worked

Hi,

I've already answered via email, but just to let every other person with the same problem know: IT WORKED!!!

Is there a timeline when (or if) it will be implemented in the release-version of WinSCP?

Reply with quote

Advertisement

JSzabo@...
Guest

Hello Martin,

We are also experiencing this exact same issue with WinSCP 6.1 and the Oracle OIC SFTP server. Do you have a release date for the fix included with 6.2? In the meantime, would it be possible to get the prerelease version (beta) as well?

Thank you in advance,
Julie

Reply with quote

Advertisement

EDISean
Joined:
Posts:
6
Location:
Germany

6.2 Beta

Ahh, ok.

Then I read the last post regarding a release wrong.
To me it sounded like 6.2 (non-beta) release was just around the corner.

Thanks for the info

Reply with quote

Advertisement

rookie1977
Joined:
Posts:
2

Re: It worked

Thanks Martin, that worked for me as well in the GUI. How do I have to implement this in a WinSCP-script under the new version 6.3?

At the moment I am getting the following error in the log:
. 2024-02-23 16:17:53.050 We will use UTF-8 strings as it is mandatory with SFTP version 4 and newer
> 2024-02-23 16:17:53.050 Type: SSH_FXP_EXTENDED, Size: 61, Number: 200
. 2024-02-23 16:17:53.050 Getting current directory name.
. 2024-02-23 16:17:53.050 Getting real path for '.'
> 2024-02-23 16:17:53.050 Type: SSH_FXP_REALPATH, Size: 11, Number: 272
< 2024-02-23 16:17:53.081 Type: Unknown message (77), Size: 14, Number: 1634890857
. 2024-02-23 16:17:53.081 Attempt to close connection due to fatal exception:
* 2024-02-23 16:17:53.081 SFTP-Protokollverletzung: Ungültiger Type der Antwortnachricht (77).
. 2024-02-23 16:17:53.081 Closing connection.
. 2024-02-23 16:17:53.081 Sending special code: 1
. 2024-02-23 16:17:53.113 Session sent command exit status 0
. 2024-02-23 16:17:53.113 Main session channel closed
. 2024-02-23 16:17:53.113 All channels closed
< 2024-02-23 16:17:53.113 Script: SFTP-Protokollverletzung: Ungültiger Type der Antwortnachricht (77).
< 2024-02-23 16:17:53.113 Fehler beim Empfang des Verzeichnisnamens von der Gegenstelle.
Thanks for your help.
Yves

Reply with quote

rookie1977
Joined:
Posts:
2

Hi Martin

Just found the solution for my problem and would like to share it here. I just used the following switch in the WinSCP-script:
-rawsettings ProtocolFeatures=-vendor-id
Thanks!
Yves

Reply with quote

Advertisement

You can post new topics in this forum