Bactrosaurus / bactromod

BactroMod is an utility mod for Minecraft written in Kotlin that adds new possibilities of customizing your in-game experience while providing some additional features.
3 stars 1 forks source link

Game crashes with an AuthenticationException on 1.20.6 #8

Closed BetaKors closed 3 months ago

BetaKors commented 3 months ago

Tested with Bactromod 2.2 on 1.20.6 and with no other mods other than Fabric Language Kotlin 1.11.0+kotlin.2.0.0

Fabric version: 0.15.11 for Minecraft 1.20.6 Launcher used: Modrinth Launcher v0.7.1 JVM: Azul Zulu 21.34.19 | JRE 21.0.3+9 JVM Arguments: -Xms4096M

[15:09:23] [Download-2/ERROR]: Failed to fetch user properties
com.mojang.authlib.exceptions.AuthenticationException: com.mojang.authlib.exceptions.MinecraftClientException: Failed to read value <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>

<head>
    <meta content='text/html; charset=utf-8' http-equiv='content-type' />
    <style type='text/css'>
        body {
            font-family: Arial;
            margin-left: 40px;
        }

        img {
            border: 0 none;
        }

        #content {
            margin-left: auto;
            margin-right: auto
        }

        #message h2 {
            font-size: 20px;
            font-weight: normal;
            color: #000000;
            margin: 34px 0px 0px 0px
        }

        #message p {
            font-size: 13px;
            color: #000000;
            margin: 7px 0px 0px0px
        }

        #errorref {
            font-size: 11px;
            color: #737373;
            margin-top: 41px
        }
    </style>
    <title>Service unavailable</title>
</head>

<body>
    <div id='content'>
        <div id='message'>
            <h2>The request is blocked.</h2>
        </div>
        <div id='errorref'>
            <span>20240601T180922Z-1567b8685c7ll64hwwdgywftn400000003ng00000000db94            </span>
        </div>
    </div>
</body>
</html>

    at com.mojang.authlib.exceptions.MinecraftClientException.toAuthenticationException(MinecraftClientException.java:31) ~[authlib-6.0.54.jar:?]
    at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.fetchProperties(YggdrasilUserApiService.java:154) ~[authlib-6.0.54.jar:?]
    at net.minecraft.class_310.method_55608(class_310.java:465) ~[client-intermediary.jar:?]
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source) ~[?:?]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
    at java.base/java.lang.Thread.run(Unknown Source) [?:?]
Caused by: com.mojang.authlib.exceptions.MinecraftClientException: Failed to read value <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>

<head>
    <meta content='text/html; charset=utf-8' http-equiv='content-type' />
    <style type='text/css'>
        body {
            font-family: Arial;
            margin-left: 40px;
        }

        img {
            border: 0 none;
        }

        #content {
            margin-left: auto;
            margin-right: auto
        }

        #message h2 {
            font-size: 20px;
            font-weight: normal;
            color: #000000;
            margin: 34px 0px 0px 0px
        }

        #message p {
            font-size: 13px;
            color: #000000;
            margin: 7px 0px 0px0px
        }

        #errorref {
            font-size: 11px;
            color: #737373;
            margin-top: 41px
        }
    </style>
    <title>Service unavailable</title>
</head>

<body>
    <div id='content'>
        <div id='message'>
            <h2>The request is blocked.</h2>
        </div>
        <div id='errorref'>
            <span>20240601T180922Z-1567b8685c7ll64hwwdgywftn400000003ng00000000db94            </span>
        </div>
    </div>
</body>
</html>

    at com.mojang.authlib.minecraft.client.ObjectMapper.readValue(ObjectMapper.java:32) ~[authlib-6.0.54.jar:?]
    at com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:99) ~[authlib-6.0.54.jar:?]
    at com.mojang.authlib.minecraft.client.MinecraftClient.get(MinecraftClient.java:57) ~[authlib-6.0.54.jar:?]
    at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.fetchProperties(YggdrasilUserApiService.java:121) ~[authlib-6.0.54.jar:?]
    ... 5 more
Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:397) ~[gson-2.10.1.jar:?]
    at com.google.gson.Gson.fromJson(Gson.java:1227) ~[gson-2.10.1.jar:?]
    at com.google.gson.Gson.fromJson(Gson.java:1137) ~[gson-2.10.1.jar:?]
    at com.google.gson.Gson.fromJson(Gson.java:1047) ~[gson-2.10.1.jar:?]
    at com.google.gson.Gson.fromJson(Gson.java:982) ~[gson-2.10.1.jar:?]
    at com.mojang.authlib.minecraft.client.ObjectMapper.readValue(ObjectMapper.java:30) ~[authlib-6.0.54.jar:?]
    at com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:99) ~[authlib-6.0.54.jar:?]
    at com.mojang.authlib.minecraft.client.MinecraftClient.get(MinecraftClient.java:57) ~[authlib-6.0.54.jar:?]
    at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.fetchProperties(YggdrasilUserApiService.java:121) ~[authlib-6.0.54.jar:?]
    ... 5 more
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
    at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:393) ~[gson-2.10.1.jar:?]
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:386) ~[gson-2.10.1.jar:?]
    at com.google.gson.Gson.fromJson(Gson.java:1227) ~[gson-2.10.1.jar:?]
    at com.google.gson.Gson.fromJson(Gson.java:1137) ~[gson-2.10.1.jar:?]
    at com.google.gson.Gson.fromJson(Gson.java:1047) ~[gson-2.10.1.jar:?]
    at com.google.gson.Gson.fromJson(Gson.java:982) ~[gson-2.10.1.jar:?]
    at com.mojang.authlib.minecraft.client.ObjectMapper.readValue(ObjectMapper.java:30) ~[authlib-6.0.54.jar:?]
    at com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:99) ~[authlib-6.0.54.jar:?]
    at com.mojang.authlib.minecraft.client.MinecraftClient.get(MinecraftClient.java:57) ~[authlib-6.0.54.jar:?]
    at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.fetchProperties(YggdrasilUserApiService.java:121) ~[authlib-6.0.54.jar:?]
    ... 5 more
Bactrosaurus commented 3 months ago

This issue looks like it isn't directly caused by Bactromod. It seems like Mojang's API is blocking your request for user authentication. This usually happens because your IP has sent too many requests. Could be a problem of Mojang's servers or some kind of network issue as well, though. This image shows the compiled HTML message in your log. grafik I couldn't reproduce this issue when trying with the same configuration. I would suggest you try two things:

Bactromod does not change any code related to the authentication process. Therefore, I cannot see any way Bactromod would cause such an issue. Does the problem still occur with no mods installed?

BetaKors commented 3 months ago

After some investigation I found out that the error I posted actually had nothing to do with the crash — this error actually appears at random with any mods installed (happens inconsistently, apparently, and so I have no idea what the actual reason is; but when it does happen it doesn't actually crash my game) and the actual reason for the crash was that apparently I had a broken config file (probably because I've been using the same config file since 1.20.1 if I remember correctly). I just deleted it and now the game is back to working. Sorry for posting something wrong and thanks for the response!