mojira.dev
MCL-24324

Session token is never updated after expiry

Launcher requires a restart every 24 hours as the authentication token is not refreshed.

No indication in launcher, making a typical scenario;
close down snapshot version, start stable, try to join a server, close minecraft, close launcher, start launcher, wait ~30s while the promo JSONs, banners etc are refreshed, launch minecraft, play...

In short;

[Info: 2024-05-23 08:38:06.2135672: Auth.cpp(217)] Successfully added/updated token to STS
.. day passes without issues ..
[Info: 2024-05-24 08:43:01.7110237: Auth.cpp(258)] Token in STS has expired, removing from storage
[Info: 2024-05-24 08:43:01.7122435: Auth.cpp(319)] STS Token successfully removed
.. evening comes and friends want to play ..
[Info: 2024-05-24 19:55:28.9733903: MinecraftJavaLoggingContext.cpp(66)] Game/net.minecraft.class_4341 (IO-Worker-297) Info Could not authorize you against Realms server: Invalid session id
[Info: 2024-05-24 19:55:28.9930553: MinecraftJavaLoggingContext.cpp(66)] Game/net.minecraft.class_7581 (Render thread) Warn Failed to process task pending invite count, will repeat after 2 cycles
net.minecraft.class_4355: Realms authentication error with message 'Invalid session id'

Linked issues

Comments 7

Hi!

Does this occur frequently?
How much closing/starting Java game does it take?
Can you please record a video of the issue?

This ticket will automatically reopen when you reply.

I'm assuming my report was not clear, sorry if I explain something that was perfectly clear, or if I'm too verbose.

 

The expiry of the token in the logs always happens 24 hours after initial login. In none of my rotated logfiles were a refresh that happened after the launcher had gone past the initial login / authentication / assets loading.

 

The expiry is most likely working just fine, the token most likely has a 24 hour window on it. The bug is that the launcher does not refresh the token / requests a new token.

 

Meaning that if the launcher is open for more than 24 hours (which I constantly have, as I monitor the log output when working on data packs), online play will become unavailable. Only fix is to close minecraft and launcher in order for the launcher to exit, start the launcher again for it to refresh the token, start minecraft.

 

If there was something unclear about the logfiles, please let me know.

 

All the rotated files show the same information, expiry occurs after 24 hours. If you have the ability to alter the token expiry with internal QA tooling, set it really low, join a world, wait for the "Token in STS has expired" log from Auth.cpp, try to join a new world. If that's not possible, you could try, (but I don't know if the expiry is system time based or a windows equivalent for monotonic clock)

start launcher

move system clock forward one day

wait for log message

try to join a world without restarting the launcher

 

The rotated and main log file has no refresh of token outside the inital authentication handshake/setup, always an expiry 24 hours in.

 

Is this still an issue for you in the latest version of the launcher? If so, please update the affected version(s).

I also have this issue. What do you mean by "How much closing/starting Java game does it take?" ?

Appears after putting the PC into "hibernate" for 24 hours, on my end.

Interesting, here it tries to connect to REALMS it seems although I didn't even try to connect to a REALMS server (from what I know, __ the famous server I connected to in the log below is not a Realms server.) Could this "misidentification" cause the issue?

 

......
[10:54:11] [Render thread/WARN]: Shader rendertype_entity_translucent_emissive could not find sampler named Sampler2 in the specified shader program.
[10:54:11] [IO-Worker-1/INFO]: Could not authorize you against Realms server: Invalid session id
[10:54:11] [IO-Worker-1/ERROR]: Couldn't connect to realms
fdj: Realms authentication error with message 'Invalid session id'
    at fby.a(SourceFile:447) ~[1.21.1.jar:?]
    at fby.g(SourceFile:232) ~[1.21.1.jar:?]
    at fbs.c(SourceFile:51) ~[1.21.1.jar:?]
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
    at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
[10:56:37] [Render thread/INFO]: Connecting to mc.simplesurvival.gg, 25565
[10:56:37] [Download-3/ERROR]: Failed to retrieve profile key pair
com.mojang.authlib.exceptions.MinecraftClientHttpException: Status: 401
    at com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:100) ~[authlib-6.0.54.jar:?]
    at com.mojang.authlib.minecraft.client.MinecraftClient.post(MinecraftClient.java:65) ~[authlib-6.0.54.jar:?]
    at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.getKeyPair(YggdrasilUserApiService.java:61) ~[authlib-6.0.54.jar:?]
    at fyy.a(SourceFile:129) ~[1.21.1.jar:?]
    at fyy.b(SourceFile:77) ~[1.21.1.jar:?]
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
    at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]

We do not have enough information to reproduce this issue.

Please include the following information to help us understand your problem:

Steps to Reproduce:

  1. (Explain what needs to be done for the issue to happen)

Observed Results:
(Briefly describe what happens)

Expected Results:
(Briefly describe what should happen)

Please also attach any needed commands, add-ons/behavior packs, data packs, resource packs, screenshots, videos, or worlds needed to help reproduce this issue.

Refer to the Bug Tracker Guidelines for more information about how to write helpful bug reports. Bug reports with insufficient information may be closed as Incomplete.

This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.
Quick Links:
📓 Bug Tracker Guidelines -- 💬 Community Support -- 📧 Mojang Support (Technical Issues) -- 📧 Microsoft Support (Account Issues) -- 📓 Project Summary -- ✍️ Feedback and Suggestions -- 📖 Game Wiki

knirch

(Unassigned)

Unconfirmed

Retrieved