GeyserMC / Geyser

A bridge/proxy allowing you to connect to Minecraft: Java Edition servers with Minecraft: Bedrock Edition.
https://geysermc.org
MIT License
4.6k stars 657 forks source link

Geyser couldn't make sure that the system clock is accurate #2330

Closed Skeagle137 closed 2 years ago

Skeagle137 commented 3 years ago

Describe the bug

Whenever a bedrock player joins, this log is sent from both geyser and floodgate: We couldn't make sure that your system clock is accurate. This can cause issues with logging in. If 2-3 bedrock players are online, the server will start lagging and eventually all bedrock players (and only the bedrock players) are kicked. The lag stops once they leave, and any java players that are online are unaffected (not sure if that is related to the system clock logs or another problem from geyser, but I assume so since it's strange that only the bedrock players are affected). I have checked and the time on my machine that the server runs on is synced (check screenshots), yet the error still persists. This only started happening to me when I updated my server to 1.17 as well.

To Reproduce

Expected behaviour

Bedrock players should be able to join as normal and not be kicked after some time.

Screenshots / Videos

error synced time

Server Version and Plugins

No response

Geyser Dump

https://dump.geysermc.org/3T9HHpPNCumkplaSB80mRDlGpQg6hoCR

Geyser Version

1.4.0-SNAPSHOT (git-master-495eafc)

Minecraft: Bedrock Edition Version

1.17.0

Additional Context

No response

Camotoy commented 3 years ago

Geyser and Floodgate currently sync up using Cloudflare's NTP server for additional security when logging in (when this fails, you get such an error message). It is very unlikely that is tied to lagging Bedrock players.

Skeagle137 commented 3 years ago

Well, that's good to know I guess. Seems it might be another plugin that has issues with bedrock specifically, for some reason.

Camotoy commented 3 years ago

Could you please try the latest Geyser build?

Skeagle137 commented 3 years ago

Using the latest build, the log still shows. I also confirmed the lag was from another plugin and not from geyser, so that's no longer an issue.

YHDiamond commented 2 years ago

What is the purpose of verifying system time?

Tim203 commented 2 years ago

Preventing replay attacks

PappoYT commented 2 years ago

Geyser/Floodgate on PaperMC.

Since today bedrock players get this error when trying to enter the server:

24.07 16:12:50 [Server] WARN We couldn't make sure that your system clock is accurate. This can cause issues with logging in.
24.07 16:12:50 [Server] WARN We couldn't make sure that your system clock is accurate. This can cause issues with logging in.

They are spawned in nowhere. Then they are logged out.

This is an example:

