java.lang.IllegalStateException: Unable to access 'path.repo'

Hi guys,
I have a single node elastic setup o windows10. i tried to create repository on shared folder. the process i did was, i created a folder (Es_backup) in shared drive then i mapped folder on my elastic local machine as X:
then i included path.repo: X:\Backup in elastic yml and restarted the elastic service. service stops suddenly
these are the logs i found
[2022-08-12T15:09:22,644][INFO ][o.e.n.Node ] [A2_MMJ] closed
[2022-08-12T15:09:27,507][ERROR][o.e.b.Bootstrap ] [A2_MMJ] Exception
java.lang.IllegalStateException: Unable to access 'path.repo' (X:\Backup)
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:66) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:242) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:168) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Security.configure(Security.java:115) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:229) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434) [elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:166) [elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:157) [elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77) [elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112) [elasticsearch-cli-7.16.2.jar:7.16.2]
at org.elasticsearch.cli.Command.main(Command.java:77) [elasticsearch-cli-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:122) [elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80) [elasticsearch-7.16.2.jar:7.16.2]
Caused by: java.nio.file.FileSystemException: X:\Backup: Unable to determine if root directory exists
at java.nio.file.Files.createDirectories(Files.java:782) ~[?:?]
at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:318) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:64) ~[elasticsearch-7.16.2.jar:7.16.2]
... 12 more
[2022-08-12T15:09:27,523][WARN ][stderr ] [A2_MMJ] java.lang.IllegalStateException: Unable to access 'path.repo' (X:\Backup)
[2022-08-12T15:09:27,523][WARN ][stderr ] [A2_MMJ] Likely root cause: java.nio.file.FileSystemException: X:\Backup: Unable to determine if root directory exists
[2022-08-12T15:09:27,523][WARN ][stderr ] [A2_MMJ] at java.base/java.nio.file.Files.createDirectories(Files.java:782)
[2022-08-12T15:09:27,523][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:318)
[2022-08-12T15:09:27,523][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:64)
[2022-08-12T15:09:27,523][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:242)
[2022-08-12T15:09:27,523][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:168)
[2022-08-12T15:09:27,523][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Security.configure(Security.java:115)
[2022-08-12T15:09:27,523][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:229)
[2022-08-12T15:09:27,523][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434)
[2022-08-12T15:09:27,523][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:166)
[2022-08-12T15:09:27,523][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:157)
[2022-08-12T15:09:27,523][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77)
[2022-08-12T15:09:27,523][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
[2022-08-12T15:09:27,523][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.cli.Command.main(Command.java:77)
[2022-08-12T15:09:27,523][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:122)
[2022-08-12T15:09:27,523][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)
[2022-08-12T15:09:27,523][WARN ][stderr ] [A2_MMJ] For complete error details, refer to the log at C:\Elastic\Elasticsearch\logs\elasticsearch.log

May be try with

path.repo: X:\\Backup
1 Like

Hello mujtabah!
Could you please use code tags? It will be easier to analyse your script and help you.
Are all permissions set for user that wants to get access to directory?

1 Like

Hi
The repository is created and snapshot is taken successfully when i run elasticsearch.bat using powershell. If i run elasticsearch as a service the Elasticsearch service is stopped suddenly and gives this error.
The question is why is repo created successfully when elasticsearch is run from batch file using powershell and when i run as a service its stopped?
\Elasticsearch\logs\elasticsearch.log
[2022-08-13T13:41:53,551][ERROR][o.e.b.Bootstrap ] [A2_MMJ] Exception
java.lang.IllegalStateException: Unable to access 'path.repo' (Z:\Backup\Backups)
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:66) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:242) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:168) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Security.configure(Security.java:115) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:229) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434) [elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:166) [elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:157) [elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77) [elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112) [elasticsearch-cli-7.16.2.jar:7.16.2]
at org.elasticsearch.cli.Command.main(Command.java:77) [elasticsearch-cli-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:122) [elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80) [elasticsearch-7.16.2.jar:7.16.2]
Caused by: java.nio.file.FileSystemException: Z:\Backup\Backups: Unable to determine if root directory exists
at java.nio.file.Files.createDirectories(Files.java:782) ~[?:?]
at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:318) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:64) ~[elasticsearch-7.16.2.jar:7.16.2]
... 12 more
[2022-08-13T13:41:53,598][WARN ][stderr ] [A2_MMJ] java.lang.IllegalStateException: Unable to access 'path.repo' (Z:\Backup\Backups)
[2022-08-13T13:41:53,598][WARN ][stderr ] [A2_MMJ] Likely root cause: java.nio.file.FileSystemException: Z:\Backup\Backups: Unable to determine if root directory exists
[2022-08-13T13:41:53,598][WARN ][stderr ] [A2_MMJ] at java.base/java.nio.file.Files.createDirectories(Files.java:782)
[2022-08-13T13:41:53,598][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:318)
[2022-08-13T13:41:53,598][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:64)
[2022-08-13T13:41:53,598][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:242)
[2022-08-13T13:41:53,598][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:168)
[2022-08-13T13:41:53,614][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Security.configure(Security.java:115)
[2022-08-13T13:41:53,614][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:229)
[2022-08-13T13:41:53,614][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434)
[2022-08-13T13:41:53,614][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:166)
[2022-08-13T13:41:53,614][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:157)
[2022-08-13T13:41:53,614][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77)
[2022-08-13T13:41:53,614][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
[2022-08-13T13:41:53,614][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.cli.Command.main(Command.java:77)
[2022-08-13T13:41:53,614][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:122)
[2022-08-13T13:41:53,614][WARN ][stderr ] [A2_MMJ] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)
[2022-08-13T13:41:53,614][WARN ][stderr ] [A2_MMJ] For complete error details, refer to the log at C:\Elastic\Elasticsearch\logs\elasticsearch.log

The path is not the same.

Z:\Backup\Backups

Please format your code, logs or configuration files using </> icon as explained in this guide and not the citation button. It will make your post more readable.

Or use markdown style like:

```
CODE
```

This is the icon to use if you are not using markdown format:

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.
Please update your post.

java.lang.IllegalStateException: Unable to access 'path.repo' (Z:\Backup\Backups)
	at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:66) ~[elasticsearch-7.16.2.jar:7.16.2]
	at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:242) ~[elasticsearch-7.16.2.jar:7.16.2]
	at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:168) ~[elasticsearch-7.16.2.jar:7.16.2]
	at org.elasticsearch.bootstrap.Security.configure(Security.java:115) ~[elasticsearch-7.16.2.jar:7.16.2]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:229) ~[elasticsearch-7.16.2.jar:7.16.2]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434) [elasticsearch-7.16.2.jar:7.16.2]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:166) [elasticsearch-7.16.2.jar:7.16.2]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:157) [elasticsearch-7.16.2.jar:7.16.2]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77) [elasticsearch-7.16.2.jar:7.16.2]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112) [elasticsearch-cli-7.16.2.jar:7.16.2]
	at org.elasticsearch.cli.Command.main(Command.java:77) [elasticsearch-cli-7.16.2.jar:7.16.2]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:122) [elasticsearch-7.16.2.jar:7.16.2]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80) [elasticsearch-7.16.2.jar:7.16.2]
