TheRemote/Legendary-Java-Minecraft-Geyser-Floodgate

Geyser-Spigot network listening port is not changing

vecnar opened this issue · 7 comments

Hi James,

Thank you for creating a docker that combines all the necessary plugins together to make all minecraft editions to be able to join! Haven't tested much yet as i am new to minecraft and only want to have ability to play with daughter on her nintendo switch and my windows7 computer java edition. It looks like i will have to update to windows 10 as only version 1.16.1 is supported on windows 7 and geyser plugins and other are not.

Back to the issue, I would like to stay away from default network ports and defined network ports as per your environment variable using docker compose. I am able to connect when using default ports but not if i use different ones.
`legendary-minecraft-geyser-floodgate:
image: 05jchambers/legendary-minecraft-geyser-floodgate:latest
container_name: minecraft

ports:
    - "45565:45565"
    - "49132:49132/udp"
    - "49132:49132"

environment:
    Port: "45565"
    BedrockPort: "49132"
    MaxMemory: "1024"
    NoScreen: "Y"
    EULA: "TRUE"

restart: always

volumes:
    - /docker/minecraft/.minecraft-data:/minecraft

`
I can see that plugins/Geyser-Spigot/config.yml port is defined as I entered 49132, I also noticed in the log "Your Geyser config is out of date! Please regenerate your config when possible." , removing it, restarting docker, changing port and restarting docker didn't help either, still showing "Started Geyser on 0.0.0.0:19132".
Docker logs attached dockerLogs.txt

Thank you,
Oleg

Hey vecnar,

Thanks for reporting this. I found the problem and just pushed a fix. Can you do a:

docker pull 05jchambers/legendary-minecraft-geyser-floodgate:latest

and try running again here? If it's still complaining about config.yml try removing the config.yml from the folder so it regenerates a fresh one (or alternatively try using a fresh/new volume as a test) and let me know if that takes care of it for you!

Hey James,
Thank you for quick response and the change.

I tried using old volume and new one but i still see in the logs Started Geyser on 0.0.0.0:19132
I am using detach mode as i want docker to be running whenever device is on, docker-compose up -d or docker run -d . I tried docker interactive mode just in case there is any difference but no changes.
dockerLogs2808Clean.txt

I think whatever the change you made is working now as I see Started Geyser on 0.0.0.0:49132 but only after editing config.yml manually after stopping docker, editing config.yml and starting for second time.
dockerLogs2808AfterEditingConfig.yml.txt

Let me know if there is anything else you would like me to test.

P.S. I also see that memory limit is not set when I execute command docker stats, not sure if it is just raspberry pi issue or general as I had to add cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 to /boot/cmdline.txt and restart for it to show anything. Or maybe it is a limit for minecraft process and the docker you refer to as -e MaxMemory=2048, it is not important to me but something I just noticed.

Hey vecnar,

Thanks for testing this fix. I think what is happening is that the first time it is ran it's not changing it because when it tries to change it the file doesn't exist yet. I probably just need to add a default template to the project to fix this. That way when it runs for the first time it will already have the copied default template to fix the port in.

I already had to do something similar with server.properties so this makes sense. The container is just so new that this hadn't come up much yet so I definitely appreciate you reporting this! I'm uploading a new version that has a default config.yml and will copy it if it's not present (which should make the port replacement operation from the environment variable work).

I think this is all set but if you wouldn't mind testing this just to double check my work and make sure I didn't miss anything else it would be appreciated. Thanks again!

Thank you for providing the fix, just tested clean install and can see in the logs that it is working, also tested it with a nintendo switch. It is understandable that new docker will be having many small problems/changes, many users will be able to report it to you once more start using it.

Apologies for editing my previous comment after your reply. Would you like me to open it as a separate issue/question?

P.S. I also see that memory limit is not set when I execute command docker stats, not sure if it is just raspberry pi issue or general as I had to add cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 to /boot/cmdline.txt and restart for it to show anything. Or maybe it is a limit for minecraft process and the docker you refer to as -e MaxMemory=2048, it is not important to me but something I just noticed.
dockerLogsWorking.txt

Hey vecnar,

Great question! So that number is basically passed to Java when the Minecraft server is started. The exact startup looks like this:

/jre/bin/java -XX:+UnlockDiagnosticVMOptions -XX:-UseAESCTRIntrinsics -DPaper.IgnoreJavaVersion=true -Xms400M -Xmx${MaxMemory}M -jar /minecraft/paperclip.jar

In other words it's not the Docker memory limit that is set here. I actually didn't even consider the Docker memory limit although that is an interesting idea.

Theoretically the way it works now it could use more than the memory limit since that memory limit is for Java. That wouldn't take into account how much memory the container itself is using and the Docker process, etc. which the Docker limit you're referring to would take that into account.

That is definitely an interesting idea though for the documentation. If it doesn't cause any major problems or crashes during testing I could add how to use the Docker memory limit or somehow integrate it potentially somehow down the line here somewhere. Hopefully that explains that piece!

Thank you for a detailed explanation James!
I have many dockers running on NAS and only a few were causing memory problems for me from time to time so I implemented memory limit (different for each docker) --memory "500m" --memory-swap "500m" to offenders when passing to docker -d command in order to prevent host going down. I am not sure If there was a need to define both but it worked for me, now when using docker compose and not specifying version in docker-compose.yaml mem_limit: "1400m" works but version 2 and 3 have different parameters for it.
I am sure it can be looked when or if there will be a problem.
Thanks again for all the help!

You're very welcome! Thanks again for reporting this. Thanks for letting me know the Docker memory limit investigation. You're right that it's not an emergency right now but I definitely do try to plan out features like this and I know I would like to include some integration or documentation on using the Docker memory limits as well.

Enjoy and take care!