[14:12:50] [Network Listener - #1/INFO]: [Geyser-Spigot] Tentativo di accesso usando la modalit? floodgate... l'autenticazione sar? criptata.
[14:12:50] [epollEventLoopGroup-2-1/INFO]: [Geyser-Spigot] Samuele0079901 (loggato come: Samuele0079901) si ? connesso al server java in remoto all?indirizzo 172.17.0.5
[14:12:50] [epollEventLoopGroup-2-1/WARN]: [Geyser-Spigot] We couldn't make sure that your system clock is accurate. This can cause issues with logging in.
[14:12:50] [Netty Epoll Server IO #3/WARN]: [floodgate] We couldn't make sure that your system clock is accurate. This can cause issues with logging in.
[14:13:06] [Network Listener - #1/INFO]: [Geyser-Spigot] /79.49.91.244:50446 Ha provato a collegarsi!
[14:13:06] [Network Listener - #1/INFO]: [Geyser-Spigot] Un giocatore Bedrock con ip: /5.171.199.143 si ? disconnesso per CLOSED_BY_REMOTE_PEER
[14:13:06] [epollEventLoopGroup-2-1/INFO]: [Geyser-Spigot] Samuele0079901 si ? disconnesso dal server Java remoto sull'indirizzo 172.17.0.5 per il motivo: CLOSED_BY_REMOTE_PEER

Geyser and Floodgate are updated to latest build. So PaperMC. Here is the log file: https://mclo.gs/NZnOfCo

Java players enter without any problem.

ghost commented 2 years ago

Geyser/Floodgate on PaperMC.

Since today bedrock players get this error when trying to enter the server:

24.07 16:12:50 [Server] WARN We couldn't make sure that your system clock is accurate. This can cause issues with logging in.
24.07 16:12:50 [Server] WARN We couldn't make sure that your system clock is accurate. This can cause issues with logging in.

They are spawned in nowhere. Then they are logged out.

This is an example:

[14:12:50] [Network Listener - #1/INFO]: [Geyser-Spigot] Tentativo di accesso usando la modalit? floodgate... l'autenticazione sar? criptata.
[14:12:50] [epollEventLoopGroup-2-1/INFO]: [Geyser-Spigot] Samuele0079901 (loggato come: Samuele0079901) si ? connesso al server java in remoto all?indirizzo 172.17.0.5
[14:12:50] [epollEventLoopGroup-2-1/WARN]: [Geyser-Spigot] We couldn't make sure that your system clock is accurate. This can cause issues with logging in.
[14:12:50] [Netty Epoll Server IO #3/WARN]: [floodgate] We couldn't make sure that your system clock is accurate. This can cause issues with logging in.
[14:13:06] [Network Listener - #1/INFO]: [Geyser-Spigot] /79.49.91.244:50446 Ha provato a collegarsi!
[14:13:06] [Network Listener - #1/INFO]: [Geyser-Spigot] Un giocatore Bedrock con ip: /5.171.199.143 si ? disconnesso per CLOSED_BY_REMOTE_PEER
[14:13:06] [epollEventLoopGroup-2-1/INFO]: [Geyser-Spigot] Samuele0079901 si ? disconnesso dal server Java remoto sull'indirizzo 172.17.0.5 per il motivo: CLOSED_BY_REMOTE_PEER

Geyser and Floodgate are updated to latest build. So PaperMC. Here is the log file: https://mclo.gs/NZnOfCo

Java players enter without any problem.

I have this problem too

Tim203 commented 2 years ago

Can you run /floodgate firewall to see if it should be working properly?

OblogDesign commented 2 years ago

Можете ли вы побежать /floodgate firewallпосмотреть, должно ли оно работать правильно?

[12:27:25] [Thread-2191/INFO]: Testing global api...

[12:27:25] [Thread-2191/INFO]: Was able to connect to global api! [12:27:25] [Thread-2191/INFO]: Testing time sync... [12:27:31] [Thread-2191/INFO]: Failed to connect: [12:27:31] [Thread-2191/INFO]: java.lang.IllegalStateException: Failed to receive time offset [12:27:31] [Thread-2191/INFO]: at org.geysermc.floodgate.command.main.FirewallCheckSubcommand.lambda$timeSyncCheck$2(FirewallCheckSubcommand.java:83) [12:27:31] [Thread-2191/INFO]: at org.geysermc.floodgate.command.main.FirewallCheckSubcommand.lambda$executeFirewallText$3(FirewallCheckSubcommand.java:92) [12:27:31] [Thread-2191/INFO]: at org.geysermc.floodgate.command.main.FirewallCheckSubcommand.lambda$executeChecks$4(FirewallCheckSubcommand.java:111) [12:27:31] [Thread-2191/INFO]: at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1764) [12:27:31] [Thread-2191/INFO]: at java.base/java.lang.Thread.run(Thread.java:831) [12:27:31] [Thread-2191/INFO]: [12:27:31] [Thread-2191/INFO]: The checks have finished. 1/2 were successful

tomikcz987 commented 2 years ago

Можете ли вы побежать /floodgate firewallпосмотреть, должно ли оно работать правильно?

[12:27:25] [Thread-2191/INFO]: Testing global api...

[12:27:25] [Thread-2191/INFO]: Was able to connect to global api! [12:27:25] [Thread-2191/INFO]: Testing time sync... [12:27:31] [Thread-2191/INFO]: Failed to connect: [12:27:31] [Thread-2191/INFO]: java.lang.IllegalStateException: Failed to receive time offset [12:27:31] [Thread-2191/INFO]: at org.geysermc.floodgate.command.main.FirewallCheckSubcommand.lambda$timeSyncCheck$2(FirewallCheckSubcommand.java:83) [12:27:31] [Thread-2191/INFO]: at org.geysermc.floodgate.command.main.FirewallCheckSubcommand.lambda$executeFirewallText$3(FirewallCheckSubcommand.java:92) [12:27:31] [Thread-2191/INFO]: at org.geysermc.floodgate.command.main.FirewallCheckSubcommand.lambda$executeChecks$4(FirewallCheckSubcommand.java:111) [12:27:31] [Thread-2191/INFO]: at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1764) [12:27:31] [Thread-2191/INFO]: at java.base/java.lang.Thread.run(Thread.java:831) [12:27:31] [Thread-2191/INFO]: [12:27:31] [Thread-2191/INFO]: The checks have finished. 1/2 were successful

I have the same problem with time. I added geyser to bungee and couldn't connect with bedrock.

Tim203 commented 2 years ago

Looks like your firewall is blocking time.cloudflare.com UDP port 123

tomikcz987 commented 2 years ago

Looks like your firewall is blocking time.cloudflare.com UDP port 123

My firewall is not blocking outgoing connections to cloudflare

Tim203 commented 2 years ago

Then you shouldn't get that message ^^

SwirlClinic commented 2 years ago

I’m also having this issue with a clean install of paper, geyser and floodgate on a pterodactyl game panel install

Tim203 commented 2 years ago

This is an issue related to your firewall. Geyser and Floodgate try to connect to time.cloudflare.com (UDP port 123), and when Geyser/Floodgate aren't able to get the time from Cloudflare that error will pop up

Baterka commented 2 years ago

I disabled firewall and have same problem... Even with disabled firewall I am unable to get time from cloudflare

Tim203 commented 2 years ago

Try to run /floodgate firewall and it'll check if Floodgate can or can't connect to Cloudflare

ghost commented 2 years ago

I disabled firewall and have same problem... Even with disabled firewall I am unable to get time from cloudflare

You may not believe it. I can continue to use it normally after I sincerely pray. I suggest you try it too to see if this problem can be solved.

Baterka commented 2 years ago

I tested it... And it can not

ghost commented 2 years ago

I tested it... And it can not

emm... try to use this fork https://github.com/zimzaza4/Floodgate/actions

Tim203 commented 2 years ago

That's not a fix, it basically removed the check

ghost commented 2 years ago

That's not a fix, it basically removed the check

This branch does not delete the detection, but the time difference of the detection is changed to a larger one. In some areas, using it will cause a long delay. I also hope that this option can be configured

Tim203 commented 2 years ago

The goal of the time checker is to make sure that old data can't be used. By changing it to a big number you basically disable the check.

I don't think that there will be a configurable offset someday, but there might be an option to disable the check. However, that option won't be recommended.

Baterka commented 2 years ago

It seems like my problem is purely hosting based... I tested it on different and it is working... Sorry.

Camotoy commented 2 years ago

I'm closing this as that error will soon be irrelevant.