How Do You Troubleshoot the SonarScanner Error “java.lang.IllegalStateException: Failed to create lock in /opt/app/sonar-scanner/conf/…sonar_locak…DirectoryLock…”?

Problem scenario
You try to run sonarscanner from a command prompt.  But you get this message:

"java.lang.IllegalStateException: Failed to create lock in /opt/app/sonar-scanner/conf/...sonar_locak...DirectoryLock..."

What should you do?

Become a different user to run the sonarscanner command or use "sudo " before your command.

Leave a comment

Your email address will not be published. Required fields are marked *