Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Pradheep

It Worked !!!

After updating "Edit Raw Setting" it worked
ProtocolFeatures=-vendor-id
rookie1977

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
rookie1977

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
avi_ink

Re: It worked

Thanks @martin. After doing the above setting I am able to access file server.
avi_ink

Re: It worked

@martin I installed WinSCP beta 6.2.2. Still same error of SFTP protocol violation.
Log message attached.
EDISean

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
EDISean

Release of 6.2?

Hi @martin,

my trouble-customer is asking daily when 6.2 will be released.
Do you have a release date?
martin

@JSzabo: WinSCP 6.2 should be released by tomorrow.
JSzabo@...

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
martin

Re: It worked

@EDISean: A beta version will be released in few weeks.
EDISean

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?
EDISean

Awesome

that would be awesome.
I've relayed your information to the server guys, but got no reply.
Oh well....
martin

Re: Erm...

@EDISean: Yes, the server needs to be fixed.
I may try to implement a workaround.
EDISean

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.
martin

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.
EDISean

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).
martin

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

Let us know what their response was.
ssstevens@aurorak12.org

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

Thank you for figuring this out, Martin. I will contact the server vendor.
martin

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.
ssstevens@aurorak12.org

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

Hi Martin,
I installed an older version (didn't know I could downgrade so easily) and the problem went away. Here is the level 2 log file.
Thank you for being so responsive!
martin

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

@ssstevens: Thanks. But can you please post also log of a working session from the previous version? You can download it from
https://sourceforge.net/projects/winscp/files/WinSCP/
ssstevens@aurorak12.org

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

Thanks Martin. I'm attaching what I hope is the right log file for you.
-Sam
martin

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.
ssstevens@aurorak12.org

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
bkskidmore@chattanooga.gov

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