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
8.76k stars 1.47k forks source link

Automatically downloading Dynmap with SPIGET_RESOURCES fails #1378

Open ElektroVirus opened 2 years ago

ElektroVirus commented 2 years ago

Describe the problem

I tried to install Dynmap link to dynmap at spigotmc.org using the SPIGET_RESOURCES automatically download method described in link to README.

As you can see, the dynmap link ends with "274" so I put in my podman run script file -e SPIGET_RESOURCES=274. However, after starting the server I get an error in podman logs:

[init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x. 8 1000 1000 4096 Feb 21 22:44 /data'
[init] Resolved version given LATEST into 1.18.1
[init] Resolving type given SPIGOT
[init] Downloading Spigot from https://download.getbukkit.org/spigot/spigot-1.18.1.jar ...
[init] Getting plugins via Spiget
[init] Downloading resource 274 ...
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /tmp/274.zip or
        /tmp/274.zip.zip, and cannot find /tmp/274.zip.ZIP, period.
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /tmp/274.zip or
        /tmp/274.zip.zip, and cannot find /tmp/274.zip.ZIP, period.
[init] ERROR downloaded resource '274' seems to be not a valid plugin

Thanks for this docker image! Its awesome and simple to setup with so much versatility. This problem is not neccessarily a bug in this container but rather with packaging the dynmap, but I just wanted to inform you.

Container definition

#!/bin/bash
TYPE=SPIGOT
podman run -d                                                           \
        -p 25565:25565                                                  \
        -p 25575:25575                                                  \
        -p 8123:8123                                                    \
        -e MEMORY=""                                                    \
        -e JVM_XX_OPTS="-XX:MaxRAMPercentage=75"                        \
        -e EULA=TRUE                                                    \
        -e ENABLE_ROLLING_LOGS=true                                     \
        -e GUI=FALSE                                                    \
        -e TZ="Europe/Helsinki"                                         \
        -e TYPE=$TYPE                                                   \
        -e MOTD="A $TYPE Minecraft Server powered by Rocky Linux and Podman"    \
        -e DIFFICULTY=hard                                              \
        -e OPS="<redacted>"  \
        -e ENABLE_RCON=true                                             \
        -e RCON_PASSWORD="<redacted>" \
        -e ENABLE_QUERY=false                                           \
        -e MAX_PLAYERS=50                                               \
        -e MAX_WORLD_SIZE=100000                                        \
        -e ALLOW_NETHER=true                                            \
        -e ANNOUNCE_PLAYER_ACHIEVEMENTS=true                            \
        -e ENABLE_COMMAND_BLOCK=false                                   \
        -e FORCE_GAMEMODE=false                                         \
        -e GENERATE_STRUCTURES=true                                     \
        -e HARDCORE=false                                               \
        -e SNOOPER_ENABLED=false                                        \
        -e MAX_BUILD_HEIGHT=256                                         \
        -e MAX_TICK_TIME=60000                                          \
        -e SPAWN_ANIMALS=true                                           \
        -e SPAWN_MONSTERS=true                                          \
        -e SPAWN_NPCS=true                                              \
        -e SPAWN_PROTECTION=0                                           \
        -e VIEW_DISTANCE=32                                             \
        -e MODE=survival                                                \
        -e PVP=true                                                     \
        -e LEVEL_TYPE=DEFAULT                                           \
        -e ONLINE_MODE=TRUE                                             \
        -e ALLOW_FLIGHT=FALSE                                           \
        -e SERVER_NAME="<redacted>"  \
        -e SERVER_PORT=25565                                            \
        -e SPIGET_RESOURCES=274                                         \
        -v /home/$USER/minecraft-server/data:/data:Z     \
        --name minecraft-server                                         \
        itzg/minecraft-server

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. 8 1000 1000 4096 Feb 21 22:44 /data'\'''
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
[init] 2022-02-22 23:45:54+02:00 Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x. 8 1000 1000 4096 Feb 21 22:44 /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
++ get --json-path '$.latest.release' https://launchermeta.mojang.com/mc/game/version_manifest.json
++ flags=()
++ local flags
++ isTrue false
++ local oldState
+++ shopt -po xtrace
++ oldState='set -o xtrace'
++ shopt -u -o xtrace
++ return 1
++ mc-image-helper get --json-path '$.latest.release' https://launchermeta.mojang.com/mc/game/version_manifest.json
+ VANILLA_VERSION=1.18.1
+ export VANILLA_VERSION
+ log 'Resolved version given LATEST into 1.18.1'
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
[init] 2022-02-22 23:45:57+02:00 Resolved version given LATEST into 1.18.1
+ cd /data
+ export ORIGINAL_TYPE=SPIGOT
+ ORIGINAL_TYPE=SPIGOT
+ 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
+ versionLessThan 1.7
+ mc-image-helper compare-versions 1.18.1 lt 1.7
+ log 'Resolving type given SPIGOT'
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
[init] 2022-02-22 23:45:57+02:00 Resolving type given SPIGOT
+ case "${TYPE^^}" in
+ exec /start-deployBukkitSpigot
+ set -e
+ isTrue ''
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
+ return 1
+ isTrue ''
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
+ return 1
+ downloadSpigot
+ local match
+ case "$TYPE" in
+ match=Spigot
+ downloadUrl=
+ getbukkitFlavor=spigot
+ [[ LATEST = LATEST ]]
++ restify https://getbukkit.org/download/spigot --attribute=property=og:title
++ jq -r '.[0] | .attributes | select(.property == "og:title") | .content | split(" ") | .[-1]'
+ VANILLA_VERSION=1.18.1
+ [[ -z '' ]]
+ versionLessThan 1.16.5
+ mc-image-helper compare-versions 1.18.1 lt 1.16.5
+ [[ spigot = \c\r\a\f\t\b\u\k\k\i\t ]]
+ downloadUrl=https://download.getbukkit.org/spigot/spigot-1.18.1.jar
+ setServerVar
+ case "$TYPE" in
+ export SERVER=spigot_server-1.18.1.jar
+ SERVER=spigot_server-1.18.1.jar
+ '[' -f spigot_server-1.18.1.jar ']'
+ curlArgs='-z spigot_server-1.18.1.jar'
+ isDebugging
+ isTrue True
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
+ return 0
+ return 0
+ curlArgs='-z spigot_server-1.18.1.jar -v'
+ log 'Downloading Spigot from https://download.getbukkit.org/spigot/spigot-1.18.1.jar ...'
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
[init] 2022-02-22 23:45:59+02:00 Downloading Spigot from https://download.getbukkit.org/spigot/spigot-1.18.1.jar ...
+ curl -fsSL -o spigot_server-1.18.1.jar -z spigot_server-1.18.1.jar -v https://download.getbukkit.org/spigot/spigot-1.18.1.jar
*   Trying 188.114.97.2:443...
* TCP_NODELAY set
* Connected to download.getbukkit.org (188.114.97.2) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [25 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [2357 bytes data]
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [79 bytes data]
* TLSv1.3 (IN), TLS handshake, Finished (20):
{ [52 bytes data]
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.3 (OUT), TLS handshake, Finished (20):
} [52 bytes data]
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: C=US; ST=California; L=San Francisco; O=Cloudflare, Inc.; CN=sni.cloudflaressl.com
*  start date: Aug 11 00:00:00 2021 GMT
*  expire date: Aug 10 23:59:59 2022 GMT
*  subjectAltName: host "download.getbukkit.org" matched cert's "*.getbukkit.org"
*  issuer: C=US; O=Cloudflare, Inc.; CN=Cloudflare Inc ECC CA-3
*  SSL certificate verify ok.
} [5 bytes data]
> GET /spigot/spigot-1.18.1.jar HTTP/1.1
> Host: download.getbukkit.org
> User-Agent: curl/7.68.0
> Accept: */*
> If-Modified-Since: Tue, 22 Feb 2022 21:24:48 GMT
> 
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [230 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [230 bytes data]
* old SSL session ID is stale, removing
{ [5 bytes data]
* Mark bundle as not supporting multiuse
< HTTP/1.1 304 Not Modified
< Date: Tue, 22 Feb 2022 21:45:59 GMT
< Connection: keep-alive
< Last-Modified: Tue, 22 Feb 2022 21:02:02 GMT
< ETag: "62154f4a-407693c"
< Cache-Control: max-age=14400
< CF-Cache-Status: HIT
< Age: 1273
< Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=6e%2B2e8TE154LXKMDTxQBvF23YM6tHo71oD3m2R5fD9lvDof%2BtSAhArCc0MwtYCgpvwJb9s4Lro4Av3f54NdTzKXBU3BpcQe9pJSl2ZZExbIPOAbI8OrstqGArGrhPZ26d%2BjljIPB%2BxaV"}],"group":"cf-nel","max_age":604800}
< NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
< Strict-Transport-Security: max-age=0; preload
< X-Content-Type-Options: nosniff
< Server: cloudflare
< CF-RAY: 6e1b67958af93766-HEL
< alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
< 
* Connection #0 to host download.getbukkit.org left intact
+ [[ 0 != 0 ]]
++ grep -c 'DOCTYPE html' spigot_server-1.18.1.jar
+ [[ 0 != 0 ]]
+ JVM_OPTS=' -DIReallyKnowWhatIAmDoingISwear'
+ export JVM_OPTS
+ export FAMILY=SPIGOT
+ FAMILY=SPIGOT
+ exec /start-spiget
+ extraCurlArgs=(-v)
+ : 274
+ : 5
+ [[ -n 274 ]]
+ isTrue false
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
+ return 1
+ log 'Getting plugins via Spiget'
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
[init] 2022-02-22 23:46:00+02:00 Getting plugins via Spiget
+ IFS=,
+ read -r -a resources
+ for resource in "${resources[@]}"
+ getResourceFromSpiget 274
+ resource=274
+ log 'Downloading resource 274 ...'
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
[init] 2022-02-22 23:46:00+02:00 Downloading resource 274 ...
+ mkdir -p /data/plugins
+ versionfile=/data/plugins/.274-version.json
+ versionfileNew=/tmp/.274-version.json
+ '[' -f /data/plugins/.274-version.json ']'
+ downloadResourceFromSpiget 274
+ resource=274
+ tmpfile=/tmp/274.zip
+ url=https://api.spiget.org/v2/resources/274/download
+ curl -o /tmp/274.zip -fsSL -H 'User-Agent: itzg/minecraft-server' -v https://api.spiget.org/v2/resources/274/download
*   Trying 104.24.30.82:443...
* TCP_NODELAY set
* Connected to api.spiget.org (104.24.30.82) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [19 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [2331 bytes data]
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [79 bytes data]
* TLSv1.3 (IN), TLS handshake, Finished (20):
{ [52 bytes data]
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.3 (OUT), TLS handshake, Finished (20):
} [52 bytes data]
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=California; L=San Francisco; O=Cloudflare, Inc.; CN=sni.cloudflaressl.com
*  start date: Jun 30 00:00:00 2021 GMT
*  expire date: Jun 29 23:59:59 2022 GMT
*  subjectAltName: host "api.spiget.org" matched cert's "*.spiget.org"
*  issuer: C=US; O=Cloudflare, Inc.; CN=Cloudflare Inc ECC CA-3
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
} [5 bytes data]
* Using Stream ID: 1 (easy handle 0x55df8954ae30)
} [5 bytes data]
> GET /v2/resources/274/download HTTP/2
> Host: api.spiget.org
> accept: */*
> user-agent: itzg/minecraft-server
> 
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [238 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [238 bytes data]
* old SSL session ID is stale, removing
{ [5 bytes data]
* Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
} [5 bytes data]
< HTTP/2 302 
< date: Tue, 22 Feb 2022 21:46:00 GMT
< content-type: text/plain; charset=utf-8
< content-length: 74
< location: https://dev.bukkit.org/projects/dynmap/files/3637280
< cf-ray: 6e1b67975c509793-AMS
< access-control-allow-origin: *
< vary: Accept, Accept-Encoding
< cf-cache-status: BYPASS
< expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< x-powered-by: Express
< x-spiget-file-source: external
< x-spiget-server: nugget
< report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=kPkgc3buWvPrQB5zSlexdTWSCai1Hrcl0mMR8Cj0hZeJeFV0oZ7cI7M%2Fh05ShGb62K%2FJb6ZAqoYf5kfQew3SxZEdN1W1%2BJgRSxccVcZBYUYs%2FjUpvC0foJPPQ6rxJncQ"}],"group":"cf-nel","max_age":604800}
< nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
< server: cloudflare
< 
* Ignoring the response-body
{ [74 bytes data]
* Connection #0 to host api.spiget.org left intact
* Issue another request to this URL: 'https://dev.bukkit.org/projects/dynmap/files/3637280'
*   Trying 104.19.147.132:443...
* TCP_NODELAY set
* Connected to dev.bukkit.org (104.19.147.132) port 443 (#1)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [19 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [2330 bytes data]
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [80 bytes data]
* TLSv1.3 (IN), TLS handshake, Finished (20):
{ [52 bytes data]
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.3 (OUT), TLS handshake, Finished (20):
} [52 bytes data]
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=California; L=San Francisco; O=Cloudflare, Inc.; CN=sni.cloudflaressl.com
*  start date: Jul  5 00:00:00 2021 GMT
*  expire date: Jul  4 23:59:59 2022 GMT
*  subjectAltName: host "dev.bukkit.org" matched cert's "*.bukkit.org"
*  issuer: C=US; O=Cloudflare, Inc.; CN=Cloudflare Inc ECC CA-3
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
} [5 bytes data]
* Using Stream ID: 1 (easy handle 0x55df8954ae30)
} [5 bytes data]
> GET /projects/dynmap/files/3637280 HTTP/2
> Host: dev.bukkit.org
> accept: */*
> user-agent: itzg/minecraft-server
> 
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [230 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [230 bytes data]
* old SSL session ID is stale, removing
{ [5 bytes data]
* Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
} [5 bytes data]
< HTTP/2 200 
< date: Tue, 22 Feb 2022 21:46:00 GMT
< content-type: text/html; charset=utf-8
< set-cookie: AWSALB=Vnk46OoqnR71vKUxx2+HaOJ5w8pg/SILiasYCRNsQ3n/V/qyMHr868qM+eCm/TBofDa1RKfahZj/7POefR9+wyFpieOc14i55rfTNkfG/6OFFY8gD9b44/BGxcDa; Expires=Tue, 01 Mar 2022 21:46:00 GMT; Path=/
< cache-control: private
< x-aspnetmvc-version: 5.2
< x-frame-options: SAMEORIGIN
< x-aspnet-version: 4.0.30319
< x-ua-compatible: IE=edge,chrome=1
< x-frame-options: SAMEORIGIN
< strict-transport-security: max-age=15768000
< cf-cache-status: DYNAMIC
< expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< set-cookie: AWSALBCORS=Vnk46OoqnR71vKUxx2+HaOJ5w8pg/SILiasYCRNsQ3n/V/qyMHr868qM+eCm/TBofDa1RKfahZj/7POefR9+wyFpieOc14i55rfTNkfG/6OFFY8gD9b44/BGxcDa; Expires=Tue, 01 Mar 2022 21:46:00 GMT; Path=/; SameSite=None; Secure
< set-cookie: Unique_ID_v2=b19a8b111ee14d3e94992d851f70df63; domain=.bukkit.org; expires=Sun, 22-Feb-2032 21:46:00 GMT; path=/
< set-cookie: __cf_bm=Kzw9q.8AopVvKOGdSZ4AHNNVlaPBZOsI8KrOCyUNlMI-1645566360-0-AbPZsSGInc9yHZsf3iwexIoVOuNsTLoZ1zRjV+pNyzI7hW/iDY5Gcn2DX8qAUpucQCITftcDiyKdrWYbQV8m+Yo=; path=/; expires=Tue, 22-Feb-22 22:16:00 GMT; domain=.bukkit.org; HttpOnly; Secure; SameSite=None
< server: cloudflare
< cf-ray: 6e1b6798691a376d-HEL
< 
{ [477 bytes data]
* Connection #1 to host dev.bukkit.org left intact
+ containsJars /tmp/274.zip
+ file=/tmp/274.zip
+ pat='\.jar$'
++ unzip -l /tmp/274.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /tmp/274.zip or
        /tmp/274.zip.zip, and cannot find /tmp/274.zip.ZIP, period.
+ read -r line
+ [[ Archive:  /tmp/274.zip =~ \.jar$ ]]
+ read -r line
+ return 1
+ containsPlugin /tmp/274.zip
+ file=/tmp/274.zip
+ pat='plugin.yml$'
++ unzip -l /tmp/274.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /tmp/274.zip or
        /tmp/274.zip.zip, and cannot find /tmp/274.zip.ZIP, period.
+ read -r line
+ [[ Archive:  /tmp/274.zip =~ plugin.yml$ ]]
+ read -r line
+ return 1
+ log 'ERROR downloaded resource '\''274'\'' seems to be not a valid plugin'
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
[init] 2022-02-22 23:46:01+02:00 ERROR downloaded resource '274' seems to be not a valid plugin
+ exit 2
itzg commented 2 years ago

Thanks for issue report. Looks like 274 is an infamous resource

https://github.com/itzg/docker-minecraft-server/issues/1307#issuecomment-1022674250

I'll see if there's something I can do in the script to detect the incorrect resource download and provide a more descriptive message.

ElektroVirus commented 2 years ago

Thank you!

toddejohnson commented 2 years ago

It looks like this is going to an external download which is the issue:

curl -v -fsSL -H "User-Agent: itzg/minecraft-server" "https://api.spiget.org/v2/resources/274/download"; 
...
location: https://dev.bukkit.org/projects/dynmap/files/3670362

However what you really want is https://dev.bukkit.org/projects/dynmap/files/3670362/download so I guess adding /download to the end if you see dev.bukkit.org might work to make the leap?

Then you get location: https://edge.forgecdn.net/files/3670/362/Dynmap-3.4-beta-2-spigot.jar and the file written out.

This is a bit more complicated than I can take a quick swing at in https://github.com/itzg/docker-minecraft-server/blob/master/scripts/start-spiget#L89 although I want to provide the troubleshooting I'd already went through.

itzg commented 2 years ago

Thanks @toddejohnson for the investigation. I have opened the issue above with spiget to see if it is something that can be corrected on their end.

itzg commented 2 years ago

@ElektroVirus @toddejohnson , spiget maintainer confirmed that dynmap needs to fix the download link on their side. Please report an issue with them.

In the meantime I'll need to blacklist their resource ID since it is non-compliant.

ElektroVirus commented 2 years ago

Thanks! I posted an issue here: https://github.com/webbukkit/dynmap/issues/3705

itzg commented 2 years ago

I'll have it better detect a non-zip download and direct the user to the download page to ensure the authors can monetize appropriately.

toddejohnson commented 2 years ago

It would be great to detect html in the download before unzipping. That would be universal for other broken packages. Perhaps filter content type from the curl output?

ElektroVirus commented 2 years ago

Thanks! I posted an issue here: webbukkit/dynmap#3705

Update: the issue is now closed for being a duplicate of https://github.com/webbukkit/dynmap/issues/3638 (as for this thread, I tried searching for duplicates but didn't find it).

So apparently is a feature rather than bug, because the download page is their only trivial monetization.

ElektroVirus commented 2 years ago

I'll have it better detect a non-zip download and direct the user to the download page to ensure the authors can monetize appropriately.

Yes, that sounds good. I just hope the installation instructions are not much different for this Docker-container than for a traditional install.

I actually tried to install Dynmap the traditional way by copying it into the podman-container, unsuccessfully. It was only after this that I discovered the spiget-api method.

itzg commented 2 years ago

I'll have it better detect a non-zip download and direct the user to the download page to ensure the authors can monetize appropriately.

Yes, that sounds good. I just hope the installation instructions are not much different for this Docker-container than for a traditional install.

I actually tried to install Dynmap the traditional way by copying it into the podman-container, unsuccessfully. It was only after this that I discovered the spiget-api method.

Yes, you'll need to pre-download and stage the plugin file. I don't know what you mean by traditional way, but this image has several ways to accommodate, such as

https://github.com/itzg/docker-minecraft-server#optional-plugins-mods-and-config-attach-points

itzg commented 2 years ago

Given the discussion with the mod author, the latest image doesn't "fix" the download of Dynmap; however, it does detect the external download scenario and provides the link registered with the resource:

[init] Downloading resource 274 ...
[mc-image-helper] 19:26:28.477 ERROR : 'get' command failed: Unexpected content type 'text/html', expected any of [application/zip, application/java-archive]
[init] ERROR: failed to download resource '274' from https://api.spiget.org/v2/resources/274/download
[init]        Visit https://dev.bukkit.org/projects/dynmap/files/3670362 to pre-download the resource
[init]        instead of using SPIGET_RESOURCES
h3mmy commented 1 year ago

For clarification, does this mean I will need to manually redownload dynmap and move it into my minecraft pod every time I restart my server?

toddejohnson commented 1 year ago

@h3mmy I've been using the below to get Dynmap and LuckPerms although the command needs updated on new versions:


-e MODS=https://download.luckperms.net/1462/bukkit/loader/LuckPerms-Bukkit-5.4.54.jar,https://dynmap.us/builds/dynmap/Dynmap-3.5-beta-1-spigot.jar
h3mmy commented 1 year ago

Thanks! I had come up with https://mediafilez.forgecdn.net/files/4167/109/Dynmap-3.5-beta-1-spigot.jar . I'm glad there's more options.

Dougiebabe commented 1 year ago

@h3mmy I've been using the below to get Dynmap and LuckPerms although the command needs updated on new versions:

-e MODS=https://download.luckperms.net/1462/bukkit/loader/LuckPerms-Bukkit-5.4.54.jar,https://dynmap.us/builds/dynmap/Dynmap-3.5-beta-1-spigot.jar

Just to say that this worked for me, added the following to Enviroments via Portainer and removed 274 from SPIGET_RESOURCES

MODS | https://dynmap.us/builds/dynmap/Dynmap-3.5-beta-1-spigot.jar -- | --

Server back up with Dynmap working