Dynmap-Forge/Fabric

Dynmap-Forge/Fabric

888k Downloads

`tilespath` and `webpath` on samba drive not working

PeterFour opened this issue ยท 6 comments

commented

Issue Description:
Dynmap is not able write to a network mounted drive (via SMB)
On the server I can properly see the drive is mounted and accessible ( since I managed to send the web folder)

But java says it doesn't exist :

[Dynmap Render Thread/FATAL]: [Dynmap] Exception while writing JSON-file - Z:\standalone\dynmap_config.json.new
java.io.FileNotFoundException: Z:\standalone\dynmap_config.json.new (The system cannot find the path specified)
	at java.io.RandomAccessFile.open0(Native Method) ~[?:?]
	at java.io.RandomAccessFile.open(RandomAccessFile.java:344) ~[?:?]
	at java.io.RandomAccessFile.<init>(RandomAccessFile.java:259) ~[?:?]
	at java.io.RandomAccessFile.<init>(RandomAccessFile.java:213) ~[?:?]
	at org.dynmap.storage.MapStorage.setStandaloneFile(MapStorage.java:272) [Dynmap-3.3-beta-4-fabric-1.18.jar:?]
	at org.dynmap.JsonFileClientUpdateComponent$FileProcessor.run(JsonFileClientUpdateComponent.java:88) [Dynmap-3.3-beta-4-fabric-1.18.jar:?]
	at org.dynmap.MapManager$DynmapScheduledThreadPoolExecutor$1.run(MapManager.java:229) [Dynmap-3.3-beta-4-fabric-1.18.jar:?]
	at org.dynmap.MapManager$DynmapScheduledThreadPoolExecutor$2.run(MapManager.java:245) [Dynmap-3.3-beta-4-fabric-1.18.jar:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
	at java.lang.Thread.run(Thread.java:833) [?:?]

[x] I have looked at all other issues and this is not a duplicate
[x] I have been able to replicate this

commented

You probably didn't copy over the web dir as stated in: https://github.com/webbukkit/dynmap/wiki/External-Webserver-Basics#step-3-copying-files-to-your-webserver-and-change-paths
after doing this I no longer got the JSON-file write error, before I did indeed.

commented

Hum I think I copied them, you can see everything in the screenshot, unless I misunderstood the step ?

commented

steps I did to get it fixed:

  • 1: start server once to generate configuration.txt and shutdown after succesfully started.
  • 2: comment out lines 43 till 76 and uncomment lines 77 till 99
  • 3: change the tilespath to P:\test/web/tiles and webpath to: P:\test/web
  • 4: set disable-webserver: true, save and close configuration.txt
  • 5: cut web folder to P:\test/
  • 6: start server and do a fullrender to see it work

no errors on console:
image

commented

The other thing, particularly relative to SAMBA or a network drive, is to be sure that the user account you are running the server under has the needed access to the file system: literally, there is nothing in our code that would yield a path not found that we control - either your settings are pointing the wrong place, or the user account the MC server is running under lacks the needed permissions for the path and files there. Basically, from the java VM point of view, a file system path is a file system path, and being able to access it is 'above our pay grade', if you get my drift. I don't know your setup - if you are running on windows with the server as a local service, they tend to (by default) lack network drive access, IIRC. I recall there being a way to use a 'network service' account for that case, but I've been away from Windows as a main platform for a few years, so details are fuzzy.

commented

Thanks all for you help but yeah basically the screenshot you see is from the windows server (running the mc server) and it's open in the explorer of the user running the server. But it could be some access issue for sure I'll have a look around that.

My server is running using AMP by cubecoders so it could be because of this service issue for sure I'll investigate that

commented

The other thing, particularly relative to SAMBA or a network drive, is to be sure that the user account you are running the server under has the needed access to the file system: literally, there is nothing in our code that would yield a path not found that we control - either your settings are pointing the wrong place, or the user account the MC server is running under lacks the needed permissions for the path and files there. Basically, from the java VM point of view, a file system path is a file system path, and being able to access it is 'above our pay grade', if you get my drift. I don't know your setup - if you are running on windows with the server as a local service, they tend to (by default) lack network drive access, IIRC. I recall there being a way to use a 'network service' account for that case, but I've been away from Windows as a main platform for a few years, so details are fuzzy.

Well you were spot on on that indeed.
When I tried running the server as a user with the share mounted it worked perfectly. And it turns out AMP software is a service that runs as Network Service user so I added a scheduled task to mount the drive as that user and now it works. ๐ŸŽ‰

Thanks all for your help !