BlueMap-Minecraft / BlueMap

A Minecraft mapping tool that creates 3D models of your Minecraft worlds and displays them in a web viewer.
https://bluecolo.red/bluemap
MIT License
1.89k stars 130 forks source link

CLI crashes just after reporting "finished" #85

Closed ComputerJock closed 3 years ago

ComputerJock commented 4 years ago

BlueMap Version: BlueMap-1.0.0-cli.jar

I am using:

Description: This mod really looks promising. I tried it running a fabric server & the game on the same PC (win7x64, core i7 3GHz) and it was beautiful -- but it was impractical due to how slowly the browser rendered/moved/zoomed the map.

I then tried the CLI: BlueMap-1.0.0-cli.jar

I pointed the generated render.conf file to an existing 1.16.2 world. Running the CLI with the "-r" flag gave a bunch of warnings & then crashed just after saying "Render finished!". Note: I'm using Openjdk 14.0.2 Perhaps the "exception trying to load chunk..." is because the chunk does not exist? The world is not entirely connected.

Here's the tail end of all the messages:

[DEBUG] Unexpected exception trying to load chunk ((286, -154)):java.io.IOException: Exception trying to load chunk ((286, -154))    
[INFO] Rendering map '1_16':                                                                                                         
[INFO] Rendered 8226 of 8245 tiles in 37 minutes 44 seconds | 3.633 tiles/s                                                          
[INFO] 99.77% | Estimated remaining time: 5 seconds                                                                                  
[DEBUG] Unexpected exception trying to load chunk ((286, -152)):java.io.IOException: Exception trying to load chunk ((286, -152))    
[DEBUG] Unexpected exception trying to load chunk ((286, -150)):java.io.IOException: Exception trying to load chunk ((286, -150))    
[DEBUG] Unexpected exception trying to load chunk ((286, -148)):java.io.IOException: Exception trying to load chunk ((286, -148))    
[DEBUG] Unexpected exception trying to load chunk ((286, -146)):java.io.IOException: Exception trying to load chunk ((286, -146))    
[DEBUG] Unexpected exception trying to load chunk ((286, -144)):java.io.IOException: Exception trying to load chunk ((286, -144))    
[DEBUG] Unexpected exception trying to load chunk ((280, -164)):java.io.IOException: Exception trying to load chunk ((280, -164))    
[DEBUG] Unexpected exception trying to load chunk ((282, -164)):java.io.IOException: Exception trying to load chunk ((282, -164))    
[DEBUG] Unexpected exception trying to load chunk ((284, -164)):java.io.IOException: Exception trying to load chunk ((284, -164))    
[DEBUG] Unexpected exception trying to load chunk ((286, -164)):java.io.IOException: Exception trying to load chunk ((286, -164))    
[DEBUG] Unexpected exception trying to load chunk ((280, -162)):java.io.IOException: Exception trying to load chunk ((280, -162))    
[DEBUG] Unexpected exception trying to load chunk ((282, -162)):java.io.IOException: Exception trying to load chunk ((282, -162))    
[DEBUG] Unexpected exception trying to load chunk ((284, -162)):java.io.IOException: Exception trying to load chunk ((284, -162))    
[INFO] Render finished!                                                                                                              
[ERROR] Unexpected exception in render-thread!                                                                                       
java.util.concurrent.CompletionException: java.lang.InterruptedException: sleep interrupted                                          
        at de.bluecolored.shadow.benmanes.caffeine.cache.LocalLoadingCache.lambda$newMappingFunction$2(LocalLoadingCache.java:146)   
        at de.bluecolored.shadow.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2344)  
        at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916)                                     
        at de.bluecolored.shadow.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2342)            
        at de.bluecolored.shadow.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2325)              
        at de.bluecolored.shadow.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:108)                             
        at de.bluecolored.shadow.benmanes.caffeine.cache.LocalLoadingCache.get(LocalLoadingCache.java:54)                            
        at de.bluecolored.bluemap.core.mca.MCAWorld.getChunk(MCAWorld.java:202)                                                      
        at de.bluecolored.bluemap.core.mca.MCAWorld.isChunkGenerated(MCAWorld.java:273)                                              
        at de.bluecolored.bluemap.core.world.World.isAreaGenerated(World.java:142)                                                   
        at de.bluecolored.bluemap.core.world.World.isAreaGenerated(World.java:131)                                                   
        at de.bluecolored.bluemap.core.world.World.isAreaGenerated(World.java:122)                                                   
        at de.bluecolored.bluemap.core.render.TileRenderer.render(TileRenderer.java:47)                                              
        at de.bluecolored.bluemap.common.MapType.renderTile(MapType.java:70)                                                         
        at de.bluecolored.bluemap.common.RenderTicket.render(RenderTicket.java:42)                                                   
        at de.bluecolored.bluemap.common.RenderManager.renderThread(RenderManager.java:164)                                          
        at java.base/java.lang.Thread.run(Thread.java:832)                                                                           
