Ambassador icon indicating copy to clipboard operation
Ambassador copied to clipboard

[1.5.2 BETA] Unable to switch servers

Open PavlychevV opened this issue 1 year ago • 14 comments

[11:30:58 INFO]: [server connection] Player -> Server1 has connected
[11:31:10 INFO]: [server connection] Player -> Server2 has connected
[11:31:11 ERROR] [ambassador]: Unable to switch due to the registries of Server2 being different from the registries of Server1
[11:31:11 INFO]: [server connection] Player -> Server2 has disconnected
[11:31:11 ERROR]: [connected player] Player (ip): unable to connect to server Server2
com.velocitypowered.proxy.util.except.QuietRuntimeException: The connection to the remote server was unexpectedly closed.

Unable to switch servers on ambassador v1.5.2 beta. Everything works fine on ambassador v1.4.4. Using Minecraft 1.19.2, Forge 43.3.0, Velocity 3.3.9-390, both servers have the same mods.

PavlychevV avatar May 12 '24 08:05 PavlychevV

You can solve this in 3 different ways:

  • Enable registry check bypass in Ambassador's config file.
  • Or you install a client reset packet mod
  • Or you could enable kick reset in Ambassador's config file.

The reason it stops you from switching is because it is unstable to switch without resetting the client because the registries do no match. Like blocks could be missing or bugged and stuff like that. If you don't have a client reset mod installed it will try to switch without resetting instead of kicking you like 1.4 does.

adde0109 avatar May 12 '24 12:05 adde0109

I tried the first two ones:

  1. if I disable only the registry checks, it still doesn't allow me to join, same error; if I disable the mod checks too, I will get really cursed blocks instead of modded ones (Sophisticated backpacks on the picture) image
  2. With client reset mod and v1.5.2 beta, nothing happens, but with v1.4.4 it doesn't work at all (kicks from the server, error on the picture) CleanShot 2024-05-12 at 22 32 02@2x

As for the third one, I didn't find a way to disable it in the config file, the only solution that works for me is installing the latest stable build (v1.4.4). But the whole reason of me submitting this issue is to try to make it work without kick reset, so I hope you can help me solve it or fix something in the code, as it is still an unstable beta.

PavlychevV avatar May 12 '24 19:05 PavlychevV

I think the client reset mod didn't load in correctly. You could enable debug-mode in the config file on 1.5.2 and see if the client reset mod gets used or not.

adde0109 avatar May 13 '24 17:05 adde0109

This is with the mod installed and velocity running ambassador v1.5.2:

Bypass both checks = false

CleanShot 2024-05-13 at 23 23 18@2x

PaskhalkoAuth is Server1 Paskhalko is Server2

Ambassador.toml

# Do not change this
config-version = "2.0"

# How much time the player has to reconnect before canceling the server switch. (In seconds)
# Only for players with ServerRedirect mod installed. Set to -1 to disable ServerRedirect mod support.
serverRedirectTimeout = 30

# Silence PCF absence warnings.
silence-warnings = false

# Allow server switches without reset even though the new server's registries don't match the old server’s registry.
# Large modpacks often needs this set to true. Warning: This is a safety measure and setting this to true
# can lead to unstable behaviour.
bypass-registry-checks = false

# Allow player to switch without reset when the server's mods don't match. Even more unstable than bypassRegistryCheck.
# Warning: This is a safety measure for when bypassRegistryCheck is true. Setting this to also true can cause crashes.
bypass-mod-checks = false

#Only for debug/troubleshooting
debug-mode = true

Client log when switching

[23:23:41] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] Expecting 24 packets from server Paskhalko
[23:23:43] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] Handshake took: 1188 ms
[23:23:43] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] Avg packet time49 ms
[23:23:43] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] Unable to connect you to Paskhalko. Please try again later.

Velocity log when switching

[23:23:41 INFO]: [server connection] CommandBlockYTX -> Paskhalko has connected
[23:23:43 ERROR] [ambassador]: Unable to switch due to the registries of Paskhalko being different from the registries of PaskhalkoAuth
[23:23:43 INFO]: [server connection] CommandBlockYTX -> Paskhalko has disconnected
[23:23:43 ERROR]: [connected player] CommandBlockYTX (/ip): unable to connect to server Paskhalko
com.velocitypowered.proxy.util.except.QuietRuntimeException: The connection to the remote server was unexpectedly closed.

Main server log when switching

[23:23:43] [Server thread/INFO] [minecraft/ServerLoginPacketListenerImpl]: com.mojang.authlib.GameProfile@4dd051e4[info of CommandBlockYTX] (/ip) lost connection: Disconnected

