Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazymc Docker Proxy doesnt allow me to connect to the Minecraft Game Server #134

Closed
FurkanVG opened this issue Oct 24, 2024 · 50 comments
Closed
Labels
question Further information is requested

Comments

@FurkanVG
Copy link

Hi,

i am trying to combine this docker image with my itzg minecraft container.

The docker compose:

networks:
  minecraft-network:
    driver: bridge    
    ipam:
      config:
        - subnet: 172.58.0.0/16

services:
  lazymc:
    image: ghcr.io/joesturge/lazymc-docker-proxy:latest
    # the IPs should start at .2 as .1 is reserved for the gateway
    networks:
      minecraft-network:
        ipv4_address: 172.58.0.2
    restart: unless-stopped
    volumes:
      # you should mount the minecraft server dir under /server, using read only.
      - Minecraft-Data:/server:ro
      # you need to supply the docker socket, so that the container can run docker command
      - /var/run/docker.sock:/var/run/docker.sock:ro
    ports:
      # lazymc-docker-proxy acts as a proxy, so there is
      # no need to expose the server port on the Minecraft container
      - "49152:25565"

  mc:
    image: itzg/minecraft-server
    networks:
      minecraft-network:
        ipv4_address: 172.58.0.3
    labels:
      # Set lazymc.enabled to true to enable lazymc on this container
      - lazymc.enabled=true
      - lazymc.server.start_timeout=500
      # Required to find the container to manage it
      - lazymc.group=mc
      # Point to the service name of the Minecraft server
      - lazymc.server.address=mc:25565
      - "com.centurylinklabs.watchtower.enable=false" # Exclude from Watchtower
    container_name: minecraft-skyfam
    hostname: minecraft-skyfam
    tty: true
    stdin_open: true
    ports:
      # - "49152:25565"
      - "25575:25575"
      - "8100:8100"
      - "8804:8804"
    restart: unless-stopped

    environment:
      VIEW_DISTANCE: "10"
      OVERRIDE_WHITELIST: "true"
      WHITELIST: |
        user
    volumes:
      - Minecraft-Data:/data
      - Minecraft-Mods:/mods
      - Minecraft-Plugins:/plugins

volumes:
  Minecraft-Data:
    external: true
  Minecraft-Mods:
    external: true
  Minecraft-Plugins:
    external: true
  Minecraft-Backups:
    external: true

i removes some ENV variables not related to this, so as fyi.

The current scenario:

  1. The initial start of the docker compose looks fine. I see that the lazy mc docker proxy is starting fine, and that the main mc server is offline. I als see the MOTD
  2. When i try to connect then to the MC Server, it sees the connection and it starts then the mc docker container, all good. Few minutes later the mc docker container is online, BUT I can not connect to it. Even tho the mc docker container is running, it just is stuck at "Connecting to the server". The logs of lazy mc show this:
    image

Now i had thought it would be related to how long my mc server takes time to boot up, so i increased the timeout to 500s, but that didnt help. I dont know where the issue is? Is it the port changing i did? I have adapted this in the compose and it shouldnt be an issue.

@FurkanVG
Copy link
Author

Ping @joesturge

@FurkanVG
Copy link
Author

2024-10-25T12:12:40.558515995Z  DEBUG mc::lazymc-docker-proxy::docker         > Found 1 container(s) to start

2024-10-25T12:12:40.558776553Z  INFO  mc::lazymc-docker-proxy::docker         > Starting container: /minecraft-skyfam

2024-10-25T12:12:40.566097938Z  DEBUG mc::bollard::docker                     > unix://2f7661722f72756e2f646f636b65722e736f636b/containers/5708467b32cb52fcbbf3e080a37c249a4e15ac8b9dc7326b36f8781d982981be/start

2024-10-25T12:13:05.522335157Z  WARN  mc::lazymc                              > Held client reached timeout of 25s

2024-10-25T12:13:10.078669968Z  DEBUG mc::lazymc                              > Loaded 1 whitelist and 8 OP users

2024-10-25T12:13:22.263829910Z  DEBUG mc::lazymc                              > Loaded 1 whitelist and 8 OP users

2024-10-25T12:13:27.344126900Z  DEBUG mc::lazymc                              > Loaded 1 whitelist and 8 OP users

2024-10-25T12:13:56.821557601Z  DEBUG mc::lazymc                              > Loaded 1 whitelist and 8 OP users

2024-10-25T12:14:13.902982327Z  DEBUG mc::lazymc                              > Loaded 0 banned IPs

2024-10-25T12:14:13.908451685Z  DEBUG mc::lazymc                              > Loaded 1 whitelist and 8 OP users

2024-10-25T12:16:01.926868723Z  WARN  mc::lazymc                              > Held client reached timeout of 25s

2024-10-25T12:17:41.707689955Z  ERROR mc::lazymc::monitor                     > Force killing server, took too long to start or stop

2024-10-25T12:17:41.707747602Z  DEBUG lazymc-docker-proxy::health             > Setting health status to: UNHEALTHY

2024-10-25T12:17:41.708003076Z  ERROR lazymc-docker-proxy::health             > Application is unhealthy.

2024-10-25T12:17:41.711120037Z  WARN  mc::lazymc                              > Server process stopped with error code (signal: 9 (SIGKILL))

2024-10-25T12:17:43.726419139Z  ERROR mc::lazymc::monitor                     > Force killing server, took too long to start or stop

2024-10-25T12:17:43.726479033Z  DEBUG lazymc-docker-proxy::health             > Setting health status to: UNHEALTHY

2024-10-25T12:17:43.727041392Z  ERROR lazymc-docker-proxy::health             > Application is unhealthy.

