I am using Sonarqube 10.2.1 community edition from the .zip file on Windows 10.

I was able to get it up and running but didn’t have it configured to scan our Postgres database.

After following a few steps, including downloading sonar scanner and updating the config file for the database credentials, after restarting SonarQube I was getting the “failed to obtain node lock” error.

Following steps found on this site as well as other forums, and restarting my windows machine, I no longer get that error, but I now get the below error. I confirmed that the node.lock file is in the directory it is searching it for. I restarted my PC, verified the node.lock file is not set to “read only” and am still getting this error. Any advice?

2023.10.01 00:00:20 WARN  es[][o.e.e.NodeEnvironment] lock assertion failed
java.nio.file.NoSuchFileException: C:\sonarqube\data\es8\node.lock
	at sun.nio.fs.WindowsException.translateToIOException( ~[?:?]
	at sun.nio.fs.WindowsException.rethrowAsIOException( ~[?:?]
	at sun.nio.fs.WindowsException.rethrowAsIOException( ~[?:?]
	at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes( ~[?:?]
	at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes( ~[?:?]
	at sun.nio.fs.WindowsFileSystemProvider.readAttributes( ~[?:?]
	at java.nio.file.Files.readAttributes( ~[?:?]
	at$NativeFSLock.ensureValid( ~[lucene-core-9.5.0.jar:?]
	at org.elasticsearch.env.NodeEnvironment.assertEnvIsLocked( ~[elasticsearch-8.7.0.jar:?]
	at org.elasticsearch.env.NodeEnvironment.dataPaths( ~[elasticsearch-8.7.0.jar:?]
	at org.elasticsearch.monitor.fs.FsProbe.stats( ~[elasticsearch-8.7.0.jar:?]
	at org.elasticsearch.monitor.fs.FsService$FsInfoCache.refresh( ~[elasticsearch-8.7.0.jar:?]
	at org.elasticsearch.monitor.fs.FsService$FsInfoCache.refresh( ~[elasticsearch-8.7.0.jar:?]
	at org.elasticsearch.common.util.SingleObjectCache.getOrRefresh( ~[elasticsearch-8.7.0.jar:?]
	at org.elasticsearch.monitor.fs.FsService.lambda$new$1( ~[elasticsearch-8.7.0.jar:?]
	at org.elasticsearch.monitor.fs.FsService.stats( ~[elasticsearch-8.7.0.jar:?]
	at org.elasticsearch.node.NodeService.stats( ~[elasticsearch-8.7.0.jar:?]
	at$DiskCheck.getDiskUsage( ~[elasticsearch-8.7.0.jar:?]
	at$DiskCheck.getHealth( ~[elasticsearch-8.7.0.jar:?]
	at$ ~[elasticsearch-8.7.0.jar:?]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ ~[elasticsearch-8.7.0.jar:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker( ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$ ~[?:?]
	at ~[?:?]


Welcome to the community!

If you’ve verified the file exists, then it’s likely this is a permissions error. Does SonarQube have rights, recursive, to its directory?

Do you have something “helpful”, like Windows Defender or some other virus scanner running on the machine? We’ve seen this type of program lock the files SonarQube needs to operate & that’s why we recommend you not run such things on the machine hosting SonarQube.


Thanks. I shut off Windows Defender and still experience this issue.

After reading other threads on similar issues, I made sure to give permissions to the node.lock file as well and also did a full restart of the machine to make sure nothing was lingering. (saw some other threads that there were issues with processes being hung up in the background, which is not the case here)


I believe it’s still possible that WD left files in a bad state. Can you re-grant the user running SonarQube full permissions, recursive, to the SonarQube directory and try again?