mindstorm38 / portablemc

A fast, reliable and cross-platform command-line Minecraft launcher and API for developers. Including fast and easy installation of common mod loaders such as Fabric, Forge, NeoForge and Quilt.
https://pypi.org/project/portablemc/
GNU General Public License v3.0
369 stars 21 forks source link

Issue authenticating #168

Closed cunhar closed 1 year ago

cunhar commented 1 year ago

I randomly get this error when launching the game via portable mc. If I rerun the command then it runs fine.

14 00:02:50 NLDW2-FF8 launcher.sh[1534]: [00:02:50] [Render thread] [ERROR] Failed to verify authentication
Aug 14 00:02:50 NLDW2-FF8 launcher.sh[1534]: com.mojang.authlib.exceptions.InvalidCredentialsException: Status: 401
Aug 14 00:02:50 NLDW2-FF8 launcher.sh[1534]:    at com.mojang.authlib.exceptions.MinecraftClientHttpException.toAuthenticationException(MinecraftClientHttpException.java:56)
Aug 14 00:02:50 NLDW2-FF8 launcher.sh[1534]:    at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.fetchProperties(YggdrasilUserApiService.java:156)
Aug 14 00:02:50 NLDW2-FF8 launcher.sh[1534]:    at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.<init>(YggdrasilUserApiService.java:55)
Aug 14 00:02:50 NLDW2-FF8 launcher.sh[1534]:    at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.createUserApiService(YggdrasilAuthenticationService.java:124)
Aug 14 00:02:50 NLDW2-FF8 launcher.sh[1534]:    at net.minecraft.class_310.method_31382(class_310.java:733)
Aug 14 00:02:50 NLDW2-FF8 launcher.sh[1534]:    at net.minecraft.class_310.<init>(class_310.java:442)
Aug 14 00:02:50 NLDW2-FF8 launcher.sh[1534]:    at net.minecraft.client.main.Main.main(Main.java:211)
Aug 14 00:02:50 NLDW2-FF8 launcher.sh[1534]:    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:468)
Aug 14 00:02:50 NLDW2-FF8 launcher.sh[1534]:    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
Aug 14 00:02:50 NLDW2-FF8 launcher.sh[1534]:    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
Aug 14 00:02:50 NLDW2-FF8 launcher.sh[1534]: Caused by: MinecraftClientHttpException[type=HTTP_ERROR, status=401, response=ErrorResponse[path='/player/attributes', error='null', details=null, errorMessage='null']]
Aug 14 00:02:50 NLDW2-FF8 launcher.sh[1534]:    at com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:85)
Aug 14 00:02:50 NLDW2-FF8 launcher.sh[1534]:    at com.mojang.authlib.minecraft.client.MinecraftClient.get(MinecraftClient.java:48)
Aug 14 00:02:50 NLDW2-FF8 launcher.sh[1534]:    at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.fetchProperties(YggdrasilUserApiService.java:129)
Aug 14 00:02:50 NLDW2-FF8 launcher.sh[1534]:    ... 8 more
Aug 14 00:02:55 NLDW2-FF8 launcher.sh[1534]: [00:02:55] [Worker-Main-3] [ERROR] Failed to retrieve profile key pair
Aug 14 00:02:55 NLDW2-FF8 launcher.sh[1534]: java.io.IOException: Could not retrieve profile key pair
Aug 14 00:02:55 NLDW2-FF8 launcher.sh[1534]:    at net.minecraft.class_7434.method_43605(class_7434.java:139)
Aug 14 00:02:55 NLDW2-FF8 launcher.sh[1534]:    at net.minecraft.class_7434.method_44291(class_7434.java:79)
Aug 14 00:02:55 NLDW2-FF8 launcher.sh[1534]:    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
Aug 14 00:02:55 NLDW2-FF8 launcher.sh[1534]:    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
Aug 14 00:02:55 NLDW2-FF8 launcher.sh[1534]:    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
Aug 14 00:02:55 NLDW2-FF8 launcher.sh[1534]:    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
Aug 14 00:02:55 NLDW2-FF8 launcher.sh[1534]:    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
Aug 14 00:02:55 NLDW2-FF8 launcher.sh[1534]:    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
Aug 14 00:02:55 NLDW2-FF8 launcher.sh[1534]:    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
mindstorm38 commented 1 year ago

