Skip to content

[1.20.1] ForgeGradle fails #1082

Description

@sudden-snowball

I can't be 100% sure of the problem description and name, as I don't understand it myself and use AI. Here's its conclusion regarding the problem I've been trying to solve for a WEEK.

[1.20.1] ForgeGradle fails with "zip END header not found" in GitHub Codespaces due to corrupted HTML downloads (Cloudflare bot protection)

  • Minecraft Version: 1.20.1
  • Forge Version: 1.20.1-47.4.10 also 1.20.1-47.3.0
  • ForgeGradle Version: 6.0.24 or new
  • Gradle Version: 8.8
  • Java Version: 17.0.20 (Eclipse Temurin)
  • OS: Linux (GitHub Codespaces) or my Windwos 10 Pro

Problem Description
When running ./gradlew build or ./gradlew genIntellijRuns in a fresh GitHub Codespaces environment, the build fails during the configuration phase with the following error:

Error getting artifact: net.minecraftforge:forge:1.20.1-47.4.10:userdev
java.util.zip.ZipException: zip END header not found
    at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1637)
    ...
    at net.minecraftforge.gradle.userdev.MinecraftUserRepo$Patcher.<init>(MinecraftUserRepo.java:1394)

In the installed forge-1.20.1-47.4.10-userdev.jar file (similarly for 47.3.0):

<!DOCTYPE html>
<html>
        <head>
                <title>Redirecting...</title>
                <script>window.location.replace("https://maven.knifepoint.net/net/minecraftforge/forge/1.20.1-47.4.10/forge-1.20.1-47.4.10-userdev.jar");</script>
                <meta http-equiv="refresh" content="0; URL='https://maven.knifepoint.net/net/minecraftforge/forge/1.20.1-47.4.10/forge-1.20.1-47.4.10-userdev.jar'">
        </head>
        <body>Redirecting to <a href="https://maven.knifepoint.net/net/minecraftforge/forge/1.20.1-47.4.10/forge-1.20.1-47.4.10-userdev.jar">https://maven.knifepoint.net/net/minecraftforge/forge/1.20.1-47.4.10/forge-1.20.1-47.4.10-userdev.jar</a>...</body>
</html>

This content will be displayed after executing the command Get-Content "$env:USERPROFILE\.gradle\caches\forge_gradle\maven_downloader\net\minecraftforge\forge\1.20.1-47.4.10\forge-1.20.1-47.4.10-userdev.jar" in the terminal

Root Cause Analysis
Through AI debugging, he discovered that Gradle's HTTP client is downloading HTML error pages (likely Cloudflare 403 Forbidden or 502 Bad Gateway responses, as Codespaces IPs are often flagged as bots) instead of the actual .jar files.
Gradle saves these HTML responses with a .jar extension. Later, when ForgeGradle attempts to read this file as a ZIP archive, it throws the cryptic zip END header not found exception, making it very difficult to diagnose the actual network/download issue.

Steps to Reproduce

  1. Open one of repositories - https://github.com/sudden-snowball/Forge-Rosium-1.20.1 OR https://github.com/[JeweyxD/Forge-Rosia-1.20.1](https://github.com/JeweyxD/Forge-Rosia-1.20.1) with GitHub Codespace OR import to VSCode/Intellij.
  2. For Codespaces: install Java 17 is installed (sdk install java 17.0.20-).
  3. For Codespaces: run chmod +x gradlew.
  4. After waiting for loading: run ./gradlew build or ./gradlew genIntellijRuns.
  5. Forge userdev download error

Why am I using Codespaces? I'm getting the same error on my local PC, even though my friend's computer is fine. Maybe it's because I live in Russia? VPN, zapret, WARP doesn't help me...
Please, help me...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions