itzg / docker-minecraft-server

Docker image that provides a Minecraft Server that will automatically download selected version at startup
https://docker-minecraft-server.readthedocs.io/
Apache License 2.0
9.35k stars 1.54k forks source link

Script stuck on Forge installation [Magma] #1589

Closed urFate closed 2 years ago

urFate commented 2 years ago

Describe the problem

I tried to run Magma server but docker log stuck on Forge installation. Between at the same time, the server itself is launched in the background. (I saw that by forge installer log file and HTOP)

(Forge installer log)

Container definition

version: "3.8"

services:
  mc:
    image: itzg/minecraft-server:java8
    ports:
      - 25565:25565
    environment:
      EULA: "TRUE"
      VERSION: "1.12.2"
      TYPE: "MAGMA"
      MEMORY: "7G"
      EXEC_DIRECTLY: "TRUE"
      USE_FLARE_FLAGS: "TRUE"
      USE_SIMD_FLAGS: "TRUE"
    tty: true
    stdin_open: true
    restart: always
    volumes:
      - ./minecraft-data:/data

Container logs

mc_1  | [init] 2022-07-07 13:34:14+00:00 Changing ownership of /data to 1000 ...
mc_1  | + export HOME=/data
mc_1  | + HOME=/data
mc_1  | ++ id -u
mc_1  | ++ id -g
mc_1  | ++ ls -lnd /data
mc_1  | + log 'Running as uid=1000 gid=1000 with /data as '\''drwxrwxr-x 2 1000 1000 4096 Jul  7 13:34 /data'\'''
mc_1  | + local oldState
mc_1  | ++ shopt -po xtrace
mc_1  | + oldState='set -o xtrace'
mc_1  | + shopt -u -o xtrace
mc_1  | [init] 2022-07-07 13:34:14+00:00 Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 2 1000 1000 4096 Jul  7 13:34 /data'
mc_1  | + '[' '!' -e /data/eula.txt ']'
mc_1  | + isTrue TRUE
mc_1  | + local oldState
mc_1  | ++ shopt -po xtrace
mc_1  | + oldState='set -o xtrace'
mc_1  | + shopt -u -o xtrace
mc_1  | + return 0
mc_1  | + writeEula
mc_1  | ++ date
mc_1  | + echo '# Generated via Docker
mc_1  | # Thu Jul  7 13:34:14 UTC 2022
mc_1  | eula=true
mc_1  | '
mc_1  | + isTrue false
mc_1  | + local oldState
mc_1  | ++ shopt -po xtrace
mc_1  | + oldState='set -o xtrace'
mc_1  | + shopt -u -o xtrace
mc_1  | + return 1
mc_1  | + isTrue false
mc_1  | + local oldState
mc_1  | ++ shopt -po xtrace
mc_1  | + oldState='set -o xtrace'
mc_1  | + shopt -u -o xtrace
mc_1  | + return 1
mc_1  | + [[ -n '' ]]
mc_1  | + [[ -n '' ]]
mc_1  | + fixJavaPath
mc_1  | + which java
mc_1  | + export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
mc_1  | + VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
mc_1  | + case "X$VERSION" in
mc_1  | + VANILLA_VERSION=1.12.2
mc_1  | + export VANILLA_VERSION
mc_1  | ++ get_major_version 1.12.2
mc_1  | ++ version=1.12.2
mc_1  | ++ echo 1.12.2
mc_1  | ++ cut -d. -f 1-2
mc_1  | + MAJOR_VANILLA_VERSION=1.12
mc_1  | + export MAJOR_VANILLA_VERSION
mc_1  | + log 'Resolved version given 1.12.2 into 1.12.2 and major version 1.12'
mc_1  | + local oldState
mc_1  | ++ shopt -po xtrace
mc_1  | + oldState='set -o xtrace'
mc_1  | + shopt -u -o xtrace
mc_1  | [init] 2022-07-07 13:34:14+00:00 Resolved version given 1.12.2 into 1.12.2 and major version 1.12
mc_1  | + cd /data
mc_1  | + export ORIGINAL_TYPE=MAGMA
mc_1  | + ORIGINAL_TYPE=MAGMA
mc_1  | + isTrue false
mc_1  | + local oldState
mc_1  | ++ shopt -po xtrace
mc_1  | + oldState='set -o xtrace'
mc_1  | + shopt -u -o xtrace
mc_1  | + return 1
mc_1  | + isTrue false
mc_1  | + local oldState
mc_1  | ++ shopt -po xtrace
mc_1  | + oldState='set -o xtrace'
mc_1  | + shopt -u -o xtrace
mc_1  | + return 1
mc_1  | + [[ -n '' ]]
mc_1  | + [[ -n '' ]]
mc_1  | + [[ -n '' ]]
mc_1  | + [[ -n '' ]]
mc_1  | + [[ -n '' ]]
mc_1  | + versionLessThan 1.7
mc_1  | + mc-image-helper compare-versions 1.12.2 lt 1.7
mc_1  | + log 'Resolving type given MAGMA'
mc_1  | + local oldState
mc_1  | ++ shopt -po xtrace
mc_1  | + oldState='set -o xtrace'
mc_1  | + shopt -u -o xtrace
mc_1  | [init] 2022-07-07 13:34:15+00:00 Resolving type given MAGMA
mc_1  | + case "${TYPE^^}" in
mc_1  | + evaluateJavaCompatibilityForForge
mc_1  | ++ mc-image-helper java-release
mc_1  | + javaRelease=8
mc_1  | + versionLessThan 1.18
mc_1  | + mc-image-helper compare-versions 1.12.2 lt 1.18
mc_1  | + ((  javaRelease > 8  ))
mc_1  | + exec /start-deployMagma
mc_1  | + : 1.12.2
mc_1  | ++ curl -fsSL https://api.magmafoundation.org/api/v2/1.12.2/latest
mc_1  | + latestMeta='{"name":"efb9116e","tag_name":"efb9116e","created_at":"2022-07-01T19:37:54.053Z","link":"https://git.magmafoundation.org/api/v4/projects/7/packages/maven/org/magmafoundation/Magma/1.12.2-efb9116e/Magma-1.12.2-efb9116e.jar","installer_link":"https://git.magmafoundation.org/api/v4/projects/7/packages/maven/org/magmafoundation/Magma/1.12.2-efb9116e/Magma-1.12.2-efb9116e.jar","git_commit_url":"https://git.magmafoundation.org/magmafoundation/Magma/commit/efb9116e"}'
mc_1  | + '[' 0 '!=' 0 ']'
mc_1  | ++ jq -r .tag_name
mc_1  | ++ echo '{"name":"efb9116e","tag_name":"efb9116e","created_at":"2022-07-01T19:37:54.053Z","link":"https://git.magmafoundation.org/api/v4/projects/7/packages/maven/org/magmafoundation/Magma/1.12.2-efb9116e/Magma-1.12.2-efb9116e.jar","installer_link":"https://git.magmafoundation.org/api/v4/projects/7/packages/maven/org/magmafoundation/Magma/1.12.2-efb9116e/Magma-1.12.2-efb9116e.jar","git_commit_url":"https://git.magmafoundation.org/magmafoundation/Magma/commit/efb9116e"}'
mc_1  | + tagName=efb9116e
mc_1  | + markerFile=.magma-installed-1.12.2-efb9116e
mc_1  | + '[' -f .magma-installed-1.12.2-efb9116e ']'
mc_1  | + '[' '!' -f .magma-installed-1.12.2-efb9116e ']'
mc_1  | ++ echo '{"name":"efb9116e","tag_name":"efb9116e","created_at":"2022-07-01T19:37:54.053Z","link":"https://git.magmafoundation.org/api/v4/projects/7/packages/maven/org/magmafoundation/Magma/1.12.2-efb9116e/Magma-1.12.2-efb9116e.jar","installer_link":"https://git.magmafoundation.org/api/v4/projects/7/packages/maven/org/magmafoundation/Magma/1.12.2-efb9116e/Magma-1.12.2-efb9116e.jar","git_commit_url":"https://git.magmafoundation.org/magmafoundation/Magma/commit/efb9116e"}'
mc_1  | ++ jq -r .installer_link
mc_1  | + assetUrl=https://git.magmafoundation.org/api/v4/projects/7/packages/maven/org/magmafoundation/Magma/1.12.2-efb9116e/Magma-1.12.2-efb9116e.jar
mc_1  | + '[' 0 '!=' 0 ']'
mc_1  | + '[' -z https://git.magmafoundation.org/api/v4/projects/7/packages/maven/org/magmafoundation/Magma/1.12.2-efb9116e/Magma-1.12.2-efb9116e.jar ']'
mc_1  | + magmaHandleInstaller https://git.magmafoundation.org/api/v4/projects/7/packages/maven/org/magmafoundation/Magma/1.12.2-efb9116e/Magma-1.12.2-efb9116e.jar efb9116e .magma-installed-1.12.2-efb9116e
mc_1  | + url=https://git.magmafoundation.org/api/v4/projects/7/packages/maven/org/magmafoundation/Magma/1.12.2-efb9116e/Magma-1.12.2-efb9116e.jar
mc_1  | + tagName=efb9116e
mc_1  | + markerFile=.magma-installed-1.12.2-efb9116e
mc_1  | + installerFile=magma-installer-1.12.2-efb9116e.jar
mc_1  | + log 'Downloading Magma installer file for 1.12.2 @ efb9116e'
mc_1  | + local oldState
mc_1  | ++ shopt -po xtrace
mc_1  | + oldState='set -o xtrace'
mc_1  | + shopt -u -o xtrace
mc_1  | [init] 2022-07-07 13:34:16+00:00 Downloading Magma installer file for 1.12.2 @ efb9116e
mc_1  | + curl -o magma-installer-1.12.2-efb9116e.jar -fsSL https://git.magmafoundation.org/api/v4/projects/7/packages/maven/org/magmafoundation/Magma/1.12.2-efb9116e/Magma-1.12.2-efb9116e.jar
mc_1  | + echo forge
mc_1  | + export FORGE_INSTALLER=magma-installer-1.12.2-efb9116e.jar
mc_1  | + FORGE_INSTALLER=magma-installer-1.12.2-efb9116e.jar
mc_1  | + export FORGE_INSTALLER_CUSTOM_VERSION=efb9116e
mc_1  | + FORGE_INSTALLER_CUSTOM_VERSION=efb9116e
mc_1  | + exec /start-deployForge https://git.magmafoundation.org/api/v4/projects/7/packages/maven/org/magmafoundation/Magma/1.12.2-efb9116e/Magma-1.12.2-efb9116e.jar efb9116e .magma-installed-1.12.2-efb9116e
mc_1  | + resolve_versions
mc_1  | + [[ -z magma-installer-1.12.2-efb9116e.jar ]]
mc_1  | + [[ -z magma-installer-1.12.2-efb9116e.jar ]]
mc_1  | + [[ ! -e magma-installer-1.12.2-efb9116e.jar ]]
mc_1  | + shortForgeVersion=1.12.2-efb9116e
mc_1  | + installMarker=/data/.forge-installed-1.12.2-efb9116e
mc_1  | + '[' '!' -e /data/.forge-installed-1.12.2-efb9116e ']'
mc_1  | + install
mc_1  | + '[' '!' -e magma-installer-1.12.2-efb9116e.jar ']'
mc_1  | + rm -f run.sh
mc_1  | + log 'Installing Forge 1.12.2-efb9116e. This might take a minute or two...'
mc_1  | + local oldState
mc_1  | ++ shopt -po xtrace
mc_1  | + oldState='set -o xtrace'
mc_1  | + shopt -u -o xtrace
mc_1  | [init] 2022-07-07 13:34:17+00:00 Installing Forge 1.12.2-efb9116e. This might take a minute or two...
mc_1  | + mkdir -p mods
mc_1  | + tries=3
mc_1  | + true
mc_1  | + java -jar magma-installer-1.12.2-efb9116e.jar --installServer
itzg commented 2 years ago

Hmm, it seems to be a big in the Magma since it is advertising the same (server) jar as the installer_link:


{"name":"efb9116e","tag_name":"efb9116e","created_at":"2022-07-01T19:37:54.053Z","link":"https://git.magmafoundation.org/api/v4/projects/7/packages/maven/org/magmafoundation/Magma/1.12.2-efb9116e/Magma-1.12.2-efb9116e.jar","installer_link":"https://git.magmafoundation.org/api/v4/projects/7/packages/maven/org/magmafoundation/Magma/1.12.2-efb9116e/Magma-1.12.2-efb9116e.jar","git_commit_url":"https://git.magmafoundation.org/magmafoundation/Magma/commit/efb9116e"}

It would be great if you could help look for or create an issue with them for their API.

urFate commented 2 years ago

Hmm, it seems to be a big in the Magma since it is advertising the same (server) jar as the installer_link:


{"name":"efb9116e","tag_name":"efb9116e","created_at":"2022-07-01T19:37:54.053Z","link":"https://git.magmafoundation.org/api/v4/projects/7/packages/maven/org/magmafoundation/Magma/1.12.2-efb9116e/Magma-1.12.2-efb9116e.jar","installer_link":"https://git.magmafoundation.org/api/v4/projects/7/packages/maven/org/magmafoundation/Magma/1.12.2-efb9116e/Magma-1.12.2-efb9116e.jar","git_commit_url":"https://git.magmafoundation.org/magmafoundation/Magma/commit/efb9116e"}

It would be great if you could help look for or create an issue with them for their API.

Why not just run Magma jar instead of forge installation? Magma provides production ready jar without installation needed and server works fine.

itzg commented 2 years ago

Some versions truly need to be installed in order to prepare dependencies. When you download Forge manually, are you downloading the installer or a jar ready to go?

Besides, it's the principle of it. If their API is saying it's an installer link then it should be an installer jar. If there's no installer and the server jar is runnable as is, then the API should say so.

urFate commented 2 years ago

Some versions truly need to be installed in order to prepare dependencies. When you download Forge manually, are you downloading the installer or a jar ready to go?

Besides, it's the principle of it. If their API is saying it's an installer link then it should be an installer jar. If there's no installer and the server jar is runnable as is, then the API should say so.

I downloaded Magma jar(outside of the Docker container) and started it by java -jar magma.jar and server works out of the box with mod and plugins funcionality.

itzg commented 2 years ago

OK, I was making a broader point, but I'll just queue up a fix to work around their broken API.

m1lc0lm commented 2 years ago

Some versions truly need to be installed in order to prepare dependencies. When you download Forge manually, are you downloading the installer or a jar ready to go?

Besides, it's the principle of it. If their API is saying it's an installer link then it should be an installer jar. If there's no installer and the server jar is runnable as is, then the API should say so.

Magma has an integrated installation tool (like installer.jar --installServer) we also download and load every dependency with that. We completely replaced the installer jar and dont provide that installer anymore. Unfortunally, the API doesnt show if it's a server or installer, as our release files are not labeled with server or installer (only for 1.12) because 1.12 is only a serverJar. I will see, if we can improve the API.

Side note: We did the same with 1.18, only this is still in beta with no official release. There we will still provide both, serverjar and Installer.

Best regards Malcolm ~ MagmaFoundation Mod and Dev

itzg commented 2 years ago

Unfortunally, the API doesnt show if it's a server or installer, as our release files are not labeled with server or installer (only for 1.12) because 1.12 is only a serverJar. I will see, if we can improve the API.

Thanks @m1lc0lm . For now I can work around the issue by checking if the two links equal and use it as a server jar.

itzg commented 2 years ago

@m1lc0lm is the server jar self-installing for 1.16.5 also? I'm starting to get harassed by users 😒, so I am becoming not happy with providing Magma support.

itzg commented 2 years ago

...and for future reference, the API response for 1.18 is broken in the other direction. The link is pointing to an installer, which is wrong:

curl -fsSL https://api.magmafoundation.org/api/v2/1.18/latest | jq
{
  "name": "63cbeee2",
  "tag_name": "63cbeee2",
  "created_at": "2022-07-19T19:14:21.146Z",
  "link": "https://git.magmafoundation.org/api/v4/projects/5/packages/maven/org/magmafoundation/Magma/1.18.2-40.1.54-63cbeee2/Magma-1.18.2-40.1.54-63cbeee2-installer.jar",
  "installer_link": "https://git.magmafoundation.org/api/v4/projects/5/packages/maven/org/magmafoundation/Magma/1.18.2-40.1.54-63cbeee2/Magma-1.18.2-40.1.54-63cbeee2-installer.jar",
  "git_commit_url": "https://git.magmafoundation.org/magmafoundation/Magma-1-18-x/commit/63cbeee2"
}
m1lc0lm commented 2 years ago

@m1lc0lm is the server jar self-installing for 1.16.5 also? I'm starting to get harassed by users 😒, so I am becoming not happy with providing Magma support.

Yes. Atm 1.12 and 1.16 is self installing. We have beta build of 1.18 self installing. But its not available over the api. But it will in a few days.

itzg commented 2 years ago

Excellent. That means the changes I pushed last night will work fine for 1.18 when your side is done.

m1lc0lm commented 2 years ago

Yes. Should work then.

m1lc0lm commented 1 year ago

Magma 1.18 is available over the api. You can just pull it from there. Its also self installing so :)) I dont know if you noticed that.

{ "name": "695a1617", "tag_name": "695a1617", "created_at": "2022-12-10T23:57:56.294Z", "link": "https://git.magmafoundation.org/api/v4/projects/5/packages/maven/org/magmafoundation/Magma/1.18.2-40.1.86-695a1617/Magma-1.18.2-40.1.86-695a1617-server.jar", "installer_link": "https://git.magmafoundation.org/api/v4/projects/5/packages/maven/org/magmafoundation/Magma/1.18.2-40.1.86-695a1617/Magma-1.18.2-40.1.86-695a1617-installer.jar", "git_commit_url": "https://git.magmafoundation.org/magmafoundation/Magma-1-18-x/commit/695a1617" } use link as before. URL hasnt changed