Caused by: java.lang.InterruptedException: sleep interrupted                                                                         
        at java.base/java.lang.Thread.sleep(Native Method)                                                                           
        at de.bluecolored.bluemap.core.mca.MCAWorld.loadChunkOrEmpty(MCAWorld.java:220)                                              
        at de.bluecolored.bluemap.core.mca.MCAWorld.lambda$new$0(MCAWorld.java:149)                                                  
        at de.bluecolored.shadow.benmanes.caffeine.cache.LocalLoadingCache.lambda$newMappingFunction$2(LocalLoadingCache.java:141)   
        ... 16 more                                                                                                                  
TBlueF commented 4 years ago

@ComputerJock Since mods can alter the way a world is saved, this is also applicable for the CLI, thanks for including them :D

So the error at the end is a small bug, but nothing severe, i'll fix that with the next version ..

Those warnings however are unusual on the cli, while the server is not running. (Usually they only occur if Minecraft saves some chunks at the same time BlueMap tries to read them ..) Could you maybe send me this file from your world: region/r.8.-6.mca .. it should contain one of the chunks that has failed to load.. Maybe that gives me some more information.

Other than that: All chunks that could be loaded should have been rendered correctly. So your map should be good to go, despite the error in the end :)

ComputerJock commented 4 years ago

On 9/8/2020 5:12 AM, Lukas Rieger wrote:

@ComputerJock https://github.com/ComputerJock Since mods can alter the way a world is saved, this is also applicable for the CLI, thanks for including them :D

So the error at the end is a small bug, but nothing severe, i'll fix that with the next version ..

Those warnings however are unusual on the cli, while the server is not running. /(Usually they only occur if Minecraft saves some chunks to the same time BlueMap tries to read them ..)/ Could you maybe send me this file from your world: |region/r.8.-6.mca| .. it should contain one of the chunks that has failed to load.. Maybe that gives me some more information.

Other then that: All chunks that could be loaded should have been rendered correctly. So your map should be good to go, despite the error in the end :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/BlueMap-Minecraft/BlueMap/issues/85#issuecomment-688768608, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFQJPLMZMGJD6RC5FOWIP73SEX7QBANCNFSM4Q7HHSWQ.

Thanks for the reply. Although you mentioned that the world should have rendered correctly -- and there were a lot of files in the web/ directory -- neither Chromium nor Firefox showed anything but a black page. I've attached the region file and below are the .CONF files. I'll mention again that I'm using openjdk rather than oracle's.


core.conf accept-download: true renderThreadCount: 2 metrics: true data: "data"