2024-10-25T12:17:43.731340139Z  WARN  mc::lazymc                              > Failed to force kill server

2024-10-25T12:17:44.209028953Z  INFO  mc::lazymc::monitor                     > Server is now sleeping

Debug logs

@otomay
Copy link

otomay commented Oct 29, 2024

which port your server is really using? like if you are not using lazy-mc, which port you use to connect to your server?

it seems like a port exposing issue

@FurkanVG
Copy link
Author

@otomay you can literally see it in the compose. The image itself needs 25565 but the actual host port is 49152. But that isnt the issue. I had switched to 25565 on all sides and same issue. So its smth else but i guess nobody knows why.

@otomay
Copy link

otomay commented Oct 29, 2024

yeah, I was thinking if had something to do with

- lazymc.server.address=mc:25565

but if you tested with 25565, doesn't seems like it's the issue.

do you server are really able to start in less than 500s? what mc container shows before lazy-mc killing it bc of timeout?

@FurkanVG
Copy link
Author

yes my server starts b4 500s.
mc container just shows all running fine once i do the initial connect. It starts the container fine and everything.

Im thinking its just an issue with the proxy in general that it cant proxy the lazy mc docker proxy to my mc docker. I just cant troubleshoot on my own with real help

@joesturge
Copy link
Owner

Hi @FurkanVG Thanks to @dyd0u we now have this item mapped in the config: lazymc.server.start_timeout It looks like your server may be taking too long to boot for lazymc to handle perhaps, once the new container is released could you try increasing the start timeout?

@joesturge
Copy link
Owner

The version you would want to try with is 2.6.0

@FurkanVG
Copy link
Author

Hey @joesturge
as you see in my yaml config, i already used that timeout command. I have confirmed multiple times that my docker container aka my mc server is up and running b4 the timeout.

Can i provide other logs or anything to help?

@FurkanVG
Copy link
Author

FurkanVG commented Oct 30, 2024

@joesturge on 2.6.0 i get this error now:

image

This makes the mc server docker container INSTANTLY start up without connecting to it.

@FurkanVG
Copy link
Author

I fixed that error (and ensuring that that my mc server docker container doesnt start up instantly) by adding:

- lazymc.join.forward.address=172.58.0.3:25565

this wasnt needed before but now it is mandatory? Testing the connection issue now...

@FurkanVG
Copy link
Author

@joesturge Same issue.

@FurkanVG
Copy link
Author

@joesturge I may have the issue.

Can you explain me how the proxy even works?

This is confusing me

    ports:
      # lazymc-docker-proxy acts as a proxy, so there is
      # no need to expose the server port on the Minecraft container
      - "49152:25565"

Like i get it that we are binding the MC Game Port to the proxy container of lazy mc, but since we are NOT binding the port the minecraft docker, there isnt the port accessible on the actual game server? that may explain my issue, but thats why im confused how this proxy would work.

I enabled TRACE logs and its stuck here:

2024-10-30T19:48:07.101128297Z  TRACE mc::lazymc::monitor                     > Fetching status for 172.58.0.3:25565 ... 

2024-10-30T19:48:07.275650396Z  TRACE mc::lazymc-docker-proxy::command        > Waiting for SIGTERM...

2024-10-30T19:48:08.278595295Z  TRACE mc::lazymc-docker-proxy::command        > Waiting for SIGTERM...

2024-10-30T19:48:09.104345603Z  TRACE mc::lazymc::monitor                     > Fetching status for 172.58.0.3:25565 ... 

2024-10-30T19:48:09.285320168Z  TRACE mc::lazymc-docker-proxy::command        > Waiting for SIGTERM...

2024-10-30T19:48:10.284404922Z  TRACE mc::lazymc-docker-proxy::command        > Waiting for SIGTERM...

2024-10-30T19:48:11.090621212Z  TRACE mc::lazymc::monitor                     > Fetching status for 172.58.0.3:25565 ... 

2024-10-30T19:48:11.280627516Z  TRACE mc::lazymc-docker-proxy::command        > Waiting for SIGTERM...

2024-10-30T19:48:12.280521073Z  TRACE mc::lazymc-docker-proxy::command        > Waiting for SIGTERM...

image

IP is right, but as you see the port doesnt exist on the mc docker server (because you cant bind it).

Am i having a wrong thought?

@joesturge
Copy link
Owner

Hey so it works like so:

Any port you "expose" in docker compose allows connections to that container on that port from outside the docker network.

Lets assume for simplicity sake, you have just a standalone minecraft container deployed, you would run the server on port 25565 and you would have to add a port mapping to the containers docker compose so that you can connect to the container and play minecraft...

However when using lazymc-docker-proxy, you do not have to expose a port on the minecraft container itself, but instead you expose the port on the lazymc container. Containers in the same compose environment can communicate with eachother without having to expose any ports using the ports mapping, this is because both containers share the same network.

So in your situation you have two containers, a mc server running on port 25565 (by the looks of it) and the lazymc container which proxies the mc server. So you have to expose a port on the lazymc container and connect to that.

By setting the lazymc.port=25565 label (which is dont by default if it isnt explicity set) you tell lazymc to run aproxy server on port 25565, by setting the lazymc.server.address=mc:25565 you tell lazymc where to point the server proxy to.

You do need to expose port 25565 on the mc container as lazymc can connect to it as it shares the same network. By setting ports in the ports list, you punch a hole into the docker network from the outside. Hope this helps

@FurkanVG
Copy link
Author

Got it, but then i still dont see my mistake. What can i do or share to find the core issue?

@joesturge joesturge added the question Further information is requested label Oct 30, 2024
@joesturge
Copy link
Owner

@joesturge on 2.6.0 i get this error now:

image

This makes the mc server docker container INSTANTLY start up without connecting to it.

This looks like it could be working to me? can you connect to the game server through lazymc?

@FurkanVG
Copy link
Author

@joesturge on 2.6.0 i get this error now:
image
This makes the mc server docker container INSTANTLY start up without connecting to it.

This looks like it could be working to me? can you connect to the game server through lazymc?

im confused what you mean. I was never able to connect to my minecraft server running the proxy. The issue i had above was that the moment i started my docker compose, lazymc never killed my mc server. But adding

- lazymc.join.forward.address=172.58.0.3:25565 fixed that. But it didnt fix the issue that lazy mc fails to communicate to my docker container, see #134 (comment) . It waits for the timeout and then kills the mc server.

@FurkanVG
Copy link
Author

im trying to make a naked mc enviroment and see, maybe my prod one is breaking smth...

@joesturge
Copy link
Owner

Hey that logline WARN lazymc-docker-proxy::entrypoint::config > Failed to resolve IP address from lazymc.join.forward.address. Falling back to the value provided. is actually a red herring, if you run lazymc in debug mode it prints outs the lazymc config which gets generated. Could you run the app in debug mode by setting

    environment:
      RUST_LOG: debug

on the lazy mc container and attach the full logs here please?

@FurkanVG
Copy link
Author

Hey that logline WARN lazymc-docker-proxy::entrypoint::config > Failed to resolve IP address from lazymc.join.forward.address. Falling back to the value provided. is actually a red herring, if you run lazymc in debug mode it prints outs the lazymc config which gets generated. Could you run the app in debug mode by setting

    environment:
      RUST_LOG: debug

on the lazy mc container and attach the full logs here please?

the error was not there once i added - lazymc.join.forward.address=172.58.0.3:25565

but sure ill add the logs in a bit.

@dyd0u
Copy link

dyd0u commented Oct 30, 2024

I might be responsible for this one. I noticed this warning message since #126.
It is displayed when label lazymc.join.forward.address is not defined, I'll try to fix this later.
This is probably not the root cause of FurkanVG problem.

@FurkanVG, could you please post the result of a docker compose config command ?

@dyd0u
Copy link

dyd0u commented Oct 30, 2024

Could you also try to set lazymc.server.address=minecraft-skyfam:25565 ?

@FurkanVG
Copy link
Author

ok i did a naked config with no plugins mods etc and that worked... it was also a stripped down version of my yaml so there may be smth which furks it up. i will switch back to my prod one and send the infos u guys want

@joesturge
Copy link
Owner

joesturge commented Oct 30, 2024

I think i found the issue as im also experiencing strange behavior on the latest version

@joesturge
Copy link
Owner

Will have a PR soon for a possible fix

@FurkanVG
Copy link
Author

