Forums Archived

This forum has been archived. No new posts can be made and no new users can sign up. It remains here for reference only.

Find the new forums here

Lapetus 1.9.5.2 / docker instances not working for minecraft module

  • 407 Views
  • Last Post 13 February 2020
Skeltoras posted this 03 February 2020

Hi Mike,

OS Name/Version:

Debian 10 (Linux 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux)

Product Name/Version:

AMP Lapetus 1.9.5.2

Problem Description:

i have an amp installation with four minecraft instances running as docker instances. After upgrading to latest AMP version 1.9.5.2, the minecraft instances are not able to start. Logfile doesn't show any error or other information.

Webinterface error: "This task could not be completed: Starting Instance - Starting Minecraft01 (Minecraft01)...."

Log output if i start with AMPLOGLEVEL=0:

AMP_LOG_LEVEL=0 ampinstmgr -s Minecraft01
[Info] Logging level set to Debug
[Info] AMP Instance Manager v1.9.5.2 built 30/01/2020 16:29
[Info] Release spec: Release - built by CUBECODERS/buildbot on CCL-DEV
[Debug] Syncing certificate store using /etc/ssl/certs/ca-certificates.crt
[Debug] Current certificate store contains 128 items, system store contains 128
[Debug] Sync process completed.
[Debug] Loading instances from /home/amp/.ampdata/instances.json...
[Debug] Loaded 5 instances.
[Debug] Running command line: "/usr/bin/docker inspect AMP_Minecraft01" from ""
[Info] Starting Instance: 'Minecraft01'
[Debug] Running command line: "/usr/bin/docker inspect AMP_Minecraft01" from ""
[Debug] Starting process /usr/bin/docker
[Debug] Working Directory:
[Debug] Arguments: images cubecoders/ampbase --format {{.Tag}}
[Debug] Started process with ID 4419
[Debug] Starting process /usr/bin/id
[Debug] Working Directory:
[Debug] Arguments: -u
[Debug] Started process with ID 4428
[Debug] Running command line: "/usr/bin/docker run --rm -d --mac-address 02:42:ac:ff:21:50 --name AMP_Minecraft01 -v "/home/amp/.ampdata/instances/Minecraft01":/AMP -v "/home/amp/.config":/home/AMP/.config:ro -v /opt/cubecoders/amp:/opt/cubecoders/amp:ro -p 0.0.0.0:8081:8081/tcp -e MONO_THREADS_PER_CPU='2000' -e MONO_GC_PARAMS='major=marksweep-conc' -e LD_LIBRARY_PATH='./:/opt/cubecoders/amp/:/AMP/' -e MONO_TLS_PROVIDER='btls' -e LANG='en_US.UTF-8' -e AMPUSERID='1003' -p 25565:25565/both cubecoders/ampbase:java8" from ""
[Info] This instance failed to start. Run 'ampinstmgr LastLog Minecraft01' to view it's most recent log.

Log output when i start the docker command

/usr/bin/docker run --rm -d --mac-address 02:42:ac:ff:21:50 --name AMP_Minecraft01 -v "/home/amp/.ampdata/instances/Minecraft01":/AMP -v "/home/amp/.config":/home/AMP/.config:ro -v /opt/cubecoders/amp:/opt/cubecoders/amp:ro -p 0.0.0.0:8081:8081/tcp -e MONO_THREADS_PER_CPU='2000' -e MONO_GC_PARAMS='major=marksweep-conc' -e LD_LIBRARY_PATH='./:/opt/cubecoders/amp/:/AMP/' -e MONO_TLS_PROVIDER='btls' -e LANG='en_US.UTF-8' -e AMPUSERID='1003' -p 25565:25565/both cubecoders/ampbase:java8
/usr/bin/docker: invalid publish opts format (should be name=value but got '0.0.0.0:8081:8081/tcp').
See '/usr/bin/docker run --help'.

so it seems docker is misreading the first "-p" tag as an environment variable.

Steps to reproduce:

  • Create new minecraft docker instance
  • Update from amp 1.9.5.0 to 1.9.5.2
  • Start minecraft instance