Caused by: java.nio.file.AccessDeniedException: Z:\Backup
	at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) ~[?:?]
	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) ~[?:?]
	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) ~[?:?]
	at sun.nio.fs.WindowsFileSystemProvider.createDirectory(WindowsFileSystemProvider.java:521) ~[?:?]
	at java.nio.file.Files.createDirectory(Files.java:700) ~[?:?]
	at java.nio.file.Files.createAndCheckIsDirectory(Files.java:807) ~[?:?]
	at java.nio.file.Files.createDirectories(Files.java:793) ~[?:?]
	at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:318) ~[elasticsearch-7.16.2.jar:7.16.2]
	at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:64) ~[elasticsearch-7.16.2.jar:7.16.2]
	... 12 more
[2022-08-14T13:16:15,082][WARN ][stderr                   ] [A2_MMJ] java.lang.IllegalStateException: Unable to access 'path.repo' (Z:\Backup\Backups\mujtaba3)
[2022-08-14T13:16:15,082][WARN ][stderr                   ] [A2_MMJ] Likely root cause: java.nio.file.AccessDeniedException: Z:\Backup
[2022-08-14T13:16:15,082][WARN ][stderr                   ] [A2_MMJ] 	at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89)
[2022-08-14T13:16:15,082][WARN ][stderr                   ] [A2_MMJ] 	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
[2022-08-14T13:16:15,082][WARN ][stderr                   ] [A2_MMJ] 	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
[2022-08-14T13:16:15,082][WARN ][stderr                   ] [A2_MMJ] 	at java.base/sun.nio.fs.WindowsFileSystemProvider.createDirectory(WindowsFileSystemProvider.java:521)
[2022-08-14T13:16:15,082][WARN ][stderr                   ] [A2_MMJ] 	at java.base/java.nio.file.Files.createDirectory(Files.java:700)
[2022-08-14T13:16:15,098][WARN ][stderr                   ] [A2_MMJ] 	at java.base/java.nio.file.Files.createAndCheckIsDirectory(Files.java:807)
[2022-08-14T13:16:15,098][WARN ][stderr                   ] [A2_MMJ] 	at java.base/java.nio.file.Files.createDirectories(Files.java:793)
[2022-08-14T13:16:15,098][WARN ][stderr                   ] [A2_MMJ] 	at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:318)
[2022-08-14T13:16:15,098][WARN ][stderr                   ] [A2_MMJ] 	at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:64)
[2022-08-14T13:16:15,098][WARN ][stderr                   ] [A2_MMJ] 	at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:242)
[2022-08-14T13:16:15,098][WARN ][stderr                   ] [A2_MMJ] 	at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:168)
[2022-08-14T13:16:15,098][WARN ][stderr                   ] [A2_MMJ] 	at org.elasticsearch.bootstrap.Security.configure(Security.java:115)
[2022-08-14T13:16:15,098][WARN ][stderr                   ] [A2_MMJ] 	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:229)
[2022-08-14T13:16:15,098][WARN ][stderr                   ] [A2_MMJ] 	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434)
[2022-08-14T13:16:15,098][WARN ][stderr                   ] [A2_MMJ] 	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:166)
[2022-08-14T13:16:15,098][WARN ][stderr                   ] [A2_MMJ] 	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:157)
[2022-08-14T13:16:15,098][WARN ][stderr                   ] [A2_MMJ] 	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77)
[2022-08-14T13:16:15,098][WARN ][stderr                   ] [A2_MMJ] 	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
[2022-08-14T13:16:15,098][WARN ][stderr                   ] [A2_MMJ] 	at org.elasticsearch.cli.Command.main(Command.java:77)
[2022-08-14T13:16:15,098][WARN ][stderr                   ] [A2_MMJ] 	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:122)
[2022-08-14T13:16:15,098][WARN ][stderr                   ] [A2_MMJ] 	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)
[2022-08-14T13:16:15,098][WARN ][stderr                   ] [A2_MMJ] For complete error details, refer to the log at C:\Elastic

I think as my shared file is on different domain, i have created created a identical user and password as of shared file , and gave all permissions, still it gets same error. when i run as batch file its working but when i run it as service it stops and gives logs as mentioned above

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