2024-10-30T21:48:53.550626569Z  INFO  lazymc-docker-proxy::entrypoint > Ensuring all server containers are stopped...
2024-10-30T21:48:53.554579981Z  DEBUG bollard::docker                 > unix://2f7661722f72756e2f646f636b65722e736f636b/containers/json?all=true&size=false&filters=%7B%22label%22%3A%5B%22lazymc.enabled%3Dtrue%22%5D%7D
2024-10-30T21:48:53.563460618Z  DEBUG bollard::docker                 > Decoded into string: [{"Id":"f92af1f70488b89e90a889eaeb4308f12aeee20d4996075a1f687ca031bcfc4d","Names":["/minecraft-skyfam"],"Image":"itzg/minecraft-server","ImageID":"sha256:cc4ce0b48141120e20f42af293e950437107f1323dcda0029f4cfa715f35b669","Command":"/start","Created":1730324932,"Ports":[],"Labels":{"com.centurylinklabs.watchtower.enable":"false","com.docker.compose.config-hash":"1c9520a803a56cf4884d2b3446865e4bb75a977a55393f6f1e64ee187036192e","com.docker.compose.container-number":"1","com.docker.compose.depends_on":"","com.docker.compose.image":"sha256:cc4ce0b48141120e20f42af293e950437107f1323dcda0029f4cfa715f35b669","com.docker.compose.oneoff":"False","com.docker.compose.project":"minecraft-skyfam","com.docker.compose.project.config_files":"/data/compose/134/v34/docker-compose.yml","com.docker.compose.project.working_dir":"/data/compose/134/v34","com.docker.compose.service":"mc","com.docker.compose.version":"2.29.2","lazymc.enabled":"true","lazymc.group":"mc","lazymc.join.forward.address":"172.25.0.3:25565","lazymc.server.address":"minecraft-skyfam:25565","lazymc.server.start_timeout":"200","org.opencontainers.image.authors":"Geoff Bourne <[email protected]>","org.opencontainers.image.created":"2024-10-28T12:16:11.257Z","org.opencontainers.image.description":"Docker image that provides a Minecraft Server that will automatically download selected version at startup","org.opencontainers.image.licenses":"Apache-2.0","org.opencontainers.image.ref.name":"ubuntu","org.opencontainers.image.revision":"d33d1e7f69cb21b2ae463a3a0846a08c76e97400","org.opencontainers.image.source":"https://github.com/itzg/docker-minecraft-server","org.opencontainers.image.title":"docker-minecraft-server","org.opencontainers.image.url":"https://github.com/itzg/docker-minecraft-server","org.opencontainers.image.version":"java21"},"State":"created","Status":"Created","HostConfig":{"NetworkMode":"minecraft-skyfam_minecraft-network"},"NetworkSettings":{"Networks":{"minecraft-skyfam_minecraft-network":{"IPAMConfig":{"IPv4Address":"172.25.0.3"},"Links":null,"Aliases":null,"MacAddress":"","DriverOpts":null,"NetworkID":"","EndpointID":"","Gateway":"","IPAddress":"172.25.0.3","IPPrefixLen":0,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"DNSNames":null}}},"Mounts":[{"Type":"volume","Name":"Minecraft-Mods","Source":"/var/lib/docker/volumes/Minecraft-Mods/_data","Destination":"/mods","Driver":"local","Mode":"z","RW":true,"Propagation":""},{"Type":"volume","Name":"Minecraft-Plugins","Source":"/var/lib/docker/volumes/Minecraft-Plugins/_data","Destination":"/plugins","Driver":"local","Mode":"z","RW":true,"Propagation":""},{"Type":"volume","Name":"Minecraft-Data","Source":"/var/lib/docker/volumes/Minecraft-Data/_data","Destination":"/data","Driver":"local","Mode":"z","RW":true,"Propagation":""}]}]
2024-10-30T21:48:53.563598104Z 
2024-10-30T21:48:53.564674333Z  DEBUG lazymc-docker-proxy::docker     > Found 1 container(s) to stop
2024-10-30T21:48:53.569596308Z  DEBUG bollard::docker                 > unix://2f7661722f72756e2f646f636b65722e736f636b/containers/f92af1f70488b89e90a889eaeb4308f12aeee20d4996075a1f687ca031bcfc4d/stop
2024-10-30T21:49:05.376355731Z  DEBUG lazymc-docker-proxy::docker     > Stopped container: f92af1f70488b89e90a889eaeb4308f12aeee20d4996075a1f687ca031bcfc4d
2024-10-30T21:49:05.381844982Z  DEBUG bollard::docker                 > unix://2f7661722f72756e2f646f636b65722e736f636b/containers/json?all=true&size=false&filters=%7B%22label%22%3A%5B%22lazymc.enabled%3Dtrue%22%5D%7D
2024-10-30T21:49:05.389077751Z  DEBUG bollard::docker                 > Decoded into string: [{"Id":"f92af1f70488b89e90a889eaeb4308f12aeee20d4996075a1f687ca031bcfc4d","Names":["/minecraft-skyfam"],"Image":"itzg/minecraft-server","ImageID":"sha256:cc4ce0b48141120e20f42af293e950437107f1323dcda0029f4cfa715f35b669","Command":"/start","Created":1730324932,"Ports":[{"IP":"127.0.0.1","PrivatePort":25565,"PublicPort":25565,"Type":"tcp"},{"IP":"0.0.0.0","PrivatePort":25575,"PublicPort":25575,"Type":"tcp"},{"IP":"::","PrivatePort":25575,"PublicPort":25575,"Type":"tcp"},{"IP":"0.0.0.0","PrivatePort":8100,"PublicPort":8100,"Type":"tcp"},{"IP":"::","PrivatePort":8100,"PublicPort":8100,"Type":"tcp"},{"IP":"0.0.0.0","PrivatePort":8804,"PublicPort":8804,"Type":"tcp"},{"IP":"::","PrivatePort":8804,"PublicPort":8804,"Type":"tcp"}],"Labels":{"com.centurylinklabs.watchtower.enable":"false","com.docker.compose.config-hash":"1c9520a803a56cf4884d2b3446865e4bb75a977a55393f6f1e64ee187036192e","com.docker.compose.container-number":"1","com.docker.compose.depends_on":"","com.docker.compose.image":"sha256:cc4ce0b48141120e20f42af293e950437107f1323dcda0029f4cfa715f35b669","com.docker.compose.oneoff":"False","com.docker.compose.project":"minecraft-skyfam","com.docker.compose.project.config_files":"/data/compose/134/v34/docker-compose.yml","com.docker.compose.project.working_dir":"/data/compose/134/v34","com.docker.compose.service":"mc","com.docker.compose.version":"2.29.2","lazymc.enabled":"true","lazymc.group":"mc","lazymc.join.forward.address":"172.25.0.3:25565","lazymc.server.address":"minecraft-skyfam:25565","lazymc.server.start_timeout":"200","org.opencontainers.image.authors":"Geoff Bourne <[email protected]>","org.opencontainers.image.created":"2024-10-28T12:16:11.257Z","org.opencontainers.image.description":"Docker image that provides a Minecraft Server that will automatically download selected version at startup","org.opencontainers.image.licenses":"Apache-2.0","org.opencontainers.image.ref.name":"ubuntu","org.opencontainers.image.revision":"d33d1e7f69cb21b2ae463a3a0846a08c76e97400","org.opencontainers.image.source":"https://github.com/itzg/docker-minecraft-server","org.opencontainers.image.title":"docker-minecraft-server","org.opencontainers.image.url":"https://github.com/itzg/docker-minecraft-server","org.opencontainers.image.version":"java21"},"State":"running","Status":"Up 12 seconds (healthy)","HostConfig":{"NetworkMode":"minecraft-skyfam_minecraft-network"},"NetworkSettings":{"Networks":{"minecraft-skyfam_minecraft-network":{"IPAMConfig":{"IPv4Address":"172.25.0.3"},"Links":null,"Aliases":null,"MacAddress":"02:42:ac:19:00:03","DriverOpts":null,"NetworkID":"fa0d54038c2e75d861d868f49090d7ca81ca0b7892ee0f21e72936e5c4bc8c4d","EndpointID":"0b83be3956d1973054b6abb5f859c4108e6cfafc155281ca2f81265ed4dcfa14","Gateway":"172.25.0.1","IPAddress":"172.25.0.3","IPPrefixLen":16,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"DNSNames":null}}},"Mounts":[{"Type":"volume","Name":"Minecraft-Data","Source":"/var/lib/docker/volumes/Minecraft-Data/_data","Destination":"/data","Driver":"local","Mode":"z","RW":true,"Propagation":""},{"Type":"volume","Name":"Minecraft-Mods","Source":"/var/lib/docker/volumes/Minecraft-Mods/_data","Destination":"/mods","Driver":"local","Mode":"z","RW":true,"Propagation":""},{"Type":"volume","Name":"Minecraft-Plugins","Source":"/var/lib/docker/volumes/Minecraft-Plugins/_data","Destination":"/plugins","Driver":"local","Mode":"z","RW":true,"Propagation":""}]}]
2024-10-30T21:49:05.389306501Z 
2024-10-30T21:49:05.389636778Z  DEBUG lazymc-docker-proxy::docker     > Found 1 container(s) to get labels
2024-10-30T21:49:05.392786652Z  DEBUG lazymc-docker-proxy::docker     > Resolved address: 172.25.0.3:25565
2024-10-30T21:49:05.394261270Z  DEBUG lazymc-docker-proxy::entrypoint::config > `generated`: lazymc.mc.toml
2024-10-30T21:49:05.394313739Z 
2024-10-30T21:49:05.394330848Z [advanced]
2024-10-30T21:49:05.394345522Z rewrite_server_properties = false
2024-10-30T21:49:05.394359859Z 
2024-10-30T21:49:05.394372299Z [config]
2024-10-30T21:49:05.394384583Z version = "0.2.11"
2024-10-30T21:49:05.394397723Z 
2024-10-30T21:49:05.394409709Z [join.kick]
2024-10-30T21:49:05.394422239Z 
2024-10-30T21:49:05.394434036Z [join.hold]
2024-10-30T21:49:05.394446610Z 
2024-10-30T21:49:05.394458568Z [join.forward]
2024-10-30T21:49:05.394470995Z address = "172.25.0.3:25565"
2024-10-30T21:49:05.394483883Z 
2024-10-30T21:49:05.394495965Z [join.lobby]
2024-10-30T21:49:05.394508289Z 
2024-10-30T21:49:05.394519481Z [lockout]
2024-10-30T21:49:05.394532912Z 
2024-10-30T21:49:05.394547360Z [motd]
2024-10-30T21:49:05.394561638Z 
2024-10-30T21:49:05.394573495Z [public]
2024-10-30T21:49:05.394585562Z address = "0.0.0.0:25565"
2024-10-30T21:49:05.394598212Z 
2024-10-30T21:49:05.394610095Z [server]
2024-10-30T21:49:05.394622145Z address = "172.25.0.3:25565"
2024-10-30T21:49:05.394634751Z command = "lazymc-docker-proxy --command --group mc"
2024-10-30T21:49:05.394648387Z directory = "/server"
2024-10-30T21:49:05.394661266Z freeze_process = false
2024-10-30T21:49:05.394673978Z start_timeout = 200
2024-10-30T21:49:05.394686311Z wake_on_crash = true
2024-10-30T21:49:05.394698812Z wake_on_start = false
2024-10-30T21:49:05.394711153Z 
2024-10-30T21:49:05.394723420Z [time]
2024-10-30T21:49:05.394734896Z 
2024-10-30T21:49:05.394755873Z  INFO  lazymc-docker-proxy::entrypoint         > Starting lazymc process for group: mc...
2024-10-30T21:49:05.396173202Z  INFO  lazymc-docker-proxy::health             > Application is healthy.
2024-10-30T21:49:05.396241649Z  DEBUG lazymc-docker-proxy::health             > Setting health status to: HEALTHY
2024-10-30T21:49:05.406407349Z  INFO  mc::lazymc                              > Proxying public 0.0.0.0:25565 to server 172.25.0.3:25565
2024-10-30T21:49:05.412437236Z  DEBUG mc::lazymc                              > Loaded 0 banned IPs
2024-10-30T21:49:05.413259634Z  DEBUG mc::lazymc                              > Loaded 1 whitelist and 8 OP users
2024-10-30T21:49:20.924938122Z  INFO  mc::lazymc                              > Starting server for 'FurrkanVG'...
2024-10-30T21:49:20.928050496Z  INFO  mc::lazymc-docker-proxy::command        > Received command to start group: mc
2024-10-30T21:49:20.930915220Z  DEBUG mc::lazymc-docker-proxy::docker         > Starting containers...
2024-10-30T21:49:20.933934838Z  DEBUG mc::bollard::docker                     > unix://2f7661722f72756e2f646f636b65722e736f636b/containers/json?all=true&size=false&filters=%7B%22status%22%3A%5B%22exited%22%5D%2C%22label%22%3A%5B%22lazymc.group%3Dmc%22%5D%7D
2024-10-30T21:49:20.937135041Z  DEBUG mc::bollard::docker                     > Decoded into string: [{"Id":"f92af1f70488b89e90a889eaeb4308f12aeee20d4996075a1f687ca031bcfc4d","Names":["/minecraft-skyfam"],"Image":"itzg/minecraft-server","ImageID":"sha256:cc4ce0b48141120e20f42af293e950437107f1323dcda0029f4cfa715f35b669","Command":"/start","Created":1730324932,"Ports":[],"Labels":{"com.centurylinklabs.watchtower.enable":"false","com.docker.compose.config-hash":"1c9520a803a56cf4884d2b3446865e4bb75a977a55393f6f1e64ee187036192e","com.docker.compose.container-number":"1","com.docker.compose.depends_on":"","com.docker.compose.image":"sha256:cc4ce0b48141120e20f42af293e950437107f1323dcda0029f4cfa715f35b669","com.docker.compose.oneoff":"False","com.docker.compose.project":"minecraft-skyfam","com.docker.compose.project.config_files":"/data/compose/134/v34/docker-compose.yml","com.docker.compose.project.working_dir":"/data/compose/134/v34","com.docker.compose.service":"mc","com.docker.compose.version":"2.29.2","lazymc.enabled":"true","lazymc.group":"mc","lazymc.join.forward.address":"172.25.0.3:25565","lazymc.server.address":"minecraft-skyfam:25565","lazymc.server.start_timeout":"200","org.opencontainers.image.authors":"Geoff Bourne <[email protected]>","org.opencontainers.image.created":"2024-10-28T12:16:11.257Z","org.opencontainers.image.description":"Docker image that provides a Minecraft Server that will automatically download selected version at startup","org.opencontainers.image.licenses":"Apache-2.0","org.opencontainers.image.ref.name":"ubuntu","org.opencontainers.image.revision":"d33d1e7f69cb21b2ae463a3a0846a08c76e97400","org.opencontainers.image.source":"https://github.com/itzg/docker-minecraft-server","org.opencontainers.image.title":"docker-minecraft-server","org.opencontainers.image.url":"https://github.com/itzg/docker-minecraft-server","org.opencontainers.image.version":"java21"},"State":"exited","Status":"Exited (137) 17 seconds ago","HostConfig":{"NetworkMode":"minecraft-skyfam_minecraft-network"},"NetworkSettings":{"Networks":{"minecraft-skyfam_minecraft-network":{"IPAMConfig":{"IPv4Address":"172.25.0.3"},"Links":null,"Aliases":null,"MacAddress":"","DriverOpts":null,"NetworkID":"fa0d54038c2e75d861d868f49090d7ca81ca0b7892ee0f21e72936e5c4bc8c4d","EndpointID":"","Gateway":"","IPAddress":"","IPPrefixLen":0,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"DNSNames":null}}},"Mounts":[{"Type":"volume","Name":"Minecraft-Mods","Source":"/var/lib/docker/volumes/Minecraft-Mods/_data","Destination":"/mods","Driver":"local","Mode":"z","RW":true,"Propagation":""},{"Type":"volume","Name":"Minecraft-Plugins","Source":"/var/lib/docker/volumes/Minecraft-Plugins/_data","Destination":"/plugins","Driver":"local","Mode":"z","RW":true,"Propagation":""},{"Type":"volume","Name":"Minecraft-Data","Source":"/var/lib/docker/volumes/Minecraft-Data/_data","Destination":"/data","Driver":"local","Mode":"z","RW":true,"Propagation":""}]}]
2024-10-30T21:49:20.945373749Z  DEBUG mc::lazymc-docker-proxy::docker         > Found 1 container(s) to start
2024-10-30T21:49:20.951396985Z  INFO  mc::lazymc-docker-proxy::docker         > Starting container: /minecraft-skyfam
2024-10-30T21:49:20.951881595Z  DEBUG mc::bollard::docker                     > unix://2f7661722f72756e2f646f636b65722e736f636b/containers/f92af1f70488b89e90a889eaeb4308f12aeee20d4996075a1f687ca031bcfc4d/start
2024-10-30T21:49:44.552012007Z  DEBUG mc::lazymc                              > Loaded 1 whitelist and 8 OP users
2024-10-30T21:49:45.927002532Z  WARN  mc::lazymc                              > Held client reached timeout of 25s
2024-10-30T21:49:56.905414778Z  DEBUG mc::lazymc                              > Loaded 1 whitelist and 8 OP users
2024-10-30T21:50:03.269692681Z  DEBUG mc::lazymc                              > Loaded 1 whitelist and 8 OP users
2024-10-30T21:50:38.782730700Z  DEBUG mc::lazymc                              > Loaded 1 whitelist and 8 OP users
2024-10-30T21:50:56.321076006Z  DEBUG mc::lazymc                              > Loaded 0 banned IPs
2024-10-30T21:50:56.327070398Z  DEBUG mc::lazymc                              > Loaded 1 whitelist and 8 OP users
2024-10-30T21:52:41.536076139Z  ERROR mc::lazymc::monitor                     > Force killing server, took too long to start or stop
2024-10-30T21:52:41.536157434Z  DEBUG lazymc-docker-proxy::health             > Setting health status to: UNHEALTHY
2024-10-30T21:52:41.540726341Z  ERROR lazymc-docker-proxy::health             > Application is unhealthy.
2024-10-30T21:52:41.548939899Z  WARN  mc::lazymc                              > Server process stopped with error code (signal: 9 (SIGKILL))
2024-10-30T21:52:43.529517164Z  ERROR mc::lazymc::monitor                     > Force killing server, took too long to start or stop
2024-10-30T21:52:43.529602634Z  DEBUG lazymc-docker-proxy::health             > Setting health status to: UNHEALTHY
2024-10-30T21:52:43.530316818Z  ERROR lazymc-docker-proxy::health             > Application is unhealthy.
2024-10-30T21:52:43.534281266Z  WARN  mc::lazymc                              > Failed to force kill server
2024-10-30T21:52:44.038448632Z  INFO  mc::lazymc::monitor                     > Server is now sleeping
2024-10-30T21:53:25.239809752Z  INFO  mc::lazymc                              > Starting server for 'FurrkanVG'...
2024-10-30T21:53:25.243604592Z  INFO  mc::lazymc-docker-proxy::command        > Received command to start group: mc
2024-10-30T21:53:25.245946654Z  DEBUG mc::lazymc-docker-proxy::docker         > Starting containers...
2024-10-30T21:53:25.248543537Z  DEBUG mc::bollard::docker                     > unix://2f7661722f72756e2f646f636b65722e736f636b/containers/json?all=true&size=false&filters=%7B%22status%22%3A%5B%22exited%22%5D%2C%22label%22%3A%5B%22lazymc.group%3Dmc%22%5D%7D
2024-10-30T21:53:25.250898824Z  DEBUG mc::bollard::docker                     > Decoded into string: []
2024-10-30T21:53:25.254735535Z  DEBUG mc::lazymc-docker-proxy::docker         > Found 0 container(s) to start
2024-10-30T21:53:50.245328869Z  WARN  mc::lazymc                              > Held client reached timeout of 25s

The Log with DEBUG

@dyd0u
Copy link

dyd0u commented Oct 30, 2024

Could you also provide logs of you mc container ? So we can see what happens on its side, if it is really starting in time.

@FurkanVG
Copy link
Author

Could you also provide logs of you mc container ? So we can see what happens on its side, if it is really starting in time.

ugh, the logs are crazy on the main server because i have lots of plugins and may show too many infos.

Relevant log times:

2024-10-30T21:50:01.432646463Z [init] 2024-10-30 22:50:01+01:00 Starting the Minecraft server...

2024-10-30T21:50:05.489166688Z Starting org.bukkit.craftbukkit.Main

2024-10-30T21:50:09.470411390Z [22:50:09 INFO]: [bootstrap] Running Java 21 (OpenJDK 64-Bit Server VM 21.0.5+11-LTS; Eclipse Adoptium Temurin-21.0.5+11) on Linux 6.8.0-47-generic (amd64)

2024-10-30T21:50:09.472157633Z [22:50:09 INFO]: [bootstrap] Loading Paper 1.21.1-130-ver/1.21.1@4d2672e (2024-10-30T18:33:50Z) for Minecraft 1.21.1

2024-10-30T21:50:10.356695891Z [22:50:10 INFO]: [PluginInitializerManager] Initializing plugins...

And final part of logs loading plugins and server being up:


2024-10-30T21:51:42.625958041Z >....
[22:51:42 INFO]: [ViaVersion] Finished mapping loading, shutting down loader executor.

2024-10-30T21:51:43.144572169Z >....
[22:51:43 INFO]: Done (97.566s)! For help, type "help"

2024-10-30T21:51:43.158309276Z >....
[22:51:43 INFO]: [Plan] You're using the latest version.

2024-10-30T21:51:43.182934256Z >....
[22:51:43 INFO]: Timings Reset

2024-10-30T21:51:48.124594733Z >....
[22:51:48 INFO]: Thread RCON Client /0:0:0:0:0:0:0:1 started

2024-10-30T21:51:48.804351308Z >....
[22:51:48 INFO]: Thread RCON Client /0:0:0:0:0:0:0:1 shutting down

2024-10-30T21:51:49.893641548Z >....
[22:51:49 INFO]: Thread RCON Client /0:0:0:0:0:0:0:1 started

2024-10-30T21:51:50.000576048Z >....
[22:51:49 INFO]: Thread RCON Client /0:0:0:0:0:0:0:1 shutting down

@dyd0u
Copy link

dyd0u commented Oct 30, 2024

Which port is your mc server listening on ?
Line Starting Minecraft server on *:25565 in logs should tell you.