render.conf webroot: "web" useCookies: true maps: [ { id: "1_16" name: "1.16" world: "C:/Users/imdave/AppData/Roaming/.minecraft/saves/1_16" skyColor: "#7dabff" ambientLight: 0 renderCaves: false renderEdges: true useCompression: true ignoreMissingLightData: false } { id: "end" name: "End" world: "world/DIM1" skyColor: "#080010" renderCaves: true ambientLight: 0.6 } { id: "nether" name: "Nether" world: "world/DIM-1" skyColor: "#290000" renderCaves: true ambientLight: 0.6 maxY: 90 renderEdges: true } ]

webserver.conf webroot: "web" ip: "localhost" port: 8100 maxConnectionCount: 2

$ /c/Program\ Files/java/jdk-14.0.2/bin/java -version openjdk version "14.0.2" 2020-07-14 OpenJDK Runtime Environment (build 14.0.2+12-46) OpenJDK 64-Bit Server VM (build 14.0.2+12-46, mixed mode, sharing)

I'm running Msys2 on win7x64 -- that's why the following is a little bash script

render.sh java="C:/Program Files/Java/jdk-14.0.2/bin/java.exe" "$java" -jar BlueMap-1.0.0-cli.jar -r

TBlueF commented 4 years ago

@ComputerJock I believe the attached file did not get uploaded correctly? ^^

(Also, OpenJDK is most likely not the problem)

ComputerJock commented 4 years ago

On 9/8/2020 10:46 AM, Lukas Rieger wrote:

@ComputerJock https://github.com/ComputerJock I believe the attached file did not get uploaded correctly? ^^

/(Also, OpenJDK is most likely not the problem)/

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/BlueMap-Minecraft/BlueMap/issues/85#issuecomment-688966585, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFQJPLKDYR6TAOHWKBWM3KTSEZGVVANCNFSM4Q7HHSWQ.

Sorry... some mailer along the way must have corrupted it. Here's the same file wrapped in a ZIP

TBlueF commented 4 years ago

@ComputerJock I think GitHub is not able to process E-Mail attachments in general, try to answer on GitHub, not via mail ^^

ComputerJock commented 4 years ago

OK, here's another try. BTW, I noticed that there were several MCA files in the region/ directory that had zero length. I checked another 1.16.2 world and found the same so I guess that's normal. r.8.-6.mca.zip

ComputerJock commented 4 years ago

On 9/8/2020 10:52 AM, Lukas Rieger wrote:

@ComputerJock https://github.com/ComputerJock I think GitHub is not able to process E-Mail attachments in general, try to answer on GitHub, not via mail ^^

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/BlueMap-Minecraft/BlueMap/issues/85#issuecomment-688970610, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFQJPLIYUND3S7JELGWIZ4DSEZHMNANCNFSM4Q7HHSWQ.

Done, I replied on the issues page

ComputerJock commented 4 years ago

Most likely my error report is caused by my running java under the bash shell with Msys2. Some time ago I saw this same sort of issue with another java app.

I appologize for taking up your time.

So I ran two more tests. I used a cmd.exe window and I ran BlueMap-1.0.0-cli.jar with both versions of java:

