PaperMC / Velocity

The modern, next-generation Minecraft server proxy.
https://papermc.io/software/velocity
GNU General Public License v3.0
1.74k stars 604 forks source link

Failed to validate message acknowledgements #1127

Open 7wOv6ySCjo opened 10 months ago

7wOv6ySCjo commented 10 months ago

Hello everybody. I built a minecraft:tellraw command on the page: www.minecraftjson.com

I run this command in the console of my backend server Paper: minecraft:tellraw Sistan ["",{"text":"JUEGOS:","bold":true,"color":"#F97603"}," ","Sistan"," acaba de completar el parkour ",{"text":"[Angeles]","color":"dark_purple","clickEvent":{"action":"run_command","value":"/angeles"},"hoverEvent":{"action":"show_text","contents":[{"text":"Hacé click para ir","color":"green"}]}}]

The tellraw message arrives at the client Minecraft 1.19.4 and I simply click on one of the hoverEvent in the message. Velocity kicks me with: Failed to validate message acknowledgements from Sistan

Logs: Velocity:

[04:25:57.642] [Velocity Async Event Executor - #14/INFO] [com.velocitypowered.proxy.protocol.packet.chat.CommandHandler]: [connected player] Sistan (/###.###.##.###:63108) -> executed command /angeles
[04:25:57.668] [Netty epoll Worker #13/INFO] [com.velocitypowered.proxy.connection.client.ConnectedPlayer]: [connected player] Sistan (/###.###.##.###:63108): kicked from server survival_oscuro: 
[04:25:57.668] [Netty epoll Worker #13/INFO] [com.velocitypowered.proxy.connection.MinecraftConnection]: [server connection] Sistan -> survival_oscuro has disconnected

Backend:

[04:25:57.643] [Netty Epoll Server IO #3/WARN]: Failed to validate message acknowledgements from Sistan
[04:25:57.661] [Server thread/INFO]: Sistan lost connection: Chat message validation failure

What solution could I use to prevent this from happening? It is happening massively.

456dev commented 9 months ago

does just running the command "/angeles" manually cause the same issue? does it occur with any other commands in the tellraw?

7wOv6ySCjo commented 7 months ago

does just running the command "/angeles" manually cause the same issue? does it occur with any other commands in the tellraw?

happens with any clickable command in the message.

Jeremylo1 commented 6 months ago

does just running the command "/angeles" manually cause the same issue? does it occur with any other commands in the tellraw?

I encounter the same problem! From time to time a same clickable message sent with tellraw command can be executed or disconnect the player with the following message in the console : [02:00:42 WARN]: Failed to validate message acknowledgements from Jeremylo1

JonnygamingTv commented 6 months ago

I encounter a similar problem when proxying PaperMC via Bungeecord (only affects some specific servers, apparently. But I also haven't extensively tested it on multiple server instances so it could be global). Every now and then (around once per hour or once per 30 minutes) when I (or other players) send a message in chat this happens to the player who tried to send a message (counting command as a message):

[22:18:08] [Netty Epoll Server IO #1/WARN]: Failed to update secure chat state for Player: 'Received chat packet with missing or invalid signature.'
[22:18:08] [Server thread/INFO]: Player lost connection: Received chat packet with missing or invalid signature.
[22:41:10] [Netty Epoll Server IO #3/WARN]: Failed to validate message acknowledgements from Player
[22:41:10] [Server thread/INFO]: Player lost connection: Chat message validation failure

Gotten it on git-Paper-422 & git-Paper-424 (both MC 1.20.4) so far. However, I did not encounter the same problem from the tellraw that you sent, but the issue I'm experiencing is pretty similar. (enforce-secure-profile is set to false as well)

gamer50082 commented 6 months ago

This is velocity thou and your using bungeecord

ArikSquad commented 6 months ago

Same issue, can't click any "links for commands" in chat.

7wOv6ySCjo commented 6 months ago

We still do not have an approaching solution to this problem? the problem persists.

Mitchel387 commented 5 months ago

I'm also having this issue for a month now. It doesn't happen when when we type the commands by ourselfs. But clicking on command links does kick players sometimes. I use Velocity 3.3.0-SNAPSHOT & Paper version git-Paper-450 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 62b220a). We use the /tpa commands of HuskHomes. If you need more technical info, I'm happy to help! I hope I can write some "Steps To Reproduce" for you.

Here the typical messages in console of kicked players clicking on tpa accept text in chat.

[14:30:17 INFO]: Player_1 issued server command: /tpa Player_2
[14:30:20 WARN]: Failed to validate message acknowledgements from Player_2
[14:30:20 INFO]: Player_2 lost connection: Chat message validation failure
[14:30:20 INFO]: Player_2 left the game

I'm running HuskHomes 4.5.5. So I will try to update this plugin to the latest release and see if this bug still occurs. One thing I noticed is that it isn't reported in the velocity console that a player has been kicked. So maybe it's a bug of the specific plugin.

[Update]: Updating the plugin to the latest version didn't solve the issue unfortunately.

Jeremylo1 commented 5 months ago

This is the case for all clickable messages in the chat, regardless of the plugin used. In fact, even if the server doesn't contain any plugins, this issue still occurs. However, the problem only arises after the player has been connected for a certain amount of time. If the player disconnects and reconnects, they can click on the message without any issues. But if they have been connected for at least an hour, it will disconnect them.

NinjagoKristian commented 3 months ago

This is the case for all clickable messages in the chat, regardless of the plugin used. In fact, even if the server doesn't contain any plugins, this issue still occurs. However, the problem only arises after the player has been connected for a certain amount of time. If the player disconnects and reconnects, they can click on the message without any issues. But if they have been connected for at least an hour, it will disconnect them.

Same thing happens here with my custom plugin, exactly what you said "the problem only arises after the player has been connected for a certain amount of time".

TechCallCP commented 3 months ago

I have this same issue currently. I actually debugged this issue myself for 3 full days now. I went from removing specific plugins, to removing all of them. Downgrading from Purpur to paper, Downgrading velocity, completely resetting configs on bother servers, changing configs on both servers, and it resolved nothing.

I did however locate the main issue. I would type in chat twice then when I would use any type of command (aka I used gamemode spectator), it would kick for invalid chat. I worked on this for 3 full days, with no resolution luck. PaperServer VelocityServer

TechCallCP commented 3 months ago

I have this same issue currently. I actually debugged this issue myself for 3 full days now. I went from removing specific plugins, to removing all of them. Downgrading from Purpur to paper, Downgrading velocity, completely resetting configs on bother servers, changing configs on both servers, and it resolved nothing.

I did however locate the main issue. I would type in chat twice then when I would use any type of command (aka I used gamemode spectator), it would kick for invalid chat. I worked on this for 3 full days, with no resolution luck. PaperServer VelocityServer

The first photo is the paper side, the second one is velocity.

electronicboy commented 3 months ago

I think that there is still a slight potential for a race condition in the chat logic handling, there is a bunch of this stuff that I just want to nuke and start from scratch on, however, that will sadly be a little while away

7wOv6ySCjo commented 3 months ago

I think that there is still a slight potential for a race condition in the chat logic handling, there is a bunch of this stuff that I just want to nuke and start from scratch on, however, that will sadly be a little while away

This bug started to happen exactly since the chat validations were added from version 1.19.4 onwards. It would be good to review the changes made since then and see where the bug arises or what is the new change that ‘helps’ to enhance this race condition.

For now: an alternative to solve this problem is the use of two plugins: SignedVelocity and FreedomChat. These two plugins, and I don't know why, together will solve this strange error.