Bypass both checks = true

Ambassador.toml

# Do not change this
config-version = "2.0"

# How much time the player has to reconnect before canceling the server switch. (In seconds)
# Only for players with ServerRedirect mod installed. Set to -1 to disable ServerRedirect mod support.
serverRedirectTimeout = 30

# Silence PCF absence warnings.
silence-warnings = false

# Allow server switches without reset even though the new server's registries don't match the old server’s registry.
# Large modpacks often needs this set to true. Warning: This is a safety measure and setting this to true
# can lead to unstable behaviour.
bypass-registry-checks = true

# Allow player to switch without reset when the server's mods don't match. Even more unstable than bypassRegistryCheck.
# Warning: This is a safety measure for when bypassRegistryCheck is true. Setting this to also true can cause crashes.
bypass-mod-checks = true

#Only for debug/troubleshooting
debug-mode = true

The server does switch, but all the modded stuff breaks and becomes cursed. With this configuration, such message appears: CleanShot 2024-05-13 at 23 34 05@2x

PavlychevV avatar May 13 '24 20:05 PavlychevV

As I suspected the client reset mod is not getting loaded correctly. Which version did you download?

adde0109 avatar May 13 '24 20:05 adde0109

I downloaded the latest for 1.19.2 from CurseForge.

PavlychevV avatar May 13 '24 20:05 PavlychevV

Could you provide full client logs?

adde0109 avatar May 13 '24 20:05 adde0109

Here

Line 1086 — initial connection to server Line 2038 — server switch starting

PavlychevV avatar May 13 '24 21:05 PavlychevV

Chat output when you first join the proxy? It should have some information when debug-mode is enabled.

adde0109 avatar May 13 '24 21:05 adde0109

This is the chat log I think. I've sent it before via a chat screenshot though.

CleanShot 2024-05-14 at 07 16 24@2x

PavlychevV avatar May 14 '24 04:05 PavlychevV

I'm having this same issue, but with two (or more) servers that are identical in terms of installed mods. The recent changelog implies that server switching can be done without the client reset mod, when both servers have the same (or similar mods). This doesn't seem to be the case.

TheFlash787 avatar Jun 09 '24 21:06 TheFlash787

Further developments, I need to specifically disable the mod checks and registry checks in order for this to work. However with both servers having identical mods, it would seem as though this isn't intentional, as those mod and registry checks should generally pass.

No errors are thrown when they're enabled though, just that the registries are different.

TheFlash787 avatar Jun 09 '24 21:06 TheFlash787

I literally symlinked my mods folders and even that didn't work

PavlychevV avatar Jun 09 '24 21:06 PavlychevV

I get the same errors, trying the same things with a Vault Hunter 1.18.2 forge server transferring from a paperMC lobby on our Velocity proxy. Also used the newest version of client reset mod from curseforge for 1.18.2. Only thing we can get to work at the moment is just using the stable 1.4.4 ambassador build and PCF then get the disconnect message and join network again and we will load into the forge server.

Edit: Further testing 1.4.4 with PCF and Forge Client Reset Packet, works after more attempts successfully connected 4 of 6 times. Seems to just disconnect on occassion.)

Edit2: Increasing read timeout on velocity and forge server fixed this occassional disconnect. (Still get as OP above if trying 1.5.2, cannot connect. Please try again later.) Will continue to mess with it.

Kriptiq avatar Aug 17 '24 07:08 Kriptiq

Hello! I can confirm the same issue still happens in Ambassador 1.5.0-rc1 on Velocity 3.4.0-SNAPSHOT.

Details:

Player connects to lobby.

When switching to another server (e.g., factions), the player is disconnected with: Unable to connect to factions: Took too long to log in

Proxy log: [server connection] Igor -> factions has disconnected [connected player] Igor: disconnected while connecting to factions

Backend server (Forge 1.20.1, Arclight) log: Disconnecting ... Took too long to log in handleDisconnection() called twice

Additional:

Handshake took ~1400 ms, packets are received normally (~49 ms avg packet time).

Problem does not happen on Ambassador 1.4.2 – switching between servers works fine there.

Environment:

Velocity 3.4.0-SNAPSHOT (git-bd2bb632)

Ambassador 1.5.0-rc1 and 1.5.2 (tested both)

Forge 1.20.1 backend servers (offline mode, no secure profile)

Connection timeout in velocity.toml: default 5000 ms

Update: I also tested with Ambassador 1.5.2, and the issue still persists — switching to another backend server results in Took too long to log in disconnect. So 1.5.2 does not fix this problem either.

Igor5877 avatar Apr 28 '25 14:04 Igor5877