Snapshot & Restore on Windows can not access directory

We've got a 3 Node Elastic Cluster on Windows 10 (Customer Request) and i would like to configure the snapshot restore ability for the cluster.
What i've done is to create a share on one of the Node (seperate Harddisk), made it available so "Everybody" has Full Access, mounted it on the Nodes as "X:" and tried to configure it in the elasticsearch.yml the following ways as described here without any success. I always get the following Stacktrace

[2020-12-03T08:29:47,183][ERROR][o.e.b.Bootstrap          ] [Discovery] Exception
java.lang.IllegalStateException: Unable to access 'path.repo' (X:\Snapshots)
	at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:72) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:322) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:253) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Security.configure(Security.java:121) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:222) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) [elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) [elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) [elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127) [elasticsearch-cli-7.10.0.jar:7.10.0]
	at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) [elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) [elasticsearch-7.10.0.jar:7.10.0]
Caused by: java.nio.file.FileSystemException: X:\Snapshots: Unable to determine if root directory exists
	at java.nio.file.Files.createDirectories(Files.java:776) ~[?:?]
	at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:398) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:70) ~[elasticsearch-7.10.0.jar:7.10.0]
	... 12 more
[2020-12-03T08:29:47,199][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [Discovery] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Unable to access 'path.repo' (X:\Snapshots)
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:174) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127) ~[elasticsearch-cli-7.10.0.jar:7.10.0]
	at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.10.0.jar:7.10.0]
Caused by: java.lang.IllegalStateException: Unable to access 'path.repo' (X:\Snapshots)
	at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:72) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:322) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:253) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Security.configure(Security.java:121) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:222) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.10.0.jar:7.10.0]
	... 6 more
Caused by: java.nio.file.FileSystemException: X:\Snapshots: Unable to determine if root directory exists
	at java.nio.file.Files.createDirectories(Files.java:776) ~[?:?]
	at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:398) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:70) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:322) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:253) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Security.configure(Security.java:121) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:222) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) ~[elasticsearch-7.10.0.jar:7.10.0]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.10.0.jar:7.10.0]
	... 6 more

I've read pretty much everything in this forum but nothing really worked out ...

I tried:

path:
    data: "D:\\data"
    logs: "D:\\logs"
    repo: ["X:\\"]
path:
    data: "D:\\data"
    logs: "D:\\logs"
    repo: ["\\\\McCoy\\Repo"] // McCoy is the Node where the Drive is mounted and accessible via Explorer
path:
    data: "D:\\data"
    logs: "D:\\logs"
    repo: ["\\\\Scotty\\Repo"] // Scotty is the Node where the Drive is mounted and accessible via Explorer
path:
    data: "D:\\data"
    logs: "D:\\logs"
    repo: "\\\\Scotty\\Repo"

Everytime the same stacktrace - i'm starting Elasticsearch 7.10.0 as Service ...

When i mount the Drive on the "chekov" Node it works, very likely because it's a local drive ...

Has anybody a hint what i could try or change?

EDIT: Firewalls are all off, Sharing Data is enabled on every machine! The Share is accessible with the Systemuser, the same the Elastic Service is running

I think that on windows you can use something like:

path.repo: [ "//X/" ]

Not sure though.

Hi David, i found the problem, it's the SERVICE - starting Elasticsearch as elasticsearch.bat workes perfect ... so i will try to reinstall the Services and try again ...

My last settings are:

path:
  data: "D:\\Data"
  logs: "D:\\logs"
  repo: "Z:\\Backup"

Seems this is working, just for those who have the same problem ... windows ...

I've reinstalled the services without success - so the problem is when starting elasticsearch as service and having mounted whatever networkdrive there is always the same error:
>
> [2020-12-17T08:54:49,553][ERROR][o.e.b.Bootstrap ] [Enterprise] Exception
> java.lang.IllegalStateException: Unable to access 'path.repo' (Z:\Backup)
> at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:72) ~[elasticsearch-7.10.0.jar:7.10.0]
> at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:322) ~[elasticsearch-7.10.0.jar:7.10.0]
> at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:253) ~[elasticsearch-7.10.0.jar:7.10.0]
> at org.elasticsearch.bootstrap.Security.configure(Security.java:121) ~[elasticsearch-7.10.0.jar:7.10.0]
> at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:222) ~[elasticsearch-7.10.0.jar:7.10.0]
> at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) [elasticsearch-7.10.0.jar:7.10.0]
> at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) [elasticsearch-7.10.0.jar:7.10.0]
> at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) [elasticsearch-7.10.0.jar:7.10.0]
> at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-7.10.0.jar:7.10.0]
> at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127) [elasticsearch-cli-7.10.0.jar:7.10.0]
> at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-7.10.0.jar:7.10.0]
> at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) [elasticsearch-7.10.0.jar:7.10.0]
> at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) [elasticsearch-7.10.0.jar:7.10.0]
> Caused by: java.nio.file.FileSystemException: Z:\Backup: Unable to determine if root directory exists
> at java.nio.file.Files.createDirectories(Files.java:776) ~[?:?]
> at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:398) ~[elasticsearch-7.10.0.jar:7.10.0]
> at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:70) ~[elasticsearch-7.10.0.jar:7.10.0]
> ... 12 more

Starting Elasticsearch as .bat file with the same user as the service would start works.

Has anybody an idea how to solve this problem? Of course we could put Elasticsearch into the autostart file but this is more a hack than a solution.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.