Skip to content

Cannot launch server using packwiz due to rate-limiting by Github API #1678

@TheGlitch76

Description

@TheGlitch76

Describe the problem

When using a Packwiz modpack, the server script makes an API request to Github each time it's launched:

curl -fsSL https://api.github.com/repos/packwiz/packwiz-installer-bootstrap/releases/latest

However, Github has a very low rate limit for unauthenticated users, so if the server gets stuck in e.g. a crash loop with restart: unless_stopped or similar, the Github API will start returning 403s (from what I can tell, for about an hour) for rate-limiting.
This causes the curl request to fail and the container stops trying to boot:

curl: (22) The requested URL returned error: 403

Ideally, the container would either:

  • Remove use of the GH API so that the rate-limiting never gets hit
  • Gracefully handle 403s from the GH API when a cached version of packwiz-installer-bootstrap is available

Container definition

version: "3"

services:
  mc:
    image: itzg/minecraft-server
    ports:
      - 25565:25565
    environment:
      EULA: "TRUE"
      TYPE: QUILT
      VERSION: 1.18.2
      PACKWIZ_URL: REMOVED PACK URL
      MEMORY: 7G
      USE_AIKAR_FLAGS: true
      DEBUG: true
    tty: true
    stdin_open: true
    restart: unless-stopped
    volumes:
    - ./minecraft-data:/data:Z

Container logs

+ export HOME=/data
+ HOME=/data
++ id -u
++ id -g
++ ls -lnd /data
+ log 'Running as uid=1000 gid=1000 with /data as '\''drwxrwxr-x. 11 1000 1000 4096 Aug 15 16:24 /data'\'''
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
[init] 2022-08-15 16:28:57+00:00 Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x. 11 1000 1000 4096 Aug 15 16:24 /data'
+ '[' '!' -e /data/eula.txt ']'
+ isTrue false
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
+ return 1
+ isTrue false
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
+ return 1
+ [[ -n '' ]]
+ [[ -n '' ]]
+ fixJavaPath
+ which java
+ export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
+ VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
+ case "X$VERSION" in
+ VANILLA_VERSION=1.18.2
+ export VANILLA_VERSION
++ get_major_version 1.18.2
++ version=1.18.2
++ echo 1.18.2
++ cut -d. -f 1-2
+ MAJOR_VANILLA_VERSION=1.18
+ export MAJOR_VANILLA_VERSION
+ log 'Resolved version given 1.18.2 into 1.18.2 and major version 1.18'
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
[init] 2022-08-15 16:28:57+00:00 Resolved version given 1.18.2 into 1.18.2 and major version 1.18
+ cd /data
+ export ORIGINAL_TYPE=QUILT
+ ORIGINAL_TYPE=QUILT
+ isTrue false
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
+ return 1
+ isTrue false
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
+ return 1
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ versionLessThan 1.7
+ mc-image-helper compare-versions 1.18.2 lt 1.7
+ log 'Resolving type given QUILT'
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
[init] 2022-08-15 16:28:58+00:00 Resolving type given QUILT
+ case "${TYPE^^}" in
+ exec /start-deployQuilt
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ LATEST = LATEST ]]
+ log 'Checking Quilt Installer version information.'
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
[init] 2022-08-15 16:28:58+00:00 Checking Quilt Installer version information.
++ maven-metadata-release https://maven.quiltmc.org/repository/release/org/quiltmc/quilt-installer/maven-metadata.xml
+ QUILT_INSTALLER_VERSION=0.4.3
+ [[ LATEST = LATEST ]]
+ log 'Checking Quilt Loader version information.'
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
[init] 2022-08-15 16:28:58+00:00 Checking Quilt Loader version information.
++ maven-metadata-release https://maven.quiltmc.org/repository/release/org/quiltmc/quilt-loader/maven-metadata.xml
+ QUILT_LOADER_VERSION=0.17.3
+ export INSTALLER=quilt-installer-0.4.3.jar
+ INSTALLER=quilt-installer-0.4.3.jar
+ export SERVER=quilt-server-1.18.2-0.17.3-launch.jar
+ SERVER=quilt-server-1.18.2-0.17.3-launch.jar
+ export QUILT_INSTALLER_URL=https://maven.quiltmc.org/repository/release/org/quiltmc/quilt-installer/0.4.3/quilt-installer-0.4.3.jar
+ QUILT_INSTALLER_URL=https://maven.quiltmc.org/repository/release/org/quiltmc/quilt-installer/0.4.3/quilt-installer-0.4.3.jar
+ [[ ! -e quilt-server-1.18.2-0.17.3-launch.jar ]]
+ [[ ! -e quilt-server-1.18.2-0.17.3-launch.jar ]]
+ export FAMILY=FABRIC
+ FAMILY=FABRIC
+ exec /start-setupWorld
+ '[' QUILT = CURSEFORGE ']'
+ worldDest=/data/world
+ [[ -n '' ]]
+ exec /start-setupVanillaTweaks
+ out_dir=/data/world/datapacks
+ isTrue false
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
+ return 1
+ [[ -n '' ]]
+ [[ -n '' ]]
+ exec /start-setupForgeApiMods
+ isTrue false
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
+ return 1
+ '[' '' ']'
+ '[' '' ']'
+ exec /start-setupModpack
+ CURSE_URL_BASE=https://minecraft.curseforge.com/projects
+ isTrue false
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
+ return 1
+ [[ -n REMOVED PACK URL ]]
++ curl -fsSL https://api.github.com/repos/packwiz/packwiz-installer-bootstrap/releases/latest
curl: (22) The requested URL returned error: 403 
+ latestPackwiz=
exit code: 22

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions