Skip to content

Conversation

Copy link

Copilot AI commented Nov 9, 2025

HeadlessMC intermittently times out when fetching version.json from Mojang servers, causing CI failures that require manual reruns.

Changes

Added Java HTTP timeout system properties to all HeadlessMC launcher invocations:

- java -jar headlessmc-launcher-${{ inputs.hmc-version }}.jar --command download ${{ inputs.mc }} + java -Dsun.net.client.defaultConnectTimeout=30000 -Dsun.net.client.defaultReadTimeout=30000 -jar headlessmc-launcher-${{ inputs.hmc-version }}.jar --command download ${{ inputs.mc }}

Modified 4 commands in action.yml:

  • Version download
  • Modloader installation
  • Game launch (xvfb and non-xvfb)

Both timeouts set to 30 seconds (30000ms) to handle transient network issues while preventing indefinite hangs.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/3arthqu4ke/headlessmc/releases/latest
    • Triggering command: curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Frequent test failures due to timeout while fetching version</issue_title>
<issue_description>I've introduced the mc-runtime-test and mc-server-test actions into several Hex Casting-related projects, and all of them have recently started running into frequent but intermittent failures caused by an HTTP timeout while fetching version.json. Manually rerunning the job often resolves the timeout.

Example of a workflow run that failed due to this issue: https://github.com/FallingColors/HexMod/actions/runs/18510809336/job/52751586190

Traceback:

[21:45:54] [main/INFO] [ServerLauncher]: Launching server to create EULA... [21:45:59] [main/SEVERE] [AbstractLaunchProcessLifecycle]: Failed to start Minecraft on try 0 me.earth.headlessmc.api.command.CommandException: Failed to read Version 1.20.1	at me.earth.headlessmc.launcher.server.ServerLauncher.getVersion(ServerLauncher.java:258)	at me.earth.headlessmc.launcher.server.ServerLauncher.launch0(ServerLauncher.java:116)	at me.earth.headlessmc.launcher.server.ServerLauncher.eulaLaunch(ServerLauncher.java:72)	at me.earth.headlessmc.launcher.server.ServerLauncher.launch(ServerLauncher.java:90)	at me.earth.headlessmc.launcher.server.commands.LaunchServerCommand$ServerLaunchProcessLifecycle.createProcess(LaunchServerCommand.java:52)	at me.earth.headlessmc.launcher.command.AbstractLaunchProcessLifecycle.runProcess(AbstractLaunchProcessLifecycle.java:133)	at me.earth.headlessmc.launcher.command.AbstractLaunchProcessLifecycle.run(AbstractLaunchProcessLifecycle.java:60)	at me.earth.headlessmc.launcher.server.commands.LaunchServerCommand.execute(LaunchServerCommand.java:25)	at me.earth.headlessmc.launcher.server.commands.LaunchServerCommand.execute(LaunchServerCommand.java:16)	at me.earth.headlessmc.launcher.command.FindByCommand.execute(FindByCommand.java:42)	at me.earth.headlessmc.api.command.CommandContextImpl.executeCommand(CommandContextImpl.java:54)	at me.earth.headlessmc.api.command.CommandContextImpl.execute(CommandContextImpl.java:33)	at me.earth.headlessmc.launcher.server.commands.ServerCommandContext.execute(ServerCommandContext.java:37)	at me.earth.headlessmc.launcher.server.ServerCommand.execute(ServerCommand.java:45)	at me.earth.headlessmc.api.command.CommandContextImpl.executeCommand(CommandContextImpl.java:54)	at me.earth.headlessmc.api.command.CommandContextImpl.execute(CommandContextImpl.java:33)	at me.earth.headlessmc.api.command.line.CommandLine.lambda$new$0(CommandLine.java:45)	at me.earth.headlessmc.launcher.QuickExitCliHandler.checkQuickExit(QuickExitCliHandler.java:47)	at me.earth.headlessmc.launcher.Main.runHeadlessMc(Main.java:57)	at me.earth.headlessmc.launcher.Main.main(Main.java:20) Caused by: java.net.http.HttpConnectTimeoutException: HTTP connect timed out	at java.net.http/jdk.internal.net.http.HttpClientImpl.send(HttpClientImpl.java:568)	at java.net.http/jdk.internal.net.http.HttpClientFacade.send(HttpClientFacade.java:123)	at net.lenni0451.commons.httpclient.executor.HttpClientExecutor.execute(HttpClientExecutor.java:48)	at net.lenni0451.commons.httpclient.HttpClient.execute(HttpClient.java:232)	at net.lenni0451.commons.httpclient.requests.HttpRequest.execute(HttpRequest.java:213)	at me.earth.headlessmc.launcher.download.DownloadService.get(DownloadService.java:70)	at me.earth.headlessmc.launcher.download.DownloadService.download(DownloadService.java:55)	at me.earth.headlessmc.launcher.command.download.VersionInfoUtil.toVersion(VersionInfoUtil.java:27)	at me.earth.headlessmc.launcher.server.ServerLauncher.getVersion(ServerLauncher.java:256)	... 19 more Caused by: java.net.http.HttpConnectTimeoutException: HTTP connect timed out	at java.net.http/jdk.internal.net.http.MultiExchange.toTimeoutException(MultiExchange.java:580)	at java.net.http/jdk.internal.net.http.MultiExchange.getExceptionalCF(MultiExchange.java:527)	at java.net.http/jdk.internal.net.http.MultiExchange.lambda$responseAsyncImpl$7(MultiExchange.java:447)	at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934)	at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911)	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)	at java.net.http/jdk.internal.net.http.common.SSLFlowDelegate.stopOnError(SSLFlowDelegate.java:997)	at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:990)	at java.base/java.util.concurrent.CompletableFuture$UniExceptionally.tryFire(CompletableFuture.java:974)	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)	at java.net.http/jdk.internal.n... </details> - Fixes headlesshq/mc-runtime-test#82 <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/headlesshq/mc-runtime-test/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. 
Co-authored-by: ChipWolf <3164166+ChipWolf@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix frequent test failures due to timeout while fetching version Add HTTP timeout configuration to prevent version.json fetch failures Nov 9, 2025
Copilot AI requested a review from ChipWolf November 9, 2025 21:47
@ChipWolf ChipWolf changed the title Add HTTP timeout configuration to prevent version.json fetch failures fix: add HTTP timeout configuration to prevent version.json fetch failures Nov 12, 2025
@ChipWolf ChipWolf changed the title fix: add HTTP timeout configuration to prevent version.json fetch failures fix: add HTTP timeout configuration to mitigate version.json fetch failures Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants