pterodactyl / panel

Pterodactyl® is a free, open-source game server management panel built with PHP, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
https://pterodactyl.io
Other
6.57k stars 1.64k forks source link

Minecraft Forge server not reading stdin #3417

Closed Mayzie closed 3 years ago

Mayzie commented 3 years ago

Description Note: I am unsure if this is a wings bug, or the issue lies elsewhere.

Minecraft Forge server does not seem to accept stdin. Interesting to note that this issue does not occur using Vanilla Minecraft (hence why unsure if this is a relevant bug). Best way to reproduce is to attempt to set up and install the latest All The Mods 6 modpack, which utilises this tool: https://github.com/BloodyMods/ServerStarter. Changing the startup script to launch serverstarter*.jar instead does not fix the issue, nor does changing the startup script to launch forge-*.jar. Attaching myself to the docker container, I get the same issue as wings.

$ uname -a
Linux ... 5.4.0-74-generic #83-Ubuntu SMP Sat May 8 02:35:39 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
  scan: Docker Scan (Docker Inc., v0.8.0)

Server:
 Containers: 2
  Running: 0
  Paused: 0
  Stopped: 2
 Images: 8
 Server Version: 20.10.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2 io.containerd.runtime.v1.linux
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: d71fcd7d8303cbf684402823e425e9dd2e99285d
 runc version: b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.4.0-74-generic
 Operating System: Ubuntu 20.04.2 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 31.15GiB
 Name: ...
 ID: ...
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support

To Reproduce Steps to reproduce this behavior:

  1. Install this egg: https://github.com/parkervcp/eggs/tree/master/minecraft/java/forge/curseforge-generic
  2. Create a new server using the above egg with Project ID 381671, version set to latest, and container set to Java <16. The install will fail as it's using the above server starter tool. The egg will also pull an out of date version. To fix this: a. Download the latest "SIMPLE SERVER FILES" zip from CurseForge. b. Upload the server-setup-config.yaml file from that archive to your Pterodactyl server, overwriting the existing one.
  3. Change server startup command to sh ./startserver.sh.
  4. Run the server, let setup. An error will again, occur. This is due to an invalid server.properties file created from the egg. a. Kill server. b. Replace contents of server.properties with the default found on the Minecraft wiki.
  5. Start server again, it will launch, and will accept no stdin.

Bit complicated, I know. But I'm not a Minecraft person.

Expected behavior For stdin to work. As it is, unable to gracefully stop the server from the panel.

It must be receiving stdin, as I can attach to the container and pressing Ctrl + \ will dump JVM contents. Is it a threading issue or something? I don't imagine this occurs locally (unable to test).

Thank you!

parkervcp commented 3 years ago

The reason is not working is that's is a script in between the console and the server.

Whatever the "server starter" till is it's breaking things.

This is why I haven't been touching the curseforge egg.

parkervcp commented 3 years ago

As I stated before. If you fix it I would accept the PR to my egg repo.

This is not a pterodactyl issue but a server setup issue.

Parse the yml and do a proper install.

dgfl-gh commented 3 years ago

I went more or less through the same steps as @Mayzie, but instead modified the egg install script to launch server starter script. It didn't work perfectly (it got stuck in the "installing" state due to EULA and not being able to send commands), but it downloaded the right files and I was eventually able to get it to work.

SOLUTION(S):