C:/Program Files/Java/jre1.8.0_181/bin/java.exe java version "1.8.0_181" Java(TM) SE Runtime Environment (build 1.8.0_181-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

C:/Program Files/Java/jdk-14.0.2/bin/java.exe openjdk version "14.0.2" 2020-07-14 OpenJDK Runtime Environment (build 14.0.2+12-46) OpenJDK 64-Bit Server VM (build 14.0.2+12-46, mixed mode, sharing)

Both ran to completion with no error messages at all. I am guessing that the Msys2 environment has some issue which interferes with java apps.

I then compared the resulting web/ directory. Unfortunately, a simple recursive compare failed because it looks like all of the data/1_16/.../*.json files have a "uuid" string which differed. I picked one such file from each run, removed the uuid string and the files compared identically.

Unfortunately, I still cannot view the map. I tried with two quite recent browsers:

Chromium Version 87.0.4249.0 (Developer Build) (64-bit) Portable Firefox 80.0 (64-bit)

In windows explorer, I click on web/index.html The result is a totally black page I copied the url from chromium (my default browser) and pasted it into Firefox. Again the result was a totally black page.

ComputerJock commented 4 years ago

One more note: when I ran a 1.16.2 fabric server with mods:

BlueMap-1.0.0-fabric-1.16.2.jar fabric-api-0.20.1+build.401-1.16.jar fabric-carpet-1.16.3-1.4.10+v200907.jar lithium-fabric-mc1.16.2-0.5.4.jar worldedit-fabric-mc1.16.2-7.2.0-beta-04.jar

/and/ a Minecraft client on the same machine, I was able to view the map with my browser (chromium -- firefox would probably also worked but I did not try that). As I mentioned though, the map was extremely slow to render in the browser. Most likely, running the server on a different machine would have made an improvement.

TBlueF commented 4 years ago

So, i tested this with your region-file as well. I also had no warnings, but the map also stayed dark ..

A dark map means that BlueMap did not render anything, so all the tiles are empty. (So this is nothing browser related) Also it is worth to note, that the rendering process is absolutely identical between cli and fabric.

I checked the region-file and noticed that every chunk is in a "pre-generated" state, meaning that there are no blocks generated yet. This usually only occurs on the edge of the generated world, but the whole region file (a big chunk of chunks) was like this. I don't know how this happened in your world, but if the rest of the world is the same, it would explain the dark Map :D (BlueMap does not modify any world data, so it can not have caused this)

ComputerJock commented 4 years ago

Not sure what to tell you. It's a simple test world for 1.16 created (probably) when the first snapshots appeared. It's not huge but it's not just the spawn chunks either. It was last played with MC 1.16.2.

I would expect that something would be visible.

I ran mcaselector-1.12.3.jar on the world's region folder and it displayed what is possibly the entire extent of the overworld.

I've attached 1_16 a screenshot of the mcaselector window if you wish to investigate further. You can download the world (link is probably good for a week) at: https://transferxl.com/00vYPdnB3twj2x

Thank you for taking the time to look at this and, regardless, I will keep my eye on the mod.

ComputerJock commented 4 years ago

Now that I think about it, that world might have been created as a little test world when 1.13 was being developed. I recall messing around with bees. For each subsequent Minecraft release, I think I copied the world, renamed it, and did the "optimize world" option to bring it up to that release. Therefore this world might have gone through 3 upgrades -- from 1.13 to 1.16.

TBlueF commented 4 years ago

So i tried opening the region-file you sent me (r.8.-6.mca) with mcaselector and it seems like it is one of the fully black (not grey) squares on your screenshot.. If you want me to try to render that map with BlueMap again you can send me either your world or another one of the region files, preferably one that is not fully black on mcaselector :)

ComputerJock commented 4 years ago

Please see the link above for the world download: https://transferxl.com/00vYPdnB3twj2x

TBlueF commented 4 years ago

Hmm .. i have no problems rendering that map: image

Seems like i can not reproduce your problem :/

ComputerJock commented 4 years ago

Very strange. Can you say what browser you use? I'm wondering if my problem might be some sort of interaction with ad blockers. Other apps that used leaflet (and previously Google Maps API) worked fine.

TBlueF commented 4 years ago

Chrome .. but it also works on Edge and Firefox for me ^^

ComputerJock commented 4 years ago

Thanks for looking into the problem. I don't know what the problem is on my end.

If I get some time, what is the format for the .json files in the data/ directory? I assume each is a tile and it should be relatively easy to convert to a simple format like PPM and convert to PNG to view. Assuming the result is a valid tile, then it's some problem with my browser setup (lots of ad blockers).

TBlueF commented 4 years ago

they are exactly what the file-ending says .. GZip`ed JSON-Files .. You can just unpack them with 7zip and then open them with a text editor .. and the json is a threejs buffergeometry

There are no png or other images in there, since it is 3D and not 2D ^^

ComputerJock commented 4 years ago

That's probably beyond my expertise. I do see that web\data\1_16\hires\x0\z0.json.gz has other numbers besides -1, 0 & 1 so there is definitely something there. Maybe it's my rather old video card... although only I've only had one sort-of-recent video game that did not work.

Again, thank you for taking the time to look at this, and I am definitely interested in keeping up with your progress.

TBlueF commented 4 years ago

well you said, other maps work for you .. so i don't think its the video card, right?

No problem, tell me if you figure it out! :)

(I'm keeping this issue open until i fixed that small error you reported ^^)

ComputerJock commented 4 years ago

FYI, I installed MS Edge on my win7x64 system -- still no go. My video card is ca. 2011, an AMD HD6950. It's not longer supported by AMD (next time I'll buy Nvidia). Since all three of my browsers show a black screen (I rendered a different world for my last test), I am strongly suspecting that there's some OpenGL feature or video card issue that's required for this much more modern rendering.

It is strange, though, that when I ran the Fabric server & the Minecraft client, I was able to see the map... I don't know. It's a mystery.

One other thought -- I have just used the url file:///C:/Users/imdave/Desktop/Minecraft%20Tools/Downloads/Bluemap/web/index.html

Could that be a problem? I've got a simple web server (Abyss). I'm going to fire that up and use http://localhost/... and see if that could possibly be the issue.

ComputerJock commented 4 years ago

There is a difference between the file:// and http:// url's. With the Bluemap served by the Abyss web server, I now see the Bluemap menu and X/Z coordinates. Previously then entire page was black. Now, although I see the menu, the map is still black.

I again started up the Fabric server (without connecting with a Minecraft client). I connected to localhost:8100 and I /do/ see the map rendering in all three browsers: FF, Edge and Chromium.

Why? I have no idea, however there may be an actual problem with accessing the map with file:// Perhaps the javascript expects an actual web server and cannot deal with file:// url's

TBlueF commented 4 years ago

Ooooohhhhhhhhhhhhhh okay! That changes everything, now i know what went wrong! :D

BlueMap normally uses an internal webserver to host the map .. that is configured to do everything for you, but if you use an other webserver you there is a problem: The tiles are stored by default GZip compressed but the web-app is asking for the uncompressed files!

To fix your issue you have 3 options:

ComputerJock commented 4 years ago

Interesting.

One other note: I found that chromium is extremely sluggish when compared to either FF or Edge. I'm running the MC client right now and am able to move/scroll the map with ease using FF. I have enabled "use hardware acceleration" for all my browsers but perhaps chromium is not making good use of it. (I've been using chromium rather than chrome -- I don't like companies dictating what extensions I can/can not use) and chromium always reports "some apis are missing" due to something or other (probably like the google map api's are now no longer free to use).

ComputerJock commented 4 years ago

Do you have any estimate of the performance impact on a server with Bluemap? Currently I'm renting a server and I'm running 1.14.4 Spigot with Dynmap. We've seen issues with lag and rubber-banding when we travel -- especially to brand new chunks. With 1.16.3 around the corner, I'm planning to switch to a Fabric server rather than Spigot. Bluemap seems to be a drop-in replacement for Dynmap. As an aside, if server performance becomes an issue, perhaps a 2D overhead map could be an option.

I'm very impressed with how the map looks. Very nice!

TBlueF commented 4 years ago

Depends on the server, especially on the core-count .. if you have 3 cores or more, chances are good that there is no real performance impact. BlueMap is rendering entirely off the server-thread. Minecraft is single threaded and BlueMap plugins (by default) leaves 2 cores for the server and renders on the remaining. So if you have 3 cores, BlueMap runs (slowly) on one render-thread.. If you have 6 BlueMap runs on 4 threads , and so on. But if you have one or two cores, BlueMap might take away performance from your server while rendering ..