itzg / mc-image-helper

This tool does the complicated bits for the itzg/minecraft-server image
MIT License
54 stars 23 forks source link

When there is no internet the service can't start #458

Open Carlosgrr opened 1 month ago

Carlosgrr commented 1 month ago

When I don't have an active internet connection, specialy when my server is restarting and the internet connection has not yet started, I am getting these errors in all minecraft servers.

I believe that if the internet connection is not availabe the service should start normaly, instead of just printing those errors until an internet connection is found, or another idea would be to expose that option so that I can configure it, but not allowing the service to start until the internet is restored should not be the default behavior.

[mc-image-helper] 04:29:59.619 ERROR : 'get' command failed. Version is 1.39.8
velocity  | java.net.UnknownHostException: papermc.io: Temporary failure in name resolution
velocity  |     at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
velocity  |     at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Unknown Source)
velocity  |     at java.base/java.net.InetAddress$PlatformResolver.lookupByName(Unknown Source)
velocity  |     at java.base/java.net.InetAddress.getAddressesFromNameService(Unknown Source)
velocity  |     at java.base/java.net.InetAddress$NameServiceAddresses.get(Unknown Source)
velocity  |     at java.base/java.net.InetAddress.getAllByName0(Unknown Source)
velocity  |     at java.base/java.net.InetAddress.getAllByName(Unknown Source)
velocity  |     at org.apache.hc.client5.http.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
velocity  |     at org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:144)
velocity  |     at org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:450)
velocity  |     at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint(InternalExecRuntime.java:162)
velocity  |     at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint(InternalExecRuntime.java:172)
velocity  |     at org.apache.hc.client5.http.impl.classic.ConnectExec.execute(ConnectExec.java:142)
velocity  |     at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
velocity  |     at org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ProtocolExec.java:192)
velocity  |     at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
velocity  |     at org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute(HttpRequestRetryExec.java:113)
velocity  |     at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
velocity  |     at org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute(ContentCompressionExec.java:152)
velocity  |     at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
velocity  |     at org.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:116)
velocity  |     at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
velocity  |     at me.itzg.helpers.http.LatchingUrisInterceptor.execute(LatchingUrisInterceptor.java:27)
velocity  |     at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
velocity  |     at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:170)
velocity  |     at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:245)
velocity  |     at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:188)
velocity  |     at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:162)
velocity  |     at me.itzg.helpers.get.GetCommand.processSingleUri(GetCommand.java:440)
velocity  |     at me.itzg.helpers.get.GetCommand.call(GetCommand.java:188)
velocity  |     at me.itzg.helpers.get.GetCommand.call(GetCommand.java:55)
velocity  |     at picocli.CommandLine.executeUserObject(CommandLine.java:2045)
velocity  |     at picocli.CommandLine.access$1500(CommandLine.java:148)
velocity  |     at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2465)
velocity  |     at picocli.CommandLine$RunLast.handle(CommandLine.java:2457)
velocity  |     at picocli.CommandLine$RunLast.handle(CommandLine.java:2419)
velocity  |     at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
velocity  |     at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
velocity  |     at picocli.CommandLine.execute(CommandLine.java:2174)
velocity  |     at me.itzg.helpers.McImageHelper.main(McImageHelper.java:159)
velocity  | ERROR: failed to lookup PaperMC versions
itzg commented 1 month ago

It's a reasonable request but there are numerous things during startup, even the Minecraft server itself, that assume at least limited network availability.

I'll leave this open for consideration, but it is likely never going to be implemented.