For which MC version? Mojang regularly change the arguments needed for authentication...

cunhar commented 1 year ago

1.20.1 fabric

mindstorm38 commented 1 year ago

So I should be able to reproduce just by repeatedly starting the game with authentication?

cunhar commented 1 year ago

I have it running as a service under a bash file:

[Unit]
Description=Minecraft
After=syslog.target network.target sound.target

[Service]
Type=simple
User=root
Group=audio
ExecStart=/root/launcher.sh
Restart=on-failure

[Install]
WantedBy=multi-user.target
#!/bin/bash

echo '=1 BLEXBOT LAUNCHER INITIATE MAYHEMM!!!'

export PYTHONIOENCODING=utf-8

export __NV_PRIME_RENDER_OFFLOAD=1
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json

export DISPLAY=:1
/usr/bin/feh --bg-fill /root/BG.png

while true; do
        if ping -w 1 8.8.8.8 >/dev/null; then
                echo "IPv4 is up"
                sleep 5
                echo $(date +%Y-%m-%d\ %H:%M:%S)
                /usr/bin/python3 -u -m portablemc start "--jvm-args=-Xmx4G -XX:+UnlockExperimentalVMOptions" fabric:1.20.1 --resol 1920x1080 --server mc.hoobs.live -l xxx@xxx.com
                echo "GAME CRASH :o"
                sleep 5
        else
                echo "IPv4 is down"
                sleep 30
        fi
done

This computer restarts 12am and 12pm UTC and id say a good 25% of the time im getting that error.

cunhar commented 1 year ago

@mindstorm38 were you able to reproduce this? It happened again today during the 12pm UTC restart.

Ristovski commented 1 year ago

Does the server hosted at mc.hoobs.live also restart at the same time? Maybe try removing the autoconnect parameter and see if it still happens.

This seems like some weird network-related race condition where something isn't fully up yet while connecting to the server.

Edit: I can not reproduce this. And the fact that it only happens once (on the first launch after your restarts) and then works from that point on further makes it seem like some weird networking issue. Perhaps also replace the ping -w 1 8.8.8.8 with ping -w 1 mc.hoobs.live, since that would make more sense?

cunhar commented 1 year ago

no the server does not restart.

I had a feeling that it migh tbe because im starting it as a service. Ive gone ahead and added a 20 second delay to start the service for minecraft. I will let you know if the issue happens again.

mindstorm38 commented 1 year ago

The 401 status indicates that the connection is up and that the server somehow responded after checking the tokens.

It seems that you aren't using latest portablemc, could you try with latest portablemc version (4.0.*) and use verbose output (-vv), this should output the command line. I would like to check if the auth arguments are filled when this problem happens.

cunhar commented 1 year ago
# pip show portablemc
Name: portablemc
Version: 4.0.1
Summary: PortableMC is a module that provides both an API for development of your custom launcher and an executable script to run PortableMC CLI.
Home-page: https://github.com/mindstorm38/portablemc
Author: Th▒o Rozier
Author-email: contact@theorozier.fr
License: GPL-3.0-only
Location: /usr/local/lib/python3.8/dist-packages
Requires:
Required-by:

im using 4.0.1 and i will add the verbose cmd without the delay

cunhar commented 1 year ago

@mindstorm38 it happened again -- here are logs (I removed the actual token and replaced it with xxx):

Aug 20 00:01:44 NLDW2-FF8 systemd[1]: Started Minecraft.
Aug 20 00:01:44 NLDW2-FF8 launcher.sh[917]: =1 BLEXBOT LAUNCHER INITIATE MAYHEMM!!!
Aug 20 00:01:49 NLDW2-FF8 launcher.sh[1141]: feh ERROR: Can't open X display. It *is* running, yeah?
Aug 20 00:01:50 NLDW2-FF8 launcher.sh[917]: IPv4 is up
Aug 20 00:01:55 NLDW2-FF8 launcher.sh[917]: 2023-08-20 00:01:55
[  OK  ] Session validated for hoobslive@hotmail.comicrosoft...
[  OK  ] Resolved fabric loader 0.14.22 for 1.20.1
[  OK  ] Loaded version fabric-1.20.1-0.14.222...
[  OK  ] Loaded version 1.20.11... sh[1322]:
[ INFO ] Features: has_custom_resolution, is_quick_play_multiplayer
[  OK  ] Loaded Mojang java 17.0.3.sh[1322]:
[  OK  ] Checked version jaruncher.sh[1322]:
[  OK  ] Checked 3583 assets version 51322]:
[  OK  ] Checked 63 class and 0 native libraries
[  OK  ] Using logger client-1.12r.sh[1322]:
Aug 20 00:01:58 NLDW2-FF8 launcher.sh[1322]: /root/.minecraft/jvm/java-runtime-gamma/bin/java -Djava.library.path=/root/.minecraft/bin/a963645b-26da-482d-a530-02f3b2e22d68 -Djna.tmpdir=/root/.minecraft/bin/a963645b-26da-482d-a530-02f3b2e22d68 -Dorg.lwjgl.system.SharedLibraryExtractPath=/root/.minecraft/bin/a963645b-26da-482d-a530-02f3b2e22d68 -Dio.netty.native.workdir=/root/.minecraft/bin/a963645b-26da-482d-a530-02f3b2e22d68 -Dminecraft.launcher.brand=portablemc -Dminecraft.launcher.version=4.0.1 -cp /root/.minecraft/libraries/net/fabricmc/tiny-mappings-parser/0.3.0+build.17/tiny-mappings-parser-0.3.0+build.17.jar:/root/.minecraft/libraries/net/fabricmc/sponge-mixin/0.12.5+mixin.0.8.5/sponge-mixin-0.12.5+mixin.0.8.5.jar:/root/.minecraft/libraries/net/fabricmc/tiny-remapper/0.8.2/tiny-remapper-0.8.2.jar:/root/.minecraft/libraries/net/fabricmc/access-widener/2.1.0/access-widener-2.1.0.jar:/root/.minecraft/libraries/org/ow2/asm/asm/9.5/asm-9.5.jar:/root/.minecraft/libraries/org/ow2/asm/asm-analysis/9.5/asm-analysis-9.5.jar:/root/.minecraft/libraries/org/ow2/asm/asm-commons/9.5/asm-commons-9.5.jar:/root/.minecraft/libraries/org/ow2/asm/asm-tree/9.5/asm-tree-9.5.jar:/root/.minecraft/libraries/org/ow2/asm/asm-util/9.5/asm-util-9.5.jar:/root/.minecraft/libraries/net/fabricmc/intermediary/1.20.1/intermediary-1.20.1.jar:/root/.minecraft/libraries/net/fabricmc/fabric-loader/0.14.22/fabric-loader-0.14.22.jar:/root/.minecraft/libraries/com/github/oshi/oshi-core/6.2.2/oshi-core-6.2.2.jar:/root/.minecraft/libraries/com/google/code/gson/gson/2.10/gson-2.10.jar:/root/.minecraft/libraries/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar:/root/.minecraft/libraries/com/google/guava/guava/31.1-jre/guava-31.1-jre.jar:/root/.minecraft/libraries/com/ibm/icu/icu4j/71.1/icu4j-71.1.jar:/root/.minecraft/libraries/com/mojang/authlib/4.0.43/authlib-4.0.43.jar:/root/.minecraft/libraries/com/mojang/blocklist/1.0.10/blocklist-1.0.10.jar:/root/.minecraft/libraries/com/mojang/brigadier/1.1.8/brigadier-1.1.8.jar:/root/.minecraft/libraries/com/mojang/datafixerupper/6.0.8/datafixerupper-6.0.8.jar:/root/.minecraft/libraries/com/mojang/logging/1.1.1/logging-1.1.1.jar:/root/.minecraft/libraries/com/mojang/patchy/2.2.10/patchy-2.2.10.jar:/root/.minecraft/libraries/com/mojang/text2speech/1.17.9/text2speech-1.17.9.jar:/root/.minecraft/libraries/commons-codec/commons-codec/1.15/commons-codec-1.15.jar:/root/.minecraft/libraries/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar:/root/.minecraft/libraries/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/root/.minecraft/libraries/io/netty/netty-buffer/4.1.82.Final/netty-buffer-4.1.82.Final.jar:/root/.minecraft/libraries/io/netty/netty-codec/4.1.82.Final/netty-codec-4.1.82.Final.jar:/root/.minecraft/libraries/io/netty/netty-common/4.1.82.Final/netty-common-4.1.82.Final.jar:/root/.minecraft/libraries/io/netty/netty-handler/4.1.82.Final/netty-handler-4.1.82.Final.jar:/root/.minecraft/libraries/io/netty/netty-resolver/4.1.82.Final/netty-resolver-4.1.82.Final.jar:/root/.minecraft/libraries/io/netty/netty-transport-classes-epoll/4.1.82.Final/netty-transport-classes-epoll-4.1.82.Final.jar:/root/.minecraft/libraries/io/netty/netty-transport-native-epoll/4.1.82.Final/netty-transport-native-epoll-4.1.82.Final-linux-aarch_64.jar:/root/.minecraft/libraries/io/netty/netty-transport-native-epoll/4.1.82.Final/netty-transport-native-epoll-4.1.82.Final-linux-x86_64.jar:/root/.minecraft/libraries/io/netty/netty-transport-native-unix-common/4.1.82.Final/netty-transport-native-unix-common-4.1.82.Final.jar:/root/.minecraft/libraries/io/netty/netty-transport/4.1.82.Final/netty-transport-4.1.82.Final.jar:/root/.minecraft/libraries/it/unimi/dsi/fastutil/8.5.9/fastutil-8.5.9.jar:/root/.minecraft/libraries/net/java/dev/jna/jna-platform/5.12.1/jna-platform-5.12.1.jar:/root/.minecraft/libraries/net/java/dev/jna/jna/5.12.1/jna-5.12.1.jar:/root/.minecraft/libraries/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/root/.minecraft/libraries/org/apache/commons/commons-compress/1.21/commons-compress-1.21.jar:/root/.minecraft/libraries/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar:/root/.minecraft/libraries/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar:/root/.minecraft/libraries/org/apache/httpcomponents/httpcore/4.4.15/httpcore-4.4.15.jar:/root/.minecraft/libraries/org/apache/logging/log4j/log4j-api/2.19.0/log4j-api-2.19.0.jar:/root/.minecraft/libraries/org/apache/logging/log4j/log4j-core/2.19.0/log4j-core-2.19.0.jar:/root/.minecraft/libraries/org/apache/logging/log4j/log4j-slf4j2-impl/2.19.0/log4j-slf4j2-impl-2.19.0.jar:/root/.minecraft/libraries/org/joml/joml/1.10.5/joml-1.10.5.jar:/root/.minecraft/libraries/org/lwjgl/lwjgl-glfw/3.3.1/lwjgl-glfw-3.3.1.jar:/root/.minecraft/libraries/org/lwjgl/lwjgl-glfw/3.3.1/lwjgl-glfw-3.3.1-natives-linux.jar:/root/.minecraft/libraries/org/lwjgl/lwjgl-jemalloc/3.3.1/lwjgl-jemalloc-3.3.1.jar:/root/.minecraft/libraries/org/lwjgl/lwjgl-jemalloc/3.3.1/lwjgl-jemalloc-3.3.1-natives-linux.jar:/root/.minecraft/libraries/org/lwjgl/lwjgl-openal/3.3.1/lwjgl-openal-3.3.1.jar:/root/.minecraft/libraries/org/lwjgl/lwjgl-openal/3.3.1/lwjgl-openal-3.3.1-natives-linux.jar:/root/.minecraft/libraries/org/lwjgl/lwjgl-opengl/3.3.1/lwjgl-opengl-3.3.1.jar:/root/.minecraft/libraries/org/lwjgl/lwjgl-opengl/3.3.1/lwjgl-opengl-3.3.1-natives-linux.jar:/root/.minecraft/libraries/org/lwjgl/lwjgl-stb/3.3.1/lwjgl-stb-3.3.1.jar:/root/.minecraft/libraries/org/lwjgl/lwjgl-stb/3.3.1/lwjgl-stb-3.3.1-natives-linux.jar:/root/.minecraft/libraries/org/lwjgl/lwjgl-tinyfd/3.3.1/lwjgl-tinyfd-3.3.1.jar:/root/.minecraft/libraries/org/lwjgl/lwjgl-tinyfd/3.3.1/lwjgl-tinyfd-3.3.1-natives-linux.jar:/root/.minecraft/libraries/org/lwjgl/lwjgl/3.3.1/lwjgl-3.3.1.jar:/root/.minecraft/libraries/org/lwjgl/lwjgl/3.3.1/lwjgl-3.3.1-natives-linux.jar:/root/.minecraft/libraries/org/slf4j/slf4j-api/2.0.1/slf4j-api-2.0.1.jar:/root/.minecraft/versions/fabric-1.20.1-0.14.22/fabric-1.20.1-0.14.22.jar -DFabricMcEmu= net.minecraft.client.main.Main  -Dlog4j.configurationFile=/root/.minecraft/assets/log_configs/client-1.12.xml -Xmx4G -XX:+UnlockExperimentalVMOptions net.fabricmc.loader.impl.launch.knot.KnotClient --username BlexBot --version fabric-1.20.1-0.14.22 --gameDir /root/.minecraft --assetsDir /root/.minecraft/assets --assetIndex 5 --uuid ff53a36b12024f97965b32c319085497 --accessToken xxx --clientId efaed146-8bcd-4f29-b083-6f0a3cd9bfe4 --xuid 2535428885626693 --userType msa --versionType release --width 1920 --height 1080 --quickPlayMultiplayer mc.hoobs.live:25565
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]: [00:02:06] [main] [INFO] Loading Minecraft 1.20.1 with Fabric Loader 0.14.22
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]: [00:02:06] [main] [WARN] Warnings were found!
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:  - Mod 'LambDynamicLights' (lambdynlights) 2.3.1+1.20.1 recommends version 0.19.1 or later of quilt_loader, which is missing!
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:     - You should install version 0.19.1 or later of quilt_loader for the optimal experience.
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]: [00:02:06] [main] [INFO] Loading 67 mods:
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:    - autoreconnect 2.3.0-dev
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:    - boostedbrightness 2.2.0
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:    - cloth-config 11.1.106
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       \-- cloth-basic-math 0.6.1
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:    - disableinsecurechattoast 1.1.0
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:    - fabric-api 0.87.0+1.20.1
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-api-base 0.4.30+7abfd51577
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-api-lookup-api-v1 1.6.35+4d8536c977
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-biome-api-v1 13.0.10+b3afc78b77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-block-api-v1 1.0.9+e022e5d177
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-blockrenderlayer-v1 1.1.40+b3afc78b77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-client-tags-api-v1 1.1.1+97bb207577
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-command-api-v1 1.2.33+f71b366f77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-command-api-v2 2.2.12+b3afc78b77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-commands-v0 0.2.50+df3654b377
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-containers-v0 0.1.63+df3654b377
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-content-registries-v0 4.0.9+b3afc78b77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-convention-tags-v1 1.5.4+a1a980da77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-crash-report-info-v1 0.2.18+aeb40ebe77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-data-generation-api-v1 12.2.2+1e61dba177
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-dimensions-v1 2.1.53+8536527b77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-entity-events-v1 1.5.22+b3afc78b77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-events-interaction-v0 0.6.1+e91849a877
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-events-lifecycle-v0 0.2.62+df3654b377
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-game-rule-api-v1 1.0.38+b04edc7a77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-item-api-v1 2.1.27+b3afc78b77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-item-group-api-v1 4.0.10+23d9108177
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-key-binding-api-v1 1.0.36+fb8d95da77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-keybindings-v0 0.2.34+df3654b377
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-lifecycle-events-v1 2.2.21+b3afc78b77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-loot-api-v2 1.1.39+b3afc78b77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-loot-tables-v1 1.1.43+9e7660c677
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-message-api-v1 5.1.7+3265161977
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-mining-level-api-v1 2.1.49+b3afc78b77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-model-loading-api-v1 1.0.2+709a987177
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-models-v0 0.4.1+9386d8a777
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-networking-api-v1 1.3.10+eeb8eb3677
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-networking-v0 0.3.50+df3654b377
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-object-builder-api-v1 11.1.1+6beca84877
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-particles-v1 1.1.1+201a23a077
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-recipe-api-v1 1.0.20+b3afc78b77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-registry-sync-v0 2.3.2+4df89eb277
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-renderer-api-v1 3.1.2+6bdb2ed077
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-renderer-indigo 1.4.2+6bdb2ed077
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-renderer-registries-v1 3.2.45+df3654b377
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-rendering-data-attachment-v1 0.3.34+b3afc78b77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-rendering-fluids-v1 3.0.27+b3afc78b77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-rendering-v0 1.1.48+df3654b377
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-rendering-v1 3.0.7+b3afc78b77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-resource-conditions-api-v1 2.3.5+ea08f9d877
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-resource-loader-v0 0.11.9+132c48c177
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-screen-api-v1 2.0.7+b3afc78b77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-screen-handler-api-v1 1.3.29+b3afc78b77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-sound-api-v1 1.0.12+b3afc78b77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- fabric-transfer-api-v1 3.3.0+cdf060b277
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       \-- fabric-transitive-access-wideners-v1 4.3.0+6c31357e77
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:    - fabricloader 0.14.22
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:    - inventoryhud 3.4.18
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:    - java 17
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:    - lambdynlights 2.3.1+1.20.1
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       |-- pride 1.2.0+1.19.4
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:       \-- spruceui 5.0.0+1.20
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:    - minecraft 1.20.1
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:    - modmenu 7.2.1
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:    - simplefog 1.4.0
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:    - spectater 2.0.3
Aug 20 00:02:06 NLDW2-FF8 launcher.sh[1322]:    - xaerominimapfair 23.4.4
Aug 20 00:02:07 NLDW2-FF8 launcher.sh[1322]: [00:02:07] [main] [INFO] SpongePowered MIXIN Subsystem Version=0.8.5 Source=file:/root/.minecraft/libraries/net/fabricmc/sponge-mixin/0.12.5+mixin.0.8.5/sponge-mixin-0.12.5+mixin.0.8.5.jar Service=Knot/Fabric Env=CLIENT
Aug 20 00:02:08 NLDW2-FF8 launcher.sh[1322]: [00:02:08] [main] [INFO] Compatibility level set to JAVA_17
Aug 20 00:02:08 NLDW2-FF8 launcher.sh[1322]: [00:02:08] [main] [WARN] Error loading class: me/jellysquid/mods/sodium/client/gui/options/control/SliderControl (java.lang.ClassNotFoundException: me/jellysquid/mods/sodium/client/gui/options/control/SliderControl)
Aug 20 00:02:08 NLDW2-FF8 launcher.sh[1322]: [00:02:08] [main] [WARN] Error loading class: me/jellysquid/mods/sodium/client/gui/options/OptionImpl (java.lang.ClassNotFoundException: me/jellysquid/mods/sodium/client/gui/options/OptionImpl)
Aug 20 00:02:17 NLDW2-FF8 launcher.sh[1322]: [00:02:17] [Datafixer Bootstrap] [INFO] 188 Datafixer optimizations took 202 milliseconds
Aug 20 00:02:19 NLDW2-FF8 launcher.sh[1322]: [00:02:19] [Render thread] [INFO] Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
Aug 20 00:02:19 NLDW2-FF8 launcher.sh[1322]: [00:02:19] [Render thread] [ERROR] Failed to verify authentication
Aug 20 00:02:19 NLDW2-FF8 launcher.sh[1322]: com.mojang.authlib.exceptions.InvalidCredentialsException: Status: 401
Aug 20 00:02:19 NLDW2-FF8 launcher.sh[1322]:    at com.mojang.authlib.exceptions.MinecraftClientHttpException.toAuthenticationException(MinecraftClientHttpException.java:56)
Aug 20 00:02:19 NLDW2-FF8 launcher.sh[1322]:    at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.fetchProperties(YggdrasilUserApiService.java:156)
Aug 20 00:02:19 NLDW2-FF8 launcher.sh[1322]:    at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.<init>(YggdrasilUserApiService.java:55)
Aug 20 00:02:19 NLDW2-FF8 launcher.sh[1322]:    at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.createUserApiService(YggdrasilAuthenticationService.java:124)
Aug 20 00:02:19 NLDW2-FF8 launcher.sh[1322]:    at net.minecraft.class_310.method_31382(class_310.java:733)
Aug 20 00:02:19 NLDW2-FF8 launcher.sh[1322]:    at net.minecraft.class_310.<init>(class_310.java:442)
Aug 20 00:02:19 NLDW2-FF8 launcher.sh[1322]:    at net.minecraft.client.main.Main.main(Main.java:211)
Aug 20 00:02:19 NLDW2-FF8 launcher.sh[1322]:    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:468)
Aug 20 00:02:19 NLDW2-FF8 launcher.sh[1322]:    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
Aug 20 00:02:19 NLDW2-FF8 launcher.sh[1322]:    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
Aug 20 00:02:19 NLDW2-FF8 launcher.sh[1322]: Caused by: MinecraftClientHttpException[type=HTTP_ERROR, status=401, response=ErrorResponse[path='/player/attributes', error='null', details=null, errorMessage='null']]
Aug 20 00:02:19 NLDW2-FF8 launcher.sh[1322]:    at com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:85)
Aug 20 00:02:19 NLDW2-FF8 launcher.sh[1322]:    at com.mojang.authlib.minecraft.client.MinecraftClient.get(MinecraftClient.java:48)
Aug 20 00:02:19 NLDW2-FF8 launcher.sh[1322]:    at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.fetchProperties(YggdrasilUserApiService.java:129)
Aug 20 00:02:19 NLDW2-FF8 launcher.sh[1322]:    ... 8 more
Aug 20 00:02:20 NLDW2-FF8 launcher.sh[1322]: [00:02:20] [Render thread] [INFO] Setting user: BlexBot
Aug 20 00:02:20 NLDW2-FF8 launcher.sh[1322]: [00:02:20] [Render thread] [INFO] [Indigo] Registering Indigo renderer!
Aug 20 00:02:21 NLDW2-FF8 launcher.sh[1322]: [00:02:21] [Render thread] [INFO] [STDOUT]: Inventory HUD + has been initialized!
Aug 20 00:02:21 NLDW2-FF8 launcher.sh[1322]: [00:02:21] [Render thread] [INFO] [LambDynLights] Initializing LambDynamicLights...
Aug 20 00:02:21 NLDW2-FF8 launcher.sh[1322]: [00:02:21] [Render thread] [INFO] [LambDynLights] Configuration loaded.
Aug 20 00:02:21 NLDW2-FF8 launcher.sh[1322]: [00:02:21] [Worker-Main-1] [INFO] Checking mod updates...
Aug 20 00:02:21 NLDW2-FF8 launcher.sh[1322]: [00:02:21] [Render thread] [INFO] Loading Xaero's Minimap - Stage 1/2
Aug 20 00:02:21 NLDW2-FF8 launcher.sh[1322]: [00:02:21] [Render thread] [INFO] Backend library: LWJGL version 3.3.1 SNAPSHOT
Aug 20 00:02:25 NLDW2-FF8 launcher.sh[1322]: [00:02:25] [Worker-Main-3] [ERROR] Failed to retrieve profile key pair
Aug 20 00:02:25 NLDW2-FF8 launcher.sh[1322]: java.io.IOException: Could not retrieve profile key pair
Aug 20 00:02:25 NLDW2-FF8 launcher.sh[1322]:    at net.minecraft.class_7434.method_43605(class_7434.java:139)
Aug 20 00:02:25 NLDW2-FF8 launcher.sh[1322]:    at net.minecraft.class_7434.method_44291(class_7434.java:79)
Aug 20 00:02:25 NLDW2-FF8 launcher.sh[1322]:    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
Aug 20 00:02:25 NLDW2-FF8 launcher.sh[1322]:    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
Aug 20 00:02:25 NLDW2-FF8 launcher.sh[1322]:    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
Aug 20 00:02:25 NLDW2-FF8 launcher.sh[1322]:    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
Aug 20 00:02:25 NLDW2-FF8 launcher.sh[1322]:    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
Aug 20 00:02:25 NLDW2-FF8 launcher.sh[1322]:    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
Aug 20 00:02:25 NLDW2-FF8 launcher.sh[1322]:    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)  
mindstorm38 commented 1 year ago

Thank you, so there no obvious problem with the command line... I need to check what is done by official launcher...

cunhar commented 1 year ago

Ive notticed that i also got an error here from xvfb not being ready and causing a race condition.

Aug 20 00:01:49 NLDW2-FF8 launcher.sh[1141]: feh ERROR: Can't open X display. It *is* running, yeah?

I'm pretty sure there is nothing wrong with your code and its really because im starting it as a service.

Ived added this to my launch script

echo -n "Waiting for Xvfb to be ready..."
while ! xdpyinfo -display "${DISPLAY}" >/dev/null 2>&1; do
  echo -n "."
  sleep 1
done

for additional context:

i'm running all this on a headless linux server that captures a virtual x11 to stream video to youtube

mindstorm38 commented 1 year ago

I would be surprised if running it as a service was the root cause... Because all the authentication stuff goes through Microsoft/Mojang APIs: my launcher requests the token from Microsoft, and then give it to Minecraft which validates it against Mojang's servers. This is annoying because the new Microsoft authentication isn't well documented and I might not validate is enough.

Best documentation is https://wiki.vg/Microsoft_Authentication_Scheme

cunhar commented 1 year ago

ok. i will let you know if i have any more info

cunhar commented 1 year ago

@mindstorm38 --- three days with no issues.

The issue was be happening as a weird side effect of me outputing the game and obs into a frame buffer (xvfb) that wasnt ready to receive output (ie race-condition). I tested it with the frame buffer off and was able to reproduce it.

i love computers is swear 🗡️ 💀

I think you are ok to close this issue.