Actions taken to resolve so far:

  • server reboot
  • new minecraft instance created, same output
  • new factorio docker instance created: this instance is woking and both "-p" tags are at the end of the docker command

Order By: Standard | Newest | Votes
Mike posted this 04 February 2020

AMPs docker logic hasn't changed so I suspect an update to Docker itself may have changed something.

Try rebinding that instance from 0.0.0.0 to either 127.0.0.1 or to your machines actual internal IP address.

Skeltoras posted this 04 February 2020

Rebind to 127.0.0.1 or the internal ip of my machine doesn't help.

Docker is on version 19.03.5, build 633a0ea838

This command is working:

/usr/bin/docker run --rm -d --mac-address 02:42:ac:ff:e8:84 --name AMP_Factorio01 -v "/home/amp/.ampdata/instances/Factorio01":/AMP -v "/home/amp/.config":/home/AMP/.config:ro -v /opt/cubecoders/amp:/opt/cubecoders/amp:ro -p 0.0.0.0:8085:8085/tcp -e MONO_THREADS_PER_CPU='2000' -e MONO_GC_PARAMS='major=marksweep-conc' -e LD_LIBRARY_PATH='./:/opt/cubecoders/amp/:/AMP/' -e MONO_TLS_PROVIDER='btls' -e LANG='en_US.UTF-8' -e AMPUSERID='1003' -p 34197:34197/udp -p 7777:7777/tcp cubecoders/ampbase

This command gets the error:

/usr/bin/docker run --rm -d --mac-address 02:42:ac:ff:21:50 --name AMP_Minecraft01 -v "/home/amp/.ampdata/instances/Minecraft01":/AMP -v "/home/amp/.config":/home/AMP/.config:ro -v /opt/cubecoders/amp:/opt/cubecoders/amp:ro -p 10.10.30.21:8081:8081/tcp -e MONO_THREADS_PER_CPU='2000' -e MONO_GC_PARAMS='major=marksweep-conc' -e LD_LIBRARY_PATH='./:/opt/cubecoders/amp/:/AMP/' -e MONO_TLS_PROVIDER='btls' -e LANG='en_US.UTF-8' -e AMPUSERID='1003' -p 25565:25565/both cubecoders/ampbase:java8

only difference is the docker-image. Port 8081 isn't used by any other service.

I have java installed on the system but this shouldn't interfere with the container.

java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-b08)
Eclipse OpenJ9 VM (build openj9-0.18.1, JRE 1.8.0 Linux amd64-64-Bit Compressed References 20200122_511 (JIT enabled, AOT enabled)
OpenJ9   - 51a5857d2
OMR      - 7a1b0239a
JCL      - 8cf8a30581 based on jdk8u242-b08)

Mike posted this 04 February 2020

There's a new update about to come out with some tweaks for this, give it a try in about an hour.

Skeltoras posted this 04 February 2020

i installed the update to 1.9.5.4 and performed an upgrade with --nocache flag, still the same error.

AMP_LOG_LEVEL=0 ampinstmgr -s Minecraft01
[Info] Logging level set to Debug
[Info] AMP Instance Manager v1.9.5.4 built 04/02/2020 16:20
[Info] Release spec: Release - built by CUBECODERS/buildbot on CCL-DEV
[Debug] Syncing certificate store using /etc/ssl/certs/ca-certificates.crt
[Debug] Current certificate store contains 128 items, system store contains 128
[Debug] Sync process completed.
[Debug] Loading instances from /home/amp/.ampdata/instances.json...
[Debug] Loaded 6 instances.
[Debug] Running command line: "/usr/bin/docker inspect AMP_Minecraft01" from ""
[Info] Starting Instance: 'Minecraft01'
[Debug] Running command line: "/usr/bin/docker inspect AMP_Minecraft01" from ""
[Debug] Starting process /usr/bin/docker
[Debug] Working Directory:
[Debug] Arguments: images cubecoders/ampbase --format {{.Tag}}
[Debug] Started process with ID 100875
[Debug] Starting process /usr/bin/id
[Debug] Working Directory:
[Debug] Arguments: -u
[Debug] Started process with ID 100883
[Debug] Running command line: "/usr/bin/docker run --rm -d --mac-address 02:42:ac:ff:21:50 --name AMP_Minecraft01 -v "/home/amp/.ampdata/instances/Minecraft01":/AMP -v "/home/amp/.config":/home/amp/.config:ro -v /opt/cubecoders/amp:/opt/cubecoders/amp:ro -p 8081:8081/tcp -e MONO_THREADS_PER_CPU='2000' -e MONO_GC_PARAMS='major=marksweep-conc' -e LD_LIBRARY_PATH='./:/opt/cubecoders/amp/:/AMP/' -e MONO_TLS_PROVIDER='btls' -e LANG='en_US.UTF-8' -e AMPUSERID='1003' -p 25565:25565/both cubecoders/ampbase:java8" from ""
[Info] This instance failed to start. Run 'ampinstmgr LastLog Minecraft01' to view it's most recent log.

