While installing SonarQube 8.2 (sonarqube:8.2-community) in Kubernetes cluster, I am getting the below error .
Caused by: java.nio.file.AccessDeniedException: /opt/sonarqube/data/es6
at sun.nio.fs.UnixException.translateToIOException(Unknown Source) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source) ~[?:?]
at sun.nio.fs.UnixFileSystemProvider.createDirectory(Unknown Source) ~[?:?]
at java.nio.file.Files.createDirectory(Unknown Source) ~[?:?]
at java.nio.file.Files.createAndCheckIsDirectory(Unknown Source) ~[?:?]
at java.nio.file.Files.createDirectories(Unknown Source) ~[?:?]
Postgres is running perfectly fine and I was able to run the SonarQube version 7.1 . But while running a pod with version 7.9 and above I am facing this issue.
I tried to give full permission for the directory using dockerfile like below:
FROM sonarqube:8.2-community
USER sonarqube
RUN chmod 777 /opt/sonarqube/data -R
But this didnt help. When I tried with root user, it throws error like “ElasticSearch cannot run as root”
Can anyone let me know how to do a fresh installation of SonarQube 8.0+ in Kubernetes.