itzg / itzg/docker-minecraft-server

"wget: command not found" when executing CurseForge start script.

Open
#1,596 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Shell
Stars
14.3k
Forks
1.9k
Avg merge
2d 10h
Merged PRs (30d)
31

Description

### Describe the problem

Does the container have wget installed? The modpack I downloaded must use wget to fetch the forge server jar.
Here is the modpack's included ServerStart.sh:
```
#!/usr/bin/env bash
# Start script generated by ServerPackCreator.
# This script checks for the Minecraft and Forge JAR-files, and if they are not found, they are downloaded and installed.
# If everything is in order, the server is started.

JAVA="java"
MINECRAFT="1.18.2"
FORGE="40.1.0"
ARGS=""
OTHERARGS="-Dlog4j2.formatMsgNoLookups=true"

if [[ ! -s "libraries/net/minecraftforge/forge/$MINECRAFT-$FORGE/forge-$MINECRAFT-$FORGE-server.jar" ]];then

echo "Forge Server JAR-file not found. Downloading installer...";
wget -O forge-installer.jar https://files.minecraftforge.net/maven/net/minecraftforge/forge/$MINECRAFT-$FORGE/forge-$MINECRAFT-$FORGE-installer.jar;

if [[ -s "forge-installer.jar" ]]; then

echo "Installer downloaded. Installing...";
java -jar forge-installer.jar --installServer;

if [[ -s "libraries/net/minecraftforge/forge/$MINECRAFT-$FORGE/forge-$MINECRAFT-$FORGE-server.jar" ]];then
rm -f forge-installer.jar;
echo "Installation complete. forge-installer.jar deleted.";
fi

else
echo "forge-installer.jar not found. Maybe the Forges servers are having trouble.";
echo "Please try again in a couple of minutes.";
fi
else
echo "Forge server present. Moving on..."
fi

if [[ ! -s "libraries/net/minecraft/server/$MINECRAFT/server-$MINECRAFT.jar" ]];then
echo "Minecraft Server JAR-file not found. Downloading...";
wget -O libraries/net/minecraft/server/$MINECRAFT/server-$MINECRAFT.jar https://launcher.mojang.com/v1/objects/125e5adf40c659fd3bce3e66e67a16bb49ecc1b9/server.jar;
else
echo "Minecraft server present. Moving on..."
fi

if [[ -s "run.bat" ]];then
rm -f run.bat;
echo "Deleted run.bat as we already have START-SERVER.bat";
fi
if [[ -s "run.sh" ]];then
rm -f run.sh;
echo "Deleted run.sh as we already have START-SERVER.sh";
fi

if [[ ! -s "eula.txt" ]];then
echo "Mojang's EULA has not yet been accepted. In order to run a Minecraft server, you must accept Mojang's EULA."
echo "Type 'I agree' to indicate that you agree to Mojang's EULA."
echo "Mojang's EULA is available to read at https://account.mojang.com/documents/minecraft_eula"
echo "Do you agree to Mojang's EULA? [I agree/I disagree]"
read ANSWER
if [[ "$ANSWER" = "I agree" ]]; then
echo "User agreed to Mojang's EULA."
echo "#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula)." > eula.txt;
echo "eula=true" >> eula.txt;
else
echo "User did not agree to Mojang's EULA."
fi
else
echo "eula.txt present. Moving on...";
fi

echo "Starting server...";
echo "Minecraft version: $MINECRAFT";
echo "Forge version: $FORGE";
echo "Java args in user_jvm_args.txt: $ARGS";

# Forge requires a configured set of both JVM and program arguments.
# Add custom JVM arguments to the user_jvm_args.txt
# Add custom program arguments {such as nogui} to this file in the next line before the "$@" or
# pass them to this script directly

$JAVA $OTHERARGS @user_jvm_args.txt @libraries/net/minecraftforge/forge/$MINECRAFT-$FORGE/unix_args.txt nogui "$@"

echo "Press any button to exit..."
read
```

### Container definition

```
mc:
image: itzg/minecraft-server
ports:
- 25565:25565
environment:
EULA: "TRUE"
MEMORY: 6G
VERSION: 1.18.2
TYPE: CURSEFORGE
CF_SERVER_MOD: create_flavored.zip
#USE_MODPACK_START_SCRIPT: "FALSE"
tty: true
stdin_open: true
restart: unless-stopped
volumes:
- /home/mc_server:/data

```

### Container logs

```
2022-07-13T05:39:28.892Z INFO mc-server-runner Sending 'stop' to Minecraft server...
2022-07-13T05:39:28.892Z INFO mc-server-runner Waiting for completion...
2022-07-13T05:39:28.893Z INFO mc-server-runner Done
[init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 7 1000 1000 4096 Jul 13 05:32 /data'
[init] Resolved version given 1.18.2 into 1.18.2 and major version 1.18
[init] Resolving type given CURSEFORGE
[init] Looking for Feed-The-Beast / CurseForge server modpack.
[init] detected FTB, changing properties path to /data/FeedTheBeast/server.properties
[init] server.properties already created, skipping
[init] Checking for JSON files.
[init] Setting initial memory to 6G and max to 6G
[init] Running FTB /data/FeedTheBeast/ServerStart.sh in /data/FeedTheBeast ...
Forge Server JAR-file not found. Downloading installer...
/data/FeedTheBeast/ServerStart.sh: line 15: wget: command not found
forge-installer.jar not found. Maybe the Forges servers are having trouble.
Please try again in a couple of minutes.
Minecraft Server JAR-file not found. Downloading...
/data/FeedTheBeast/ServerStart.sh: line 37: wget: command not found
eula.txt present. Moving on...
Starting server...
Minecraft version: 1.18.2
Forge version: 40.1.0
Java args in user_jvm_args.txt:
Error: could not open `libraries/net/minecraftforge/forge/1.18.2-40.1.0/unix_args.txt'
Press any button to exit...
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the container setup and the CurseForge path that runs /data/FeedTheBeast/ServerStart.sh; inspect how runtime dependencies are installed. Reproduce the shown CURSEFORGE configuration and compare the container's available download tools with the script's wget calls. Done means modpack startup can download the Forge and Minecraft jars without the command-not-found failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, shell
Domain
devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.