docker-minecraft-server icon indicating copy to clipboard operation
docker-minecraft-server copied to clipboard

an internet connection is required to restart the server

Open uhthomas opened this issue 1 year ago • 5 comments

Describe the problem

It looks like the container was restarted, and rather than coming back as expected it failed to start as there was no connection to the internet. I would expect this behaviour for first start, but if the server and mods are already downloaded, why should a lack of internet connection prevent the server from starting?

Container definition

https://github.com/uhthomas/automata/blob/60fd02f4c0a34fe99e3b8d707cee5a46436ba55d/k8s/unwind/minecraft/cf_atm8/stateful_set_list.cue

Container logs

- minecraft-cf-atm8-0 › minecraft-server
+ minecraft-cf-atm8-0 › minecraft-server
minecraft-cf-atm8-0 minecraft-server chmod: changing permissions of '/data': Operation not permitted
minecraft-cf-atm8-0 minecraft-server [init] Running as uid=1000 gid=3000 with /data as 'drwxrwsr-x 22 0 2000 4096 Jun  3 20:04 /data'
minecraft-cf-atm8-0 minecraft-server [mc-image-helper] 11:28:12.166 ERROR : 'get' command failed. Version is 1.29.1
minecraft-cf-atm8-0 minecraft-server java.net.UnknownHostException: launchermeta.mojang.com: Temporary failure in name resolution
minecraft-cf-atm8-0 minecraft-server    at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
minecraft-cf-atm8-0 minecraft-server    at java.base/java.net.InetAddress$PlatformNameService.lookupAllHostAddr(Unknown Source)
minecraft-cf-atm8-0 minecraft-server    at java.base/java.net.InetAddress.getAddressesFromNameService(Unknown Source)
minecraft-cf-atm8-0 minecraft-server    at java.base/java.net.InetAddress$NameServiceAddresses.get(Unknown Source)
minecraft-cf-atm8-0 minecraft-server    at java.base/java.net.InetAddress.getAllByName0(Unknown Source)
minecraft-cf-atm8-0 minecraft-server    at java.base/java.net.InetAddress.getAllByName(Unknown Source)
minecraft-cf-atm8-0 minecraft-server    at java.base/java.net.InetAddress.getAllByName(Unknown Source)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:43)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:447)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint(InternalExecRuntime.java:162)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint(InternalExecRuntime.java:172)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.impl.classic.ConnectExec.execute(ConnectExec.java:142)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ProtocolExec.java:192)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute(HttpRequestRetryExec.java:96)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute(ContentCompressionExec.java:152)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:115)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
minecraft-cf-atm8-0 minecraft-server    at me.itzg.helpers.http.LatchingUrisInterceptor.execute(LatchingUrisInterceptor.java:27)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:170)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:245)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:188)
minecraft-cf-atm8-0 minecraft-server    at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:162)
minecraft-cf-atm8-0 minecraft-server    at me.itzg.helpers.get.GetCommand.processSingleUri(GetCommand.java:439)
minecraft-cf-atm8-0 minecraft-server    at me.itzg.helpers.get.GetCommand.call(GetCommand.java:187)
minecraft-cf-atm8-0 minecraft-server    at me.itzg.helpers.get.GetCommand.call(GetCommand.java:54)
minecraft-cf-atm8-0 minecraft-server    at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
minecraft-cf-atm8-0 minecraft-server    at picocli.CommandLine.access$1500(CommandLine.java:148)
minecraft-cf-atm8-0 minecraft-server    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
minecraft-cf-atm8-0 minecraft-server    at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
minecraft-cf-atm8-0 minecraft-server    at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
minecraft-cf-atm8-0 minecraft-server    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
minecraft-cf-atm8-0 minecraft-server    at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
minecraft-cf-atm8-0 minecraft-server    at picocli.CommandLine.execute(CommandLine.java:2170)
minecraft-cf-atm8-0 minecraft-server    at me.itzg.helpers.McImageHelper.main(McImageHelper.java:139)
minecraft-cf-atm8-0 minecraft-server [init] ERROR: version lookup failed:

uhthomas avatar Jun 04 '23 11:06 uhthomas

I can probably fix that particular spot, but there's probably 20 steps after that that assume basic network connectivity.

itzg avatar Jun 04 '23 13:06 itzg

Actually, the linked PR probably doesn't fully resolve this.

itzg avatar Jun 08 '23 13:06 itzg

Just realized this and would appreciate it for full lan experience by being able to shut the Internet connection from the container.

NernKat avatar Dec 03 '23 03:12 NernKat

Thank you very much for providing this! I've been slow on picking up exactly how to work much with Docker, and your Portainer image has been of great service to me and joy to my children. I'm commenting to second the desire to make this something that can be run entirely offline. My internet was out this morning, and when trying to start the server on my Asustor NAS, the log kept hanging on something about connecting to Bukkit for some jar file that was already available where the server runs from. I don't know that the problem was Bukkit specifically, I didn't have the time to set it back to being a normal server (nor the courage to fix something that normally isn't broken), but I found this issue when looking into possible solutions.

jamescmeyer avatar Dec 05 '23 17:12 jamescmeyer

I can put more effort into optimizing the download operations to skip existing, non-ambiguous (aka not "latest") types and versions; however, keep in mind that the Minecraft server itself will want to verify connecting users via Microsoft/Mojang's authentication system. So, honestly I don't feel highly motivated to provide a network-free solution when we're at the mercy of external software ultimately. Even more so, I am not inclined to put much further effort into Bukkit/Spigot support specifically since the builds provider, getbukkit.org, has had numerous stability issues lately

image

Please consider using PaperPC instead, which is plugin compatible and has robust support. Furthermore, the download of PaperMC has already been optimized to avoid download/lookup when an exact version is specified.

P.S. sorry for the ranting and whining, but just wanted to be fully transparent.

itzg avatar Dec 05 '23 17:12 itzg