Polymer

Polymer

763k Downloads

Autohost not working with Proxy (Velocity)

ZewZack opened this issue ยท 7 comments

commented

hello. I was using the mod without any problem. Currently, I'm on 1.21 Fabric and Velocity proxy (both on localhost). I set custom port setup on here https://polymer.pb4.eu/latest/user/resource-pack-hosting/

velocity directs to survival server like:

server.net:25565 -> localhost:25577

new clients said they can confirm the resource pack prompt but can never enter the game. It stucks on "Joining World"

Also I see this error whenever I close the server:

stop
[21:16:34 INFO] [Server thread]: [DedicatedServer] Stopping the server
[21:16:34 INFO] [Server thread]: [BlueMap] BlueMap unloaded!
[21:16:34 INFO] [Server thread]: [luckperms] Starting shutdown process...
[21:16:34 INFO] [Server thread]: [luckperms] Closing storage...
[21:16:34 INFO] [Server thread]: [luckperms] Goodbye!
[21:16:34 INFO] [Server thread]: [mcwebserver] Stopping Webserver...
[21:16:34 INFO] [Server thread]: [MinecraftServer] Stopping server
[21:16:34 INFO] [Server thread]: [MinecraftServer] Saving players
[21:16:34 INFO] [Server thread]: [MinecraftServer] Saving worlds
[21:16:34 INFO] [Server thread]: [MinecraftServer] Saving chunks for level 'ServerLevel[world]'/minecraft:overworld
[21:16:34 INFO] [Server thread]: [MinecraftServer] Saving chunks for level 'ServerLevel[world]'/minecraft:the_end
[21:16:34 INFO] [Server thread]: [MinecraftServer] Saving chunks for level 'ServerLevel[world]'/minecraft:the_nether
[21:16:34 INFO] [Server thread]: [MinecraftServer] ThreadedAnvilChunkStorage (world): All chunks are saved
[21:16:34 INFO] [Server thread]: [MinecraftServer] ThreadedAnvilChunkStorage (DIM1): All chunks are saved
[21:16:34 INFO] [Server thread]: [MinecraftServer] ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[21:16:34 INFO] [Server thread]: [MinecraftServer] ThreadedAnvilChunkStorage: All dimensions are saved
[21:16:34 ERROR] [Server thread]: [MinecraftServer] Exception stopping the server
java.lang.NullPointerException: Cannot invoke "com.sun.net.httpserver.HttpServer.stop(int)" because "this.server" is null
at eu.pb4.polymer.autohost.impl.providers.StandaloneWebServerProvider.serverStopped(StandaloneWebServerProvider.java:50) ~[polymer-autohost-0.9.4+1.21-7d9fffa634080118.jar:?]
at eu.pb4.polymer.autohost.impl.AutoHost.end(AutoHost.java:95) ~[polymer-autohost-0.9.4+1.21-7d9fffa634080118.jar:?]
at net.minecraft.server.MinecraftServer.handler$coc000$polymer-autohost$polymer_autohost_end(MinecraftServer.java:9128) ~[server-intermediary.jar:?]
at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:637) ~[server-intermediary.jar:?]
at net.minecraft.server.dedicated.DedicatedServer.stopServer(DedicatedServer.java:561) ~[?:?]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:735) ~[server-intermediary.jar:?]
at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:281) ~[server-intermediary.jar:?]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]

old clients can connect server without problem (bcz they already downloaded the resource pack i think)

so I don't know exactly when this problem started. maybe I think I updated fabric server loader to 0.16.0 and this problem has started.

commented

I also tried changing auto-host type to polymer:automatic but no luck. here is client error log:

[21:36:21] [Download-20/INFO]: Pack 1 failed to download
[21:36:21] [Download-20/ERROR]: Failed to download http://my_mc_server.net/eu.pb4.polymer.autohost/main.zip
java.lang.IllegalStateException: Failed to download file http://my_mc_server.net/eu.pb4.polymer.autohost/main.zip
at net.minecraft.class_3521.method_55496(class_3521.java:137) ~[client-intermediary.jar:?]
at net.minecraft.class_9028.method_55485(class_9028.java:107) ~[client-intermediary.jar:?]
at java.base/java.util.HashMap.forEach(HashMap.java:1429) ~[?:?]
at net.minecraft.class_9028.method_55488(class_9028.java:103) ~[client-intermediary.jar:?]
at net.minecraft.class_9028.method_55489(class_9028.java:140) ~[client-intermediary.jar:?]
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
at net.minecraft.class_3846.method_16907(class_3846.java:91) ~[client-intermediary.jar:?]
at net.minecraft.class_3846.method_16900(class_3846.java:146) ~[client-intermediary.jar:?]
at net.minecraft.class_3846.run(class_3846.java:102) ~[client-intermediary.jar:?]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: java.net.SocketException: Unexpected end of file from server
at java.base/sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:955) ~[?:?]
at java.base/sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:759) ~[?:?]
at java.base/sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:952) ~[?:?]
at java.base/sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:759) ~[?:?]
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1690) ~[?:?]
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1599) ~[?:?]
at net.minecraft.class_3521.method_55496(class_3521.java:85) ~[client-intermediary.jar:?]
... 11 more

commented

Hey, can you send your autohost config? You likely want to look into manual/proxy setup that doesn't reuse port with polymer:http_server. But I will fix that error

commented

here:
(also I'm using tom's mobs mod I think it sets the resource pack required.)

{
"_c1": "Enables Polymer's ResourcePack Auto Hosting",
"enabled": true,
"_c2": "Marks resource pack as required",
"required": false,
"_c3": "Type of resource pack provider. Default: 'polymer:automatic'",
"type": "polymer:http_server",
"_c4": "Configuration of type, see provider's source for more details",
"settings": {
"port": 25577,
"external_address": "http://localhost:25577/"
},
"_c5": "Message sent to clients before pack is loaded",
"message": "This server uses resource pack to enhance gameplay with custom textures and models. It might be unplayable without them.",
"_c6": "Disconnect message in case of failure",
"disconnect_message": "Couldn't apply server resourcepack!",
"external_resource_packs": [],
"setup_early": false
}

commented

http://localhost:25577/ You need to point it at accessible ip / address with the port different from vanilla one!
So for example set port to 25578 and external address to http://myserver.domain:25578/

commented

It's possible the packs hash changed, which broke older instances. But yeah in cases like this using http_server is intended. But you do need to open extra port for it to work or proxy it as part of your website via apache/nginx (then external address just points to path you redirect to)

commented

so I don't really want to open a port on other than 25565 and I was be able to use without it. and here is a thing I'm curious about it. (don't mind me I'm questionaring your work. I want to find another way. also love ur work and thnx for your efforts <3)

on automatic configuration, it redirects to download resourcepack from domain.net:25565 (I forget to type on above) and without velocity I can join server. Also I remember I can join world with resource pack using automatic configuration with velocity. (before upgrading to fabric 0.16.0) (also sorry for confusing grammar, still studying english..)

commented

yeah you're right. so setting with new port and its working now. thnx for help bro <3