docker output:

/usr/bin/docker run --rm -d --mac-address 02:42:ac:ff:21:50 --name AMP_Minecraft01 -v "/home/amp/.ampdata/instances/Minecraft01":/AMP -v "/home/amp/.config":/home/amp/.config:ro -v /opt/cubecoders/amp:/opt/cubecoders/amp:ro -p 8081:8081/tcp -e MONO_THREADS_PER_CPU='2000' -e MONO_GC_PARAMS='major=marksweep-conc' -e LD_LIBRARY_PATH='./:/opt/cubecoders/amp/:/AMP/' -e MONO_TLS_PROVIDER='btls' -e LANG='en_US.UTF-8' -e AMPUSERID='1003' -p 25565:25565/both cubecoders/ampbase:java8
/usr/bin/docker: invalid publish opts format (should be name=value but got '8081:8081/tcp').
See '/usr/bin/docker run --help'.

Skeltoras posted this 08 February 2020

So any news on this?

Skeltoras posted this 13 February 2020

I found the solution to fix this problem for minecraft instances with docker.

This is the actual code:

/usr/bin/docker run --rm -d --mac-address 02:42:ac:ff:21:50 --name AMP_Minecraft01 -v "/home/amp/.ampdata/instances/Minecraft01":/AMP -v "/home/amp/.config":/home/amp/.config:ro -v /opt/cubecoders/amp:/opt/cubecoders/amp:ro -p 8081:8081/tcp -e MONO_THREADS_PER_CPU='2000' -e MONO_GC_PARAMS='major=marksweep-conc' -e LD_LIBRARY_PATH='./:/opt/cubecoders/amp/:/AMP/' -e MONO_TLS_PROVIDER='btls' -e LANG='en_US.UTF-8' -e AMPUSERID='1003' -p 25565:25565/both cubecoders/ampbase:java8

The "-p 25565:25565/both" flag doesn't work with current docker versions. You need to split it in "-p 25565:25565/tcp -p 25565:25565/udp". if i set this, the container will start.

/usr/bin/docker run --rm -d --mac-address 02:42:ac:ff:4f:73 --name AMP_Minecraft04 -v "/home/amp/.ampdata/instances/Minecraft04":/AMP -v "/home/amp/.config":/home/amp/.config:ro -v /opt/cubecoders/amp:/opt/cubecoders/amp:ro -p 8084:8084/tcp -e MONO_THREADS_PER_CPU='2000' -e MONO_GC_PARAMS='major=marksweep-conc' -e LD_LIBRARY_PATH='./:/opt/cubecoders/amp/:/AMP/' -e MONO_TLS_PROVIDER='btls' -e LANG='en_US.UTF-8' -e AMPUSERID='1003' -p 25568:25568/tcp -p 25568:25568/udp cubecoders/ampbase:java8

Can you fix this in your next release?

Thanks!

Mike posted this 13 February 2020

Interesting! Thanks for the digging, I will implement this immediately.

Edit: Nightly will have this change in it.

  • Liked by
  • Skeltoras
Close