FastLogin icon indicating copy to clipboard operation
FastLogin copied to clipboard

Invalid session error; <nickname> tried to log in with an invalid session.

Open SajmonOriginal opened this issue 3 years ago • 14 comments

What happened?

Hello, I own a Modded server on Forge that uses Magma Server Software.. unfortunately, when some players suddenly want to connect they get a red "Invalid Session" message and the server won't let them join including me. After about 60 attempts, I was then able to connect at once, but was unable to do it again.

The console gives an error:

"[30Oct2022 21:24:40.209] [Craft Scheduler Thread - 2/ERROR] [com.github.games647.fastlogin.bukkit.FastLoginBukkit/]: [FastLogin] GameProfile SajmonOriginal (/**.**.**.**:63509) tried to log in with an invalid session. ServerId: -648ad811055654bc887f0673aaf752038c1b230a"

error

I absolutely don't understand what happened, because the server worked beautifully for a month and I did absolutely nothing and this issue came out of nowhere.. then I tried to use the latest build of FastLogin and ProtocolLib, but the issue still persists

What did you expect?

That the server will let players in.. some players don't have this problem which is really strange

Steps to reproduce

I honestly don't know how to replicate this, but maybe run Magma server or Spigot server on version 1.18.2 and the latest FastLogin, ProtocolLib with AutoRegister enabled?

Plugin list

MiniMOTD, LuckPerms, GameModeInventories, PlaceholderAPI, Mclogs, RandomJoinMessage, Spicord, FartherViewDistance, WorldBorder, Whitelist, Vault, ProtocolLib, Essentials, EssentialsChat, TAB, EssentialsSpawn, DiscordSRV, InteractiveChat, DeathMessages, AuthMe, InteractiveChatDiscordSrvAddon, FastLogin

Configuration file

https://hastebin.com/ogepejohaj.yaml

Server log

https://mclo.gs/V7o7Z4V

Plugin version

FastLogin version 1.12-SNAPSHOT-2989d9a

Platform

Spigot

Relevance

  • [X] I tried the latest build (build refers to development builds not necessary a release version)
  • [X] I checked for existing tickets - If there are, please vote them with a thumps reaction and not create new ones

SajmonOriginal avatar Oct 30 '22 22:10 SajmonOriginal

I also got this error in the console after turning it on and it threw me out with: "Disconnected", so I'll just add another comment here... I don't know if it's related or if it's another problem..

https://mclo.gs/6Ix6e83.

SajmonOriginal avatar Oct 30 '22 22:10 SajmonOriginal

Invalid session means that Mojang rejected the join request. This for example happens if a proxy is in between that causes the IP address to be different. You can disable this check in the configuration.

The UnsupportedOperationException isn't caused by FastLogin, because we don't invoke the referenced method. It's caused by ProtocolLib itself.

Furthermore I see the error message: send encryption response at invalid state This means that it got the successful response from earlier login attempts. As FastLogin separates the login attempts by the port number, your client sent those duplicate requests in incorrect order.

TuxCoding avatar Oct 31 '22 16:10 TuxCoding

Hello, thanks for your reply.. any ideas on how this issue could have occurred on its own after month and how to fix this? Because it came out of nowhere.. or is the bug somewhere on Mojang's side? When I tried to set useProxyAgnosticResolver: true it just throws Disconnected with this error in the console: https://mclo.gs/uv0vNdX as you wrote..

So how to fix the order of sending the requests? Because this is happening to multiple people and on different networks so I don't know what to do right now..

SajmonOriginal avatar Oct 31 '22 18:10 SajmonOriginal

Do you have any plugin that changes the IP address. The plugin matches that to identify the same login attempt. As I can see the port number is the same, but the IP could be different and therefore the plugin cannot find the previous login attempt.

TuxCoding avatar Nov 01 '22 07:11 TuxCoding

I have the same problem, it started to occur today. I haven't updated my plugins in a week, so it's very strange. Is there any workaround for this?

womzil avatar Nov 18 '22 19:11 womzil

I have the same problem image

Shizuri23 avatar Dec 22 '22 21:12 Shizuri23

I don't know of any plugin that changes the IP address... at most it would be related to floodgate or Geyser?

SajmonOriginal avatar Dec 28 '22 15:12 SajmonOriginal

Hello, thanks for your reply.. any ideas on how this issue could have occurred on its own after month and how to fix this? Because it came out of nowhere.. or is the bug somewhere on Mojang's side? When I tried to set useProxyAgnosticResolver: true it just throws Disconnected with this error in the console: https://mclo.gs/uv0vNdX as you wrote..

So how to fix the order of sending the requests? Because this is happening to multiple people and on different networks so I don't know what to do right now..

Can you say when i can find this setting im searching inside of fastlogin and protocol lib settings and i cannot find this setting

VoidDave avatar Apr 25 '23 19:04 VoidDave

https://github.com/games647/FastLogin/blob/7d7d91f4da4e9a0221ab999b14eac09ec5227fe8/core/src/main/resources/config.yml#L174

TuxCoding avatar Apr 26 '23 07:04 TuxCoding

https://github.com/games647/FastLogin/blob/7d7d91f4da4e9a0221ab999b14eac09ec5227fe8/core/src/main/resources/config.yml#L174

Where i can dowload versiow with support it ? I dowloaded it yearsertady from codemc (link from this github) (FastLoginBukkit.jar (bcs im using papermc)) and i dont have this line in config. After adding manualy it still the same issue. (I want to use radminvpn bcs i want to make small server for frends but i have dynamic ip)

VoidDave avatar Apr 26 '23 13:04 VoidDave

The config is automatically generated if didn't exist earlier. However, new configuration options are not populated if you are migrating from an old version.

Furthermore, as the comments mention this option only applies to Spigot+Protocollib. If your are using ProtocolSupport BungeeCord, you need to adjust the server.properties or config.yml respectively.

In your case, you also need to enable the option. The values in the referenced file are all default values.

For other cases, it is generally recommended to forward the IP to Spigot. Then Mojang sees the correct IP address to approve the join request (instead of invalid session) and your Spigot server can handle them for features like IP bans.

TuxCoding avatar Apr 26 '23 14:04 TuxCoding

The config is automatically generated if didn't exist earlier. However, new configuration options are not populated if you are migrating from an old version.

Furthermore, as the comments mention this option only applies to Spigot+Protocollib. If your are using ProtocolSupport BungeeCord, you need to adjust the server.properties or config.yml respectively.

In your case, you also need to enable the option. The values in the referenced file are all default values.

For other cases, it is generally recommended to forward the IP to Spigot. Then Mojang sees the correct IP address to approve the join request (instead of invalid session) and your Spigot server can handle them for features like IP bans.

How can i forward ip to spigot then ? I never done such thing before. And for settings the setting is not generating automaticly (adding it manualy dont change anything)

VoidDave avatar Apr 26 '23 14:04 VoidDave

If it's only for friends, it will be enough to enable the configuration option.

As said, you need to enable the configuration option (set to true) in order to disable this security feature. Otherwise it still the same the default value. You could post the file here, so I could look for syntax errors.

TuxCoding avatar Apr 26 '23 14:04 TuxCoding

If it's only for friends, it will be enough to enable the configuration option.

As said, you need to enable the configuration option (set to true) in order to disable this security feature. Otherwise it still the same the default value. You could post the file here, so I could look for syntax errors.

Ok i fixed it. Thx for all help i thought i needed to set it to false but it should be true. Great work regardless

VoidDave avatar Apr 26 '23 14:04 VoidDave