From 5df25538d46a0fba435335315a73fcd587548cdc Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 8 Aug 2024 13:23:53 +0200 Subject: [PATCH 1/6] Add problem and solution for Auth server unreachable --- lang/en.json | 4 +- src/Analyser/VanillaAnalyser.php | 2 + .../Problem/Vanilla/AuthServerProblem.php | 50 ++ .../Solution/Vanilla/AuthServerSolution.php | 17 + test/data/Vanilla/vanilla-auth-key.json | 533 ++++++++++++++++++ test/data/Vanilla/vanilla-auth-key.log | 53 ++ test/tests/Logs/AutoLogsTest.php | 10 + 7 files changed, 668 insertions(+), 1 deletion(-) create mode 100644 src/Analysis/Problem/Vanilla/AuthServerProblem.php create mode 100644 src/Analysis/Solution/Vanilla/AuthServerSolution.php create mode 100644 test/data/Vanilla/vanilla-auth-key.json create mode 100644 test/data/Vanilla/vanilla-auth-key.log diff --git a/lang/en.json b/lang/en.json index 1676aa56..8aab6a02 100644 --- a/lang/en.json +++ b/lang/en.json @@ -87,5 +87,7 @@ "type-unknown": "Unknown Log", "forge-language-provider-version-problem": "The mod '{{mod-file}}' requires '{{required-version}}', but '{{found-version}}' is installed.", "plugin-api-version-lower-than-allowed-problem": "The plugin '{{plugin-name}}' has an API version specified that is lower than the minimum allowed version.", - "change-minimum-api-version-solution": "Change 'minimum-api' in bukkit.yml to {{api-version}}, lower or even 'none'." + "change-minimum-api-version-solution": "Change 'minimum-api' in bukkit.yml to {{api-version}}, lower or even 'none'.", + "auth-server-problem": "The Mojang/Microsoft authentication servers are currently unreachable!", + "auth-server-solution": "Wait a few minutes and try again. If the issue persists, check the official Mojang/Microsoft channels for any known authentication server problems." } diff --git a/src/Analyser/VanillaAnalyser.php b/src/Analyser/VanillaAnalyser.php index c523e245..758f7d85 100644 --- a/src/Analyser/VanillaAnalyser.php +++ b/src/Analyser/VanillaAnalyser.php @@ -7,6 +7,7 @@ use Aternos\Codex\Minecraft\Analysis\Problem\Vanilla\MalformedEncodingProblem; use Aternos\Codex\Minecraft\Analysis\Problem\Vanilla\OldPlayerDirectoryProblem; use Aternos\Codex\Minecraft\Analysis\Problem\Vanilla\TickingBlockEntityProblem; +use Aternos\Codex\Minecraft\Analysis\Problem\Vanilla\AuthServerProblem; /** * Class VanillaAnalyser @@ -23,5 +24,6 @@ public function __construct() $this->addPossibleInsightClass(AquaticWorldOnOlderVersionProblem::class); $this->addPossibleInsightClass(TickingBlockEntityProblem::class); $this->addPossibleInsightClass(MalformedEncodingProblem::class); + $this->addPossibleInsightClass(AuthServerProblem::class); } } \ No newline at end of file diff --git a/src/Analysis/Problem/Vanilla/AuthServerProblem.php b/src/Analysis/Problem/Vanilla/AuthServerProblem.php new file mode 100644 index 00000000..0ca6159d --- /dev/null +++ b/src/Analysis/Problem/Vanilla/AuthServerProblem.php @@ -0,0 +1,50 @@ +getTranslation("auth-server-problem"); + } + + /** + * Get an array of possible patterns + * + * The array key of the pattern will be passed to setMatches() + * + * @return string[] + */ + public static function getPatterns(): array + { + return ['#Failed to read from https://api\.minecraftservices\.com/publickeys due to Connect#']; + } + + + /** + * Apply the matches from the pattern + * + * @param array $matches + * @param mixed $patternKey + * @return void + */ + + public function setMatches(array $matches, mixed $patternKey): void + { + $this->addSolution((new AuthServerSolution())); + } +} \ No newline at end of file diff --git a/src/Analysis/Solution/Vanilla/AuthServerSolution.php b/src/Analysis/Solution/Vanilla/AuthServerSolution.php new file mode 100644 index 00000000..570a0695 --- /dev/null +++ b/src/Analysis/Solution/Vanilla/AuthServerSolution.php @@ -0,0 +1,17 @@ +getTranslation("auth-server-solution"); + } +} \ No newline at end of file diff --git a/test/data/Vanilla/vanilla-auth-key.json b/test/data/Vanilla/vanilla-auth-key.json new file mode 100644 index 00000000..6de73bb6 --- /dev/null +++ b/test/data/Vanilla/vanilla-auth-key.json @@ -0,0 +1,533 @@ +{ + "id": "vanilla\/server", + "name": "Vanilla", + "type": "Server Log", + "version": "1.21", + "title": "Vanilla 1.21 Server Log", + "entries": [ + { + "level": 6, + "time": null, + "prefix": "[12:55:07] [ServerMain\/INFO]:", + "lines": [ + { + "number": 1, + "content": "[12:55:07] [ServerMain\/INFO]: Environment: Environment[sessionHost=https:\/\/sessionserver.mojang.com, servicesHost=https:\/\/api.minecraftservices.com, name=PROD]" + } + ] + }, + { + "level": 3, + "time": null, + "prefix": "[12:55:07] [Yggdrasil Key Fetcher\/ERROR]:", + "lines": [ + { + "number": 2, + "content": "[12:55:07] [Yggdrasil Key Fetcher\/ERROR]: Failed to request yggdrasil public key" + }, + { + "number": 3, + "content": "com.mojang.authlib.exceptions.MinecraftClientException: Failed to read from https:\/\/api.minecraftservices.com\/publickeys due to Connection refused" + }, + { + "number": 4, + "content": "\tat com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:108) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 5, + "content": "\tat com.mojang.authlib.minecraft.client.MinecraftClient.get(MinecraftClient.java:57) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 6, + "content": "\tat com.mojang.authlib.yggdrasil.YggdrasilServicesKeyInfo.fetch(YggdrasilServicesKeyInfo.java:114) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 7, + "content": "\tat com.mojang.authlib.yggdrasil.YggdrasilServicesKeyInfo$1.run(YggdrasilServicesKeyInfo.java:89) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 8, + "content": "\tat java.base\/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]" + }, + { + "number": 9, + "content": "\tat java.base\/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]" + }, + { + "number": 10, + "content": "\tat java.base\/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]" + }, + { + "number": 11, + "content": "\tat java.base\/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]" + }, + { + "number": 12, + "content": "\tat java.base\/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]" + }, + { + "number": 13, + "content": "\tat java.base\/java.lang.Thread.run(Thread.java:1583) [?:?]" + }, + { + "number": 14, + "content": "Caused by: java.net.ConnectException: Connection refused" + }, + { + "number": 15, + "content": "\tat java.base\/sun.nio.ch.Net.pollConnect(Native Method) ~[?:?]" + }, + { + "number": 16, + "content": "\tat java.base\/sun.nio.ch.Net.pollConnectNow(Net.java:682) ~[?:?]" + }, + { + "number": 17, + "content": "\tat java.base\/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:542) ~[?:?]" + }, + { + "number": 18, + "content": "\tat java.base\/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:592) ~[?:?]" + }, + { + "number": 19, + "content": "\tat java.base\/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) ~[?:?]" + }, + { + "number": 20, + "content": "\tat java.base\/java.net.Socket.connect(Socket.java:751) ~[?:?]" + }, + { + "number": 21, + "content": "\tat java.base\/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304) ~[?:?]" + }, + { + "number": 22, + "content": "\tat java.base\/sun.net.NetworkClient.doConnect(NetworkClient.java:178) ~[?:?]" + }, + { + "number": 23, + "content": "\tat java.base\/sun.net.www.http.HttpClient.openServer(HttpClient.java:531) ~[?:?]" + }, + { + "number": 24, + "content": "\tat java.base\/sun.net.www.http.HttpClient.openServer(HttpClient.java:636) ~[?:?]" + }, + { + "number": 25, + "content": "\tat java.base\/sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:264) ~[?:?]" + }, + { + "number": 26, + "content": "\tat java.base\/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:377) ~[?:?]" + }, + { + "number": 27, + "content": "\tat java.base\/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193) ~[?:?]" + }, + { + "number": 28, + "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1282) ~[?:?]" + }, + { + "number": 29, + "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1123) ~[?:?]" + }, + { + "number": 30, + "content": "\tat java.base\/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179) ~[?:?]" + }, + { + "number": 31, + "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1675) ~[?:?]" + }, + { + "number": 32, + "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1599) ~[?:?]" + }, + { + "number": 33, + "content": "\tat java.base\/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:531) ~[?:?]" + }, + { + "number": 34, + "content": "\tat java.base\/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:307) ~[?:?]" + }, + { + "number": 35, + "content": "\tat com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:84) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 36, + "content": "\t... 9 more" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:07] [ServerMain\/INFO]:", + "lines": [ + { + "number": 37, + "content": "[12:55:07] [ServerMain\/INFO]: No existing world data, creating new world" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:07] [ServerMain\/INFO]:", + "lines": [ + { + "number": 38, + "content": "[12:55:07] [ServerMain\/INFO]: Loaded 1290 recipes" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:08] [ServerMain\/INFO]:", + "lines": [ + { + "number": 39, + "content": "[12:55:08] [ServerMain\/INFO]: Loaded 1399 advancements" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 40, + "content": "[12:55:08] [Server thread\/INFO]: Starting minecraft server version 1.21" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 41, + "content": "[12:55:08] [Server thread\/INFO]: Loading properties" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 42, + "content": "[12:55:08] [Server thread\/INFO]: Default game type: SURVIVAL" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 43, + "content": "[12:55:08] [Server thread\/INFO]: Generating keypair" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 44, + "content": "[12:55:08] [Server thread\/INFO]: Starting Minecraft server on *:25565" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 45, + "content": "[12:55:08] [Server thread\/INFO]: Using epoll channel type" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 46, + "content": "[12:55:08] [Server thread\/INFO]: Preparing level \"world\"" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:10] [Server thread\/INFO]:", + "lines": [ + { + "number": 47, + "content": "[12:55:10] [Server thread\/INFO]: Preparing start region for dimension minecraft:overworld" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:10] [Worker-Main-18\/INFO]:", + "lines": [ + { + "number": 48, + "content": "[12:55:10] [Worker-Main-18\/INFO]: Preparing spawn area: 2%" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:10] [Worker-Main-5\/INFO]:", + "lines": [ + { + "number": 49, + "content": "[12:55:10] [Worker-Main-5\/INFO]: Preparing spawn area: 2%" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:11] [Worker-Main-19\/INFO]:", + "lines": [ + { + "number": 50, + "content": "[12:55:11] [Worker-Main-19\/INFO]: Preparing spawn area: 18%" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:11] [Worker-Main-13\/INFO]:", + "lines": [ + { + "number": 51, + "content": "[12:55:11] [Worker-Main-13\/INFO]: Preparing spawn area: 51%" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:12] [Server thread\/INFO]:", + "lines": [ + { + "number": 52, + "content": "[12:55:12] [Server thread\/INFO]: Time elapsed: 1651 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:12] [Server thread\/INFO]:", + "lines": [ + { + "number": 53, + "content": "[12:55:12] [Server thread\/INFO]: Done (3.475s)! For help, type \"help\"" + } + ] + } + ], + "analysis": { + "problems": [ + { + "message": "The Mojang\/Microsoft authentication servers are currently unreachable!", + "counter": 1, + "entry": { + "level": 3, + "time": null, + "prefix": "[12:55:07] [Yggdrasil Key Fetcher\/ERROR]:", + "lines": [ + { + "number": 2, + "content": "[12:55:07] [Yggdrasil Key Fetcher\/ERROR]: Failed to request yggdrasil public key" + }, + { + "number": 3, + "content": "com.mojang.authlib.exceptions.MinecraftClientException: Failed to read from https:\/\/api.minecraftservices.com\/publickeys due to Connection refused" + }, + { + "number": 4, + "content": "\tat com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:108) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 5, + "content": "\tat com.mojang.authlib.minecraft.client.MinecraftClient.get(MinecraftClient.java:57) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 6, + "content": "\tat com.mojang.authlib.yggdrasil.YggdrasilServicesKeyInfo.fetch(YggdrasilServicesKeyInfo.java:114) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 7, + "content": "\tat com.mojang.authlib.yggdrasil.YggdrasilServicesKeyInfo$1.run(YggdrasilServicesKeyInfo.java:89) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 8, + "content": "\tat java.base\/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]" + }, + { + "number": 9, + "content": "\tat java.base\/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]" + }, + { + "number": 10, + "content": "\tat java.base\/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]" + }, + { + "number": 11, + "content": "\tat java.base\/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]" + }, + { + "number": 12, + "content": "\tat java.base\/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]" + }, + { + "number": 13, + "content": "\tat java.base\/java.lang.Thread.run(Thread.java:1583) [?:?]" + }, + { + "number": 14, + "content": "Caused by: java.net.ConnectException: Connection refused" + }, + { + "number": 15, + "content": "\tat java.base\/sun.nio.ch.Net.pollConnect(Native Method) ~[?:?]" + }, + { + "number": 16, + "content": "\tat java.base\/sun.nio.ch.Net.pollConnectNow(Net.java:682) ~[?:?]" + }, + { + "number": 17, + "content": "\tat java.base\/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:542) ~[?:?]" + }, + { + "number": 18, + "content": "\tat java.base\/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:592) ~[?:?]" + }, + { + "number": 19, + "content": "\tat java.base\/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) ~[?:?]" + }, + { + "number": 20, + "content": "\tat java.base\/java.net.Socket.connect(Socket.java:751) ~[?:?]" + }, + { + "number": 21, + "content": "\tat java.base\/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304) ~[?:?]" + }, + { + "number": 22, + "content": "\tat java.base\/sun.net.NetworkClient.doConnect(NetworkClient.java:178) ~[?:?]" + }, + { + "number": 23, + "content": "\tat java.base\/sun.net.www.http.HttpClient.openServer(HttpClient.java:531) ~[?:?]" + }, + { + "number": 24, + "content": "\tat java.base\/sun.net.www.http.HttpClient.openServer(HttpClient.java:636) ~[?:?]" + }, + { + "number": 25, + "content": "\tat java.base\/sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:264) ~[?:?]" + }, + { + "number": 26, + "content": "\tat java.base\/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:377) ~[?:?]" + }, + { + "number": 27, + "content": "\tat java.base\/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193) ~[?:?]" + }, + { + "number": 28, + "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1282) ~[?:?]" + }, + { + "number": 29, + "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1123) ~[?:?]" + }, + { + "number": 30, + "content": "\tat java.base\/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179) ~[?:?]" + }, + { + "number": 31, + "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1675) ~[?:?]" + }, + { + "number": 32, + "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1599) ~[?:?]" + }, + { + "number": 33, + "content": "\tat java.base\/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:531) ~[?:?]" + }, + { + "number": 34, + "content": "\tat java.base\/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:307) ~[?:?]" + }, + { + "number": 35, + "content": "\tat com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:84) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 36, + "content": "\t... 9 more" + } + ] + }, + "solutions": [ + { + "message": "Wait a few minutes and try again. If the issue persists, check the official Mojang\/Microsoft channels for any known authentication server problems." + } + ] + } + ], + "information": [ + { + "message": "Minecraft version: 1.21", + "counter": 1, + "entry": { + "level": 6, + "time": null, + "prefix": "[12:55:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 40, + "content": "[12:55:08] [Server thread\/INFO]: Starting minecraft server version 1.21" + } + ] + }, + "label": "Minecraft version", + "value": "1.21" + } + ] + } +} \ No newline at end of file diff --git a/test/data/Vanilla/vanilla-auth-key.log b/test/data/Vanilla/vanilla-auth-key.log new file mode 100644 index 00000000..5b9edbce --- /dev/null +++ b/test/data/Vanilla/vanilla-auth-key.log @@ -0,0 +1,53 @@ +[12:55:07] [ServerMain/INFO]: Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD] +[12:55:07] [Yggdrasil Key Fetcher/ERROR]: Failed to request yggdrasil public key +com.mojang.authlib.exceptions.MinecraftClientException: Failed to read from https://api.minecraftservices.com/publickeys due to Connection refused + at com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:108) ~[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.YggdrasilServicesKeyInfo.fetch(YggdrasilServicesKeyInfo.java:114) ~[authlib-6.0.54.jar:?] + at com.mojang.authlib.yggdrasil.YggdrasilServicesKeyInfo$1.run(YggdrasilServicesKeyInfo.java:89) ~[authlib-6.0.54.jar:?] + at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?] + at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?] + at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?] + 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) [?:?] +Caused by: java.net.ConnectException: Connection refused + at java.base/sun.nio.ch.Net.pollConnect(Native Method) ~[?:?] + at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:682) ~[?:?] + at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:542) ~[?:?] + at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:592) ~[?:?] + at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) ~[?:?] + at java.base/java.net.Socket.connect(Socket.java:751) ~[?:?] + at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304) ~[?:?] + at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:178) ~[?:?] + at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:531) ~[?:?] + at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:636) ~[?:?] + at java.base/sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:264) ~[?:?] + at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:377) ~[?:?] + at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193) ~[?:?] + at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1282) ~[?:?] + at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1123) ~[?:?] + at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179) ~[?:?] + at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1675) ~[?:?] + at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1599) ~[?:?] + at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:531) ~[?:?] + at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:307) ~[?:?] + at com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:84) ~[authlib-6.0.54.jar:?] + ... 9 more +[12:55:07] [ServerMain/INFO]: No existing world data, creating new world +[12:55:07] [ServerMain/INFO]: Loaded 1290 recipes +[12:55:08] [ServerMain/INFO]: Loaded 1399 advancements +[12:55:08] [Server thread/INFO]: Starting minecraft server version 1.21 +[12:55:08] [Server thread/INFO]: Loading properties +[12:55:08] [Server thread/INFO]: Default game type: SURVIVAL +[12:55:08] [Server thread/INFO]: Generating keypair +[12:55:08] [Server thread/INFO]: Starting Minecraft server on *:25565 +[12:55:08] [Server thread/INFO]: Using epoll channel type +[12:55:08] [Server thread/INFO]: Preparing level "world" +[12:55:10] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld +[12:55:10] [Worker-Main-18/INFO]: Preparing spawn area: 2% +[12:55:10] [Worker-Main-5/INFO]: Preparing spawn area: 2% +[12:55:11] [Worker-Main-19/INFO]: Preparing spawn area: 18% +[12:55:11] [Worker-Main-13/INFO]: Preparing spawn area: 51% +[12:55:12] [Server thread/INFO]: Time elapsed: 1651 ms +[12:55:12] [Server thread/INFO]: Done (3.475s)! For help, type "help" \ No newline at end of file diff --git a/test/tests/Logs/AutoLogsTest.php b/test/tests/Logs/AutoLogsTest.php index 8f051601..0e180dc7 100644 --- a/test/tests/Logs/AutoLogsTest.php +++ b/test/tests/Logs/AutoLogsTest.php @@ -1534,6 +1534,16 @@ public function test_vanilla_aquatic_world_on_older_version(): void $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); } + /** + * @return void + * @throws Exception + */ + public function test_vanilla_auth_key(): void + { + $log = new TestLog('Vanilla/vanilla-auth-key.log'); + $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); + } + /** * @return void * @throws Exception From a73dba21d13e23f8c14ccb093b9db051d5a1e7f4 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 8 Aug 2024 14:36:54 +0200 Subject: [PATCH 2/6] Fix: Unnecessary double brackets --- src/Analysis/Problem/Vanilla/AuthServerProblem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Analysis/Problem/Vanilla/AuthServerProblem.php b/src/Analysis/Problem/Vanilla/AuthServerProblem.php index 0ca6159d..d8247889 100644 --- a/src/Analysis/Problem/Vanilla/AuthServerProblem.php +++ b/src/Analysis/Problem/Vanilla/AuthServerProblem.php @@ -45,6 +45,6 @@ public static function getPatterns(): array public function setMatches(array $matches, mixed $patternKey): void { - $this->addSolution((new AuthServerSolution())); + $this->addSolution(new AuthServerSolution()); } } \ No newline at end of file From 8a1a0e29fa446f17432c0906ae2d328e4019e8c9 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 8 Aug 2024 14:37:49 +0200 Subject: [PATCH 3/6] Fix: Missing blank line --- src/Analysis/Solution/Vanilla/AuthServerSolution.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Analysis/Solution/Vanilla/AuthServerSolution.php b/src/Analysis/Solution/Vanilla/AuthServerSolution.php index 570a0695..4d2d3a1a 100644 --- a/src/Analysis/Solution/Vanilla/AuthServerSolution.php +++ b/src/Analysis/Solution/Vanilla/AuthServerSolution.php @@ -3,6 +3,7 @@ namespace Aternos\Codex\Minecraft\Analysis\Solution\Vanilla; use Aternos\Codex\Minecraft\Translator\Translator; + class AuthServerSolution extends VanillaSolution { /** From 8c8655b43980b5bbdbbacee99d927a671fe1bc08 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 8 Aug 2024 14:39:37 +0200 Subject: [PATCH 4/6] Fix: Unnecessary blank line --- src/Analysis/Problem/Vanilla/AuthServerProblem.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Analysis/Problem/Vanilla/AuthServerProblem.php b/src/Analysis/Problem/Vanilla/AuthServerProblem.php index d8247889..7297df6a 100644 --- a/src/Analysis/Problem/Vanilla/AuthServerProblem.php +++ b/src/Analysis/Problem/Vanilla/AuthServerProblem.php @@ -42,7 +42,6 @@ public static function getPatterns(): array * @param mixed $patternKey * @return void */ - public function setMatches(array $matches, mixed $patternKey): void { $this->addSolution(new AuthServerSolution()); From bb093438564b0bad96c75766fbd203362e4eac3c Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 8 Aug 2024 15:54:45 +0200 Subject: [PATCH 5/6] rename test files --- test/data/Vanilla/vanilla-auth-key.json | 533 ------------------ ...g => vanilla-auth-servers-unreachable.log} | 0 2 files changed, 533 deletions(-) delete mode 100644 test/data/Vanilla/vanilla-auth-key.json rename test/data/Vanilla/{vanilla-auth-key.log => vanilla-auth-servers-unreachable.log} (100%) diff --git a/test/data/Vanilla/vanilla-auth-key.json b/test/data/Vanilla/vanilla-auth-key.json deleted file mode 100644 index 6de73bb6..00000000 --- a/test/data/Vanilla/vanilla-auth-key.json +++ /dev/null @@ -1,533 +0,0 @@ -{ - "id": "vanilla\/server", - "name": "Vanilla", - "type": "Server Log", - "version": "1.21", - "title": "Vanilla 1.21 Server Log", - "entries": [ - { - "level": 6, - "time": null, - "prefix": "[12:55:07] [ServerMain\/INFO]:", - "lines": [ - { - "number": 1, - "content": "[12:55:07] [ServerMain\/INFO]: Environment: Environment[sessionHost=https:\/\/sessionserver.mojang.com, servicesHost=https:\/\/api.minecraftservices.com, name=PROD]" - } - ] - }, - { - "level": 3, - "time": null, - "prefix": "[12:55:07] [Yggdrasil Key Fetcher\/ERROR]:", - "lines": [ - { - "number": 2, - "content": "[12:55:07] [Yggdrasil Key Fetcher\/ERROR]: Failed to request yggdrasil public key" - }, - { - "number": 3, - "content": "com.mojang.authlib.exceptions.MinecraftClientException: Failed to read from https:\/\/api.minecraftservices.com\/publickeys due to Connection refused" - }, - { - "number": 4, - "content": "\tat com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:108) ~[authlib-6.0.54.jar:?]" - }, - { - "number": 5, - "content": "\tat com.mojang.authlib.minecraft.client.MinecraftClient.get(MinecraftClient.java:57) ~[authlib-6.0.54.jar:?]" - }, - { - "number": 6, - "content": "\tat com.mojang.authlib.yggdrasil.YggdrasilServicesKeyInfo.fetch(YggdrasilServicesKeyInfo.java:114) ~[authlib-6.0.54.jar:?]" - }, - { - "number": 7, - "content": "\tat com.mojang.authlib.yggdrasil.YggdrasilServicesKeyInfo$1.run(YggdrasilServicesKeyInfo.java:89) ~[authlib-6.0.54.jar:?]" - }, - { - "number": 8, - "content": "\tat java.base\/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]" - }, - { - "number": 9, - "content": "\tat java.base\/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]" - }, - { - "number": 10, - "content": "\tat java.base\/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]" - }, - { - "number": 11, - "content": "\tat java.base\/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]" - }, - { - "number": 12, - "content": "\tat java.base\/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]" - }, - { - "number": 13, - "content": "\tat java.base\/java.lang.Thread.run(Thread.java:1583) [?:?]" - }, - { - "number": 14, - "content": "Caused by: java.net.ConnectException: Connection refused" - }, - { - "number": 15, - "content": "\tat java.base\/sun.nio.ch.Net.pollConnect(Native Method) ~[?:?]" - }, - { - "number": 16, - "content": "\tat java.base\/sun.nio.ch.Net.pollConnectNow(Net.java:682) ~[?:?]" - }, - { - "number": 17, - "content": "\tat java.base\/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:542) ~[?:?]" - }, - { - "number": 18, - "content": "\tat java.base\/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:592) ~[?:?]" - }, - { - "number": 19, - "content": "\tat java.base\/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) ~[?:?]" - }, - { - "number": 20, - "content": "\tat java.base\/java.net.Socket.connect(Socket.java:751) ~[?:?]" - }, - { - "number": 21, - "content": "\tat java.base\/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304) ~[?:?]" - }, - { - "number": 22, - "content": "\tat java.base\/sun.net.NetworkClient.doConnect(NetworkClient.java:178) ~[?:?]" - }, - { - "number": 23, - "content": "\tat java.base\/sun.net.www.http.HttpClient.openServer(HttpClient.java:531) ~[?:?]" - }, - { - "number": 24, - "content": "\tat java.base\/sun.net.www.http.HttpClient.openServer(HttpClient.java:636) ~[?:?]" - }, - { - "number": 25, - "content": "\tat java.base\/sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:264) ~[?:?]" - }, - { - "number": 26, - "content": "\tat java.base\/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:377) ~[?:?]" - }, - { - "number": 27, - "content": "\tat java.base\/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193) ~[?:?]" - }, - { - "number": 28, - "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1282) ~[?:?]" - }, - { - "number": 29, - "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1123) ~[?:?]" - }, - { - "number": 30, - "content": "\tat java.base\/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179) ~[?:?]" - }, - { - "number": 31, - "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1675) ~[?:?]" - }, - { - "number": 32, - "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1599) ~[?:?]" - }, - { - "number": 33, - "content": "\tat java.base\/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:531) ~[?:?]" - }, - { - "number": 34, - "content": "\tat java.base\/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:307) ~[?:?]" - }, - { - "number": 35, - "content": "\tat com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:84) ~[authlib-6.0.54.jar:?]" - }, - { - "number": 36, - "content": "\t... 9 more" - } - ] - }, - { - "level": 6, - "time": null, - "prefix": "[12:55:07] [ServerMain\/INFO]:", - "lines": [ - { - "number": 37, - "content": "[12:55:07] [ServerMain\/INFO]: No existing world data, creating new world" - } - ] - }, - { - "level": 6, - "time": null, - "prefix": "[12:55:07] [ServerMain\/INFO]:", - "lines": [ - { - "number": 38, - "content": "[12:55:07] [ServerMain\/INFO]: Loaded 1290 recipes" - } - ] - }, - { - "level": 6, - "time": null, - "prefix": "[12:55:08] [ServerMain\/INFO]:", - "lines": [ - { - "number": 39, - "content": "[12:55:08] [ServerMain\/INFO]: Loaded 1399 advancements" - } - ] - }, - { - "level": 6, - "time": null, - "prefix": "[12:55:08] [Server thread\/INFO]:", - "lines": [ - { - "number": 40, - "content": "[12:55:08] [Server thread\/INFO]: Starting minecraft server version 1.21" - } - ] - }, - { - "level": 6, - "time": null, - "prefix": "[12:55:08] [Server thread\/INFO]:", - "lines": [ - { - "number": 41, - "content": "[12:55:08] [Server thread\/INFO]: Loading properties" - } - ] - }, - { - "level": 6, - "time": null, - "prefix": "[12:55:08] [Server thread\/INFO]:", - "lines": [ - { - "number": 42, - "content": "[12:55:08] [Server thread\/INFO]: Default game type: SURVIVAL" - } - ] - }, - { - "level": 6, - "time": null, - "prefix": "[12:55:08] [Server thread\/INFO]:", - "lines": [ - { - "number": 43, - "content": "[12:55:08] [Server thread\/INFO]: Generating keypair" - } - ] - }, - { - "level": 6, - "time": null, - "prefix": "[12:55:08] [Server thread\/INFO]:", - "lines": [ - { - "number": 44, - "content": "[12:55:08] [Server thread\/INFO]: Starting Minecraft server on *:25565" - } - ] - }, - { - "level": 6, - "time": null, - "prefix": "[12:55:08] [Server thread\/INFO]:", - "lines": [ - { - "number": 45, - "content": "[12:55:08] [Server thread\/INFO]: Using epoll channel type" - } - ] - }, - { - "level": 6, - "time": null, - "prefix": "[12:55:08] [Server thread\/INFO]:", - "lines": [ - { - "number": 46, - "content": "[12:55:08] [Server thread\/INFO]: Preparing level \"world\"" - } - ] - }, - { - "level": 6, - "time": null, - "prefix": "[12:55:10] [Server thread\/INFO]:", - "lines": [ - { - "number": 47, - "content": "[12:55:10] [Server thread\/INFO]: Preparing start region for dimension minecraft:overworld" - } - ] - }, - { - "level": 6, - "time": null, - "prefix": "[12:55:10] [Worker-Main-18\/INFO]:", - "lines": [ - { - "number": 48, - "content": "[12:55:10] [Worker-Main-18\/INFO]: Preparing spawn area: 2%" - } - ] - }, - { - "level": 6, - "time": null, - "prefix": "[12:55:10] [Worker-Main-5\/INFO]:", - "lines": [ - { - "number": 49, - "content": "[12:55:10] [Worker-Main-5\/INFO]: Preparing spawn area: 2%" - } - ] - }, - { - "level": 6, - "time": null, - "prefix": "[12:55:11] [Worker-Main-19\/INFO]:", - "lines": [ - { - "number": 50, - "content": "[12:55:11] [Worker-Main-19\/INFO]: Preparing spawn area: 18%" - } - ] - }, - { - "level": 6, - "time": null, - "prefix": "[12:55:11] [Worker-Main-13\/INFO]:", - "lines": [ - { - "number": 51, - "content": "[12:55:11] [Worker-Main-13\/INFO]: Preparing spawn area: 51%" - } - ] - }, - { - "level": 6, - "time": null, - "prefix": "[12:55:12] [Server thread\/INFO]:", - "lines": [ - { - "number": 52, - "content": "[12:55:12] [Server thread\/INFO]: Time elapsed: 1651 ms" - } - ] - }, - { - "level": 6, - "time": null, - "prefix": "[12:55:12] [Server thread\/INFO]:", - "lines": [ - { - "number": 53, - "content": "[12:55:12] [Server thread\/INFO]: Done (3.475s)! For help, type \"help\"" - } - ] - } - ], - "analysis": { - "problems": [ - { - "message": "The Mojang\/Microsoft authentication servers are currently unreachable!", - "counter": 1, - "entry": { - "level": 3, - "time": null, - "prefix": "[12:55:07] [Yggdrasil Key Fetcher\/ERROR]:", - "lines": [ - { - "number": 2, - "content": "[12:55:07] [Yggdrasil Key Fetcher\/ERROR]: Failed to request yggdrasil public key" - }, - { - "number": 3, - "content": "com.mojang.authlib.exceptions.MinecraftClientException: Failed to read from https:\/\/api.minecraftservices.com\/publickeys due to Connection refused" - }, - { - "number": 4, - "content": "\tat com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:108) ~[authlib-6.0.54.jar:?]" - }, - { - "number": 5, - "content": "\tat com.mojang.authlib.minecraft.client.MinecraftClient.get(MinecraftClient.java:57) ~[authlib-6.0.54.jar:?]" - }, - { - "number": 6, - "content": "\tat com.mojang.authlib.yggdrasil.YggdrasilServicesKeyInfo.fetch(YggdrasilServicesKeyInfo.java:114) ~[authlib-6.0.54.jar:?]" - }, - { - "number": 7, - "content": "\tat com.mojang.authlib.yggdrasil.YggdrasilServicesKeyInfo$1.run(YggdrasilServicesKeyInfo.java:89) ~[authlib-6.0.54.jar:?]" - }, - { - "number": 8, - "content": "\tat java.base\/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]" - }, - { - "number": 9, - "content": "\tat java.base\/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]" - }, - { - "number": 10, - "content": "\tat java.base\/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]" - }, - { - "number": 11, - "content": "\tat java.base\/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]" - }, - { - "number": 12, - "content": "\tat java.base\/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]" - }, - { - "number": 13, - "content": "\tat java.base\/java.lang.Thread.run(Thread.java:1583) [?:?]" - }, - { - "number": 14, - "content": "Caused by: java.net.ConnectException: Connection refused" - }, - { - "number": 15, - "content": "\tat java.base\/sun.nio.ch.Net.pollConnect(Native Method) ~[?:?]" - }, - { - "number": 16, - "content": "\tat java.base\/sun.nio.ch.Net.pollConnectNow(Net.java:682) ~[?:?]" - }, - { - "number": 17, - "content": "\tat java.base\/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:542) ~[?:?]" - }, - { - "number": 18, - "content": "\tat java.base\/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:592) ~[?:?]" - }, - { - "number": 19, - "content": "\tat java.base\/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) ~[?:?]" - }, - { - "number": 20, - "content": "\tat java.base\/java.net.Socket.connect(Socket.java:751) ~[?:?]" - }, - { - "number": 21, - "content": "\tat java.base\/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304) ~[?:?]" - }, - { - "number": 22, - "content": "\tat java.base\/sun.net.NetworkClient.doConnect(NetworkClient.java:178) ~[?:?]" - }, - { - "number": 23, - "content": "\tat java.base\/sun.net.www.http.HttpClient.openServer(HttpClient.java:531) ~[?:?]" - }, - { - "number": 24, - "content": "\tat java.base\/sun.net.www.http.HttpClient.openServer(HttpClient.java:636) ~[?:?]" - }, - { - "number": 25, - "content": "\tat java.base\/sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:264) ~[?:?]" - }, - { - "number": 26, - "content": "\tat java.base\/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:377) ~[?:?]" - }, - { - "number": 27, - "content": "\tat java.base\/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193) ~[?:?]" - }, - { - "number": 28, - "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1282) ~[?:?]" - }, - { - "number": 29, - "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1123) ~[?:?]" - }, - { - "number": 30, - "content": "\tat java.base\/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179) ~[?:?]" - }, - { - "number": 31, - "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1675) ~[?:?]" - }, - { - "number": 32, - "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1599) ~[?:?]" - }, - { - "number": 33, - "content": "\tat java.base\/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:531) ~[?:?]" - }, - { - "number": 34, - "content": "\tat java.base\/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:307) ~[?:?]" - }, - { - "number": 35, - "content": "\tat com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:84) ~[authlib-6.0.54.jar:?]" - }, - { - "number": 36, - "content": "\t... 9 more" - } - ] - }, - "solutions": [ - { - "message": "Wait a few minutes and try again. If the issue persists, check the official Mojang\/Microsoft channels for any known authentication server problems." - } - ] - } - ], - "information": [ - { - "message": "Minecraft version: 1.21", - "counter": 1, - "entry": { - "level": 6, - "time": null, - "prefix": "[12:55:08] [Server thread\/INFO]:", - "lines": [ - { - "number": 40, - "content": "[12:55:08] [Server thread\/INFO]: Starting minecraft server version 1.21" - } - ] - }, - "label": "Minecraft version", - "value": "1.21" - } - ] - } -} \ No newline at end of file diff --git a/test/data/Vanilla/vanilla-auth-key.log b/test/data/Vanilla/vanilla-auth-servers-unreachable.log similarity index 100% rename from test/data/Vanilla/vanilla-auth-key.log rename to test/data/Vanilla/vanilla-auth-servers-unreachable.log From d2651bb17585496867aa7e491e94cc00894c076a Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 8 Aug 2024 15:55:40 +0200 Subject: [PATCH 6/6] Add new test file --- .../vanilla-auth-servers-unreachable.json | 533 ++++++++++++++++++ test/tests/Logs/AutoLogsTest.php | 4 +- 2 files changed, 535 insertions(+), 2 deletions(-) create mode 100644 test/data/Vanilla/vanilla-auth-servers-unreachable.json diff --git a/test/data/Vanilla/vanilla-auth-servers-unreachable.json b/test/data/Vanilla/vanilla-auth-servers-unreachable.json new file mode 100644 index 00000000..6de73bb6 --- /dev/null +++ b/test/data/Vanilla/vanilla-auth-servers-unreachable.json @@ -0,0 +1,533 @@ +{ + "id": "vanilla\/server", + "name": "Vanilla", + "type": "Server Log", + "version": "1.21", + "title": "Vanilla 1.21 Server Log", + "entries": [ + { + "level": 6, + "time": null, + "prefix": "[12:55:07] [ServerMain\/INFO]:", + "lines": [ + { + "number": 1, + "content": "[12:55:07] [ServerMain\/INFO]: Environment: Environment[sessionHost=https:\/\/sessionserver.mojang.com, servicesHost=https:\/\/api.minecraftservices.com, name=PROD]" + } + ] + }, + { + "level": 3, + "time": null, + "prefix": "[12:55:07] [Yggdrasil Key Fetcher\/ERROR]:", + "lines": [ + { + "number": 2, + "content": "[12:55:07] [Yggdrasil Key Fetcher\/ERROR]: Failed to request yggdrasil public key" + }, + { + "number": 3, + "content": "com.mojang.authlib.exceptions.MinecraftClientException: Failed to read from https:\/\/api.minecraftservices.com\/publickeys due to Connection refused" + }, + { + "number": 4, + "content": "\tat com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:108) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 5, + "content": "\tat com.mojang.authlib.minecraft.client.MinecraftClient.get(MinecraftClient.java:57) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 6, + "content": "\tat com.mojang.authlib.yggdrasil.YggdrasilServicesKeyInfo.fetch(YggdrasilServicesKeyInfo.java:114) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 7, + "content": "\tat com.mojang.authlib.yggdrasil.YggdrasilServicesKeyInfo$1.run(YggdrasilServicesKeyInfo.java:89) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 8, + "content": "\tat java.base\/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]" + }, + { + "number": 9, + "content": "\tat java.base\/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]" + }, + { + "number": 10, + "content": "\tat java.base\/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]" + }, + { + "number": 11, + "content": "\tat java.base\/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]" + }, + { + "number": 12, + "content": "\tat java.base\/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]" + }, + { + "number": 13, + "content": "\tat java.base\/java.lang.Thread.run(Thread.java:1583) [?:?]" + }, + { + "number": 14, + "content": "Caused by: java.net.ConnectException: Connection refused" + }, + { + "number": 15, + "content": "\tat java.base\/sun.nio.ch.Net.pollConnect(Native Method) ~[?:?]" + }, + { + "number": 16, + "content": "\tat java.base\/sun.nio.ch.Net.pollConnectNow(Net.java:682) ~[?:?]" + }, + { + "number": 17, + "content": "\tat java.base\/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:542) ~[?:?]" + }, + { + "number": 18, + "content": "\tat java.base\/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:592) ~[?:?]" + }, + { + "number": 19, + "content": "\tat java.base\/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) ~[?:?]" + }, + { + "number": 20, + "content": "\tat java.base\/java.net.Socket.connect(Socket.java:751) ~[?:?]" + }, + { + "number": 21, + "content": "\tat java.base\/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304) ~[?:?]" + }, + { + "number": 22, + "content": "\tat java.base\/sun.net.NetworkClient.doConnect(NetworkClient.java:178) ~[?:?]" + }, + { + "number": 23, + "content": "\tat java.base\/sun.net.www.http.HttpClient.openServer(HttpClient.java:531) ~[?:?]" + }, + { + "number": 24, + "content": "\tat java.base\/sun.net.www.http.HttpClient.openServer(HttpClient.java:636) ~[?:?]" + }, + { + "number": 25, + "content": "\tat java.base\/sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:264) ~[?:?]" + }, + { + "number": 26, + "content": "\tat java.base\/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:377) ~[?:?]" + }, + { + "number": 27, + "content": "\tat java.base\/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193) ~[?:?]" + }, + { + "number": 28, + "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1282) ~[?:?]" + }, + { + "number": 29, + "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1123) ~[?:?]" + }, + { + "number": 30, + "content": "\tat java.base\/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179) ~[?:?]" + }, + { + "number": 31, + "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1675) ~[?:?]" + }, + { + "number": 32, + "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1599) ~[?:?]" + }, + { + "number": 33, + "content": "\tat java.base\/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:531) ~[?:?]" + }, + { + "number": 34, + "content": "\tat java.base\/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:307) ~[?:?]" + }, + { + "number": 35, + "content": "\tat com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:84) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 36, + "content": "\t... 9 more" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:07] [ServerMain\/INFO]:", + "lines": [ + { + "number": 37, + "content": "[12:55:07] [ServerMain\/INFO]: No existing world data, creating new world" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:07] [ServerMain\/INFO]:", + "lines": [ + { + "number": 38, + "content": "[12:55:07] [ServerMain\/INFO]: Loaded 1290 recipes" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:08] [ServerMain\/INFO]:", + "lines": [ + { + "number": 39, + "content": "[12:55:08] [ServerMain\/INFO]: Loaded 1399 advancements" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 40, + "content": "[12:55:08] [Server thread\/INFO]: Starting minecraft server version 1.21" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 41, + "content": "[12:55:08] [Server thread\/INFO]: Loading properties" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 42, + "content": "[12:55:08] [Server thread\/INFO]: Default game type: SURVIVAL" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 43, + "content": "[12:55:08] [Server thread\/INFO]: Generating keypair" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 44, + "content": "[12:55:08] [Server thread\/INFO]: Starting Minecraft server on *:25565" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 45, + "content": "[12:55:08] [Server thread\/INFO]: Using epoll channel type" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 46, + "content": "[12:55:08] [Server thread\/INFO]: Preparing level \"world\"" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:10] [Server thread\/INFO]:", + "lines": [ + { + "number": 47, + "content": "[12:55:10] [Server thread\/INFO]: Preparing start region for dimension minecraft:overworld" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:10] [Worker-Main-18\/INFO]:", + "lines": [ + { + "number": 48, + "content": "[12:55:10] [Worker-Main-18\/INFO]: Preparing spawn area: 2%" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:10] [Worker-Main-5\/INFO]:", + "lines": [ + { + "number": 49, + "content": "[12:55:10] [Worker-Main-5\/INFO]: Preparing spawn area: 2%" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:11] [Worker-Main-19\/INFO]:", + "lines": [ + { + "number": 50, + "content": "[12:55:11] [Worker-Main-19\/INFO]: Preparing spawn area: 18%" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:11] [Worker-Main-13\/INFO]:", + "lines": [ + { + "number": 51, + "content": "[12:55:11] [Worker-Main-13\/INFO]: Preparing spawn area: 51%" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:12] [Server thread\/INFO]:", + "lines": [ + { + "number": 52, + "content": "[12:55:12] [Server thread\/INFO]: Time elapsed: 1651 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:55:12] [Server thread\/INFO]:", + "lines": [ + { + "number": 53, + "content": "[12:55:12] [Server thread\/INFO]: Done (3.475s)! For help, type \"help\"" + } + ] + } + ], + "analysis": { + "problems": [ + { + "message": "The Mojang\/Microsoft authentication servers are currently unreachable!", + "counter": 1, + "entry": { + "level": 3, + "time": null, + "prefix": "[12:55:07] [Yggdrasil Key Fetcher\/ERROR]:", + "lines": [ + { + "number": 2, + "content": "[12:55:07] [Yggdrasil Key Fetcher\/ERROR]: Failed to request yggdrasil public key" + }, + { + "number": 3, + "content": "com.mojang.authlib.exceptions.MinecraftClientException: Failed to read from https:\/\/api.minecraftservices.com\/publickeys due to Connection refused" + }, + { + "number": 4, + "content": "\tat com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:108) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 5, + "content": "\tat com.mojang.authlib.minecraft.client.MinecraftClient.get(MinecraftClient.java:57) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 6, + "content": "\tat com.mojang.authlib.yggdrasil.YggdrasilServicesKeyInfo.fetch(YggdrasilServicesKeyInfo.java:114) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 7, + "content": "\tat com.mojang.authlib.yggdrasil.YggdrasilServicesKeyInfo$1.run(YggdrasilServicesKeyInfo.java:89) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 8, + "content": "\tat java.base\/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]" + }, + { + "number": 9, + "content": "\tat java.base\/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]" + }, + { + "number": 10, + "content": "\tat java.base\/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]" + }, + { + "number": 11, + "content": "\tat java.base\/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]" + }, + { + "number": 12, + "content": "\tat java.base\/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]" + }, + { + "number": 13, + "content": "\tat java.base\/java.lang.Thread.run(Thread.java:1583) [?:?]" + }, + { + "number": 14, + "content": "Caused by: java.net.ConnectException: Connection refused" + }, + { + "number": 15, + "content": "\tat java.base\/sun.nio.ch.Net.pollConnect(Native Method) ~[?:?]" + }, + { + "number": 16, + "content": "\tat java.base\/sun.nio.ch.Net.pollConnectNow(Net.java:682) ~[?:?]" + }, + { + "number": 17, + "content": "\tat java.base\/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:542) ~[?:?]" + }, + { + "number": 18, + "content": "\tat java.base\/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:592) ~[?:?]" + }, + { + "number": 19, + "content": "\tat java.base\/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) ~[?:?]" + }, + { + "number": 20, + "content": "\tat java.base\/java.net.Socket.connect(Socket.java:751) ~[?:?]" + }, + { + "number": 21, + "content": "\tat java.base\/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304) ~[?:?]" + }, + { + "number": 22, + "content": "\tat java.base\/sun.net.NetworkClient.doConnect(NetworkClient.java:178) ~[?:?]" + }, + { + "number": 23, + "content": "\tat java.base\/sun.net.www.http.HttpClient.openServer(HttpClient.java:531) ~[?:?]" + }, + { + "number": 24, + "content": "\tat java.base\/sun.net.www.http.HttpClient.openServer(HttpClient.java:636) ~[?:?]" + }, + { + "number": 25, + "content": "\tat java.base\/sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:264) ~[?:?]" + }, + { + "number": 26, + "content": "\tat java.base\/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:377) ~[?:?]" + }, + { + "number": 27, + "content": "\tat java.base\/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193) ~[?:?]" + }, + { + "number": 28, + "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1282) ~[?:?]" + }, + { + "number": 29, + "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1123) ~[?:?]" + }, + { + "number": 30, + "content": "\tat java.base\/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179) ~[?:?]" + }, + { + "number": 31, + "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1675) ~[?:?]" + }, + { + "number": 32, + "content": "\tat java.base\/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1599) ~[?:?]" + }, + { + "number": 33, + "content": "\tat java.base\/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:531) ~[?:?]" + }, + { + "number": 34, + "content": "\tat java.base\/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:307) ~[?:?]" + }, + { + "number": 35, + "content": "\tat com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:84) ~[authlib-6.0.54.jar:?]" + }, + { + "number": 36, + "content": "\t... 9 more" + } + ] + }, + "solutions": [ + { + "message": "Wait a few minutes and try again. If the issue persists, check the official Mojang\/Microsoft channels for any known authentication server problems." + } + ] + } + ], + "information": [ + { + "message": "Minecraft version: 1.21", + "counter": 1, + "entry": { + "level": 6, + "time": null, + "prefix": "[12:55:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 40, + "content": "[12:55:08] [Server thread\/INFO]: Starting minecraft server version 1.21" + } + ] + }, + "label": "Minecraft version", + "value": "1.21" + } + ] + } +} \ No newline at end of file diff --git a/test/tests/Logs/AutoLogsTest.php b/test/tests/Logs/AutoLogsTest.php index 0e180dc7..f1d416b2 100644 --- a/test/tests/Logs/AutoLogsTest.php +++ b/test/tests/Logs/AutoLogsTest.php @@ -1538,9 +1538,9 @@ public function test_vanilla_aquatic_world_on_older_version(): void * @return void * @throws Exception */ - public function test_vanilla_auth_key(): void + public function test_vanilla_auth_servers_unreachable(): void { - $log = new TestLog('Vanilla/vanilla-auth-key.log'); + $log = new TestLog('Vanilla/vanilla-auth-servers-unreachable.log'); $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); }