@joesturge
Copy link
Owner

I Have a fix for the server starting when it shouldnt here: #140

@FurkanVG
Copy link
Author

"Starting Minecraft server on *:25565" - like always

@FurkanVG
Copy link
Author

ok update, i removed all my plugins on my prod server, and now it works lol. so it must be a plugin breaking it

@FurkanVG
Copy link
Author

ill add slowly each plugin and update.

@joesturge
Copy link
Owner

ill add slowly each plugin and update.

intresting, let us know which one break it, I also think once that PR is released it will help you too

@FurkanVG
Copy link
Author

Your PR is about the issue that if - lazymc.join.forward.address=172.58.0.3:25565 isnt set that the server auto starts. I fixed that but i will update

@joesturge
Copy link
Owner

joesturge commented Oct 30, 2024

Your PR is about the issue that if - lazymc.join.forward.address=172.58.0.3:25565 isnt set that the server auto starts. I fixed that but i will update

This project works by generating bespoke configs for lazymc, kinda hacked to work with docker. I think Your issue may be related, if the config is borked, it could have unexpected side effects, such as what you are experiencing

@joesturge
Copy link
Owner

Hi could you try now with version 2.6.1 now? It works again for my stack can confirm

@joesturge
Copy link
Owner

just for reference this is what the logs should look like when starting (I have it running with 4 servers):

 INFO  lazymc-docker-proxy::entrypoint > Ensuring all server containers are stopped...
 INFO  lazymc-docker-proxy::entrypoint > Starting lazymc process for group: vanilla...
 INFO  lazymc-docker-proxy::entrypoint > Starting lazymc process for group: forge...
 INFO  lazymc-docker-proxy::entrypoint > Starting lazymc process for group: deez...
 INFO  lazymc-docker-proxy::entrypoint > Starting lazymc process for group: castle...
 INFO  lazymc-docker-proxy::health     > Application is healthy.
 INFO  vanilla::lazymc                 > Proxying public 0.0.0.0:25565 to server 172.22.0.5:25565
 INFO  forge::lazymc                   > Proxying public 0.0.0.0:25566 to server 172.22.0.6:25565
 INFO  deez::lazymc                    > Proxying public 0.0.0.0:25568 to server 172.22.0.8:25565
 INFO  castle::lazymc                  > Proxying public 0.0.0.0:25567 to server 172.22.0.7:25565

@FurkanVG
Copy link
Author

To sum it up:

@joesturge BEFORE 2.6.0, I did NOT USE lazymc.join.forward.address=172.58.0.3:25565 as label because it was not mandatory.
Then on 2.6.0, it WAS mandatory. If you did NOT use that label, the issue had happend that my MC server had always auto started. I had "fixed" this for 2.6.0 by just using configuring and using the label lazymc.join.forward.address=172.58.0.3:25565. That fixed the error and my mc server did NOT autostart anymore. This issue is NOT Related to the inital issue i had created here, but i just wanted to sum it up to avoid some confusion :)

Now, to the initial issue, where i was never able to connect to my minecraft server with this lazymc proxy.

Issue is found! It looks like the Plugin https://hangar.papermc.io/jmp/MiniMOTD is NOT allowing the LAZY MC Docker Proxy to do the final process. I guess this has to do because Lazy MC itself is trying to show some MOTD and this created a conflict which then avoided the proxy to be fully initalized. My knowledge ends here to find out WHY this happens, but i can confirm to 100% that lazy mc is not compatible. I have tested this by adding all plugins each by each and then found out that MINITMOTD was causing the issue. All of my other plugins are successfully loaded and its working with this. This was done successfully ON 2.6.0 AND i also tested it now successfully also on 2.6.1!

@FurkanVG
Copy link
Author

I see performance issues with this sadly, but that is smth else i may analyze later. If you dont have anything more to add @joesturge or you think its not worth to investigate the conflict wiht MiniMOTD, this issue can be closed.
Thanks for helping.

@joesturge
Copy link
Owner

To sum it up:

@joesturge BEFORE 2.6.0, I did NOT USE lazymc.join.forward.address=172.58.0.3:25565 as label because it was not mandatory. Then on 2.6.0, it WAS mandatory. If you did NOT use that label, the issue had happend that my MC server had always auto started. I had "fixed" this for 2.6.0 by just using configuring and using the label lazymc.join.forward.address=172.58.0.3:25565. That fixed the error and my mc server did NOT autostart anymore. This issue is NOT Related to the inital issue i had created here, but i just wanted to sum it up to avoid some confusion :)

Now, to the initial issue, where i was never able to connect to my minecraft server with this lazymc proxy.

Issue is found! It looks like the Plugin https://hangar.papermc.io/jmp/MiniMOTD is NOT allowing the LAZY MC Docker Proxy to do the final process. I guess this has to do because Lazy MC itself is trying to show some MOTD and this created a conflict which then avoided the proxy to be fully initalized. My knowledge ends here to find out WHY this happens, but i can confirm to 100% that lazy mc is not compatible. I have tested this by adding all plugins each by each and then found out that MINITMOTD was causing the issue. All of my other plugins are successfully loaded and its working with this. This was done successfully ON 2.6.0 AND i also tested it now successfully also on 2.6.1!

ooo thats a good find, good job on locating it. Glad it works on 2.6.1 without that plugin. Ill add a section to the readme about plugins which affect the MOTD suggesting not to use them for now. There is another open issue about MOTD configurations here: #98

Dont know if that would also be similar to your use case?

@FurkanVG
Copy link
Author

To sum it up:
@joesturge BEFORE 2.6.0, I did NOT USE lazymc.join.forward.address=172.58.0.3:25565 as label because it was not mandatory. Then on 2.6.0, it WAS mandatory. If you did NOT use that label, the issue had happend that my MC server had always auto started. I had "fixed" this for 2.6.0 by just using configuring and using the label lazymc.join.forward.address=172.58.0.3:25565. That fixed the error and my mc server did NOT autostart anymore. This issue is NOT Related to the inital issue i had created here, but i just wanted to sum it up to avoid some confusion :)
Now, to the initial issue, where i was never able to connect to my minecraft server with this lazymc proxy.
Issue is found! It looks like the Plugin https://hangar.papermc.io/jmp/MiniMOTD is NOT allowing the LAZY MC Docker Proxy to do the final process. I guess this has to do because Lazy MC itself is trying to show some MOTD and this created a conflict which then avoided the proxy to be fully initalized. My knowledge ends here to find out WHY this happens, but i can confirm to 100% that lazy mc is not compatible. I have tested this by adding all plugins each by each and then found out that MINITMOTD was causing the issue. All of my other plugins are successfully loaded and its working with this. This was done successfully ON 2.6.0 AND i also tested it now successfully also on 2.6.1!

ooo thats a good find, good job on locating it. Glad it works on 2.6.1 without that plugin. Ill add a section to the readme about plugins which affect the MOTD suggesting not to use them for now. There is another open issue about MOTD configurations here: #98

Dont know if that would also be similar to your use case?

Dont think its the same case. I was using a specific plugin that handles MOTD, the guy didnt try it from my understanding.

@FurkanVG
Copy link
Author

Also anything on this?
image

What does this mean?

@joesturge
Copy link
Owner

Also anything on this? image

What does this mean?

This issue has also been experienced by someone else here: #135

@FurkanVG
Copy link
Author

Hmm, but the incompatible messsage is coming from your MOTD, no? Because i never had this before without your Proxy.

@joesturge
Copy link
Owner

Could you contribute to that issue i linked about this? I think its the same problem

@FurkanVG
Copy link
Author

yea np

@joesturge
Copy link
Owner

I also created a new issue here for the MOTD plugin issue: #142

Could you add any relavent detail to that if i missed anything please, in the meantime i think i can close this issue if you are happy?

@FurkanVG
Copy link
Author

Yeah i will close this issue, thanks for helping :) I will add some infos on both issues you mentioned!

@joesturge
Copy link
Owner

joesturge commented Oct 30, 2024

Yeah i will close this issue, thanks for helping :) I will add some infos on both issues you mentioned!

Thanks for the help with this 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants