Whenever i try to start a Sonarqube Developer Docker Container, i get the following Errors:
main ERROR Unable to create file /opt/sonarqube/logs/es.log java.io.IOException: Permission deniedERROR es[][o.e.b.ElasticsearchUncaughtExceptionHandler] uncaught exception in thread [main] org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Unable to access 'path.logs' (/opt/sonarqube/logs)java.lang.IllegalStateException: Unable to access 'path.logs' (/opt/sonarqube/logs)
(also in that Order)
It seems like, Sonarqube can’t access any paths that are mounted to a Docker Volume.
This is the Compose Stack:
version: '3.6'
volumes:
sonarqube-db-db:
sonarqube-db-data:
sonarqube-data:
sonarqube-extensions:
sonarqube-logs:
networks:
int-sonarqube:
services:
Sonarqube-DB:
image: postgres:13
hostname: sonarqube-db
container_name: Sonarqube-DB
environment:
POSTGRES_USER: ${PGSQL_USER}
POSTGRES_PASSWORD: ${PGSQL_PASSWORD}
POSTGRES_DB: ${PGSQL_DB}
volumes:
- sonarqube-db-db:/var/lib/postgresql:rw
- sonarqube-db-data:/var/lib/postgresql/data:rw
networks: [int-sonarqube]
Sonarqube:
image: sonarqube:9-developer
hostname: sonarqube
container_name: Sonarqube
depends_on: [Sonarqube-DB]
networks: [int-sonarqube]
ports:
- ${SONAR_PORT}:9000
environment:
SONAR_JDBC_URL: jdbc:postgresql://sonarqube-db:5432/${PGSQL_DB}
SONAR_JDBC_USERNAME: ${PGSQL_USER}
SONAR_JDBC_PASSWORD: ${PGSQL_PASSWORD}
volumes:
- sonarqube-data:/opt/sonarqube/data:rw
- sonarqube-extensions:/opt/sonarqube/extensions:rw
- sonarqube-logs:/opt/sonarqube/logs:rw
Docker File was derived from official Example at GitHub: docker-sonarqube/example-compose-files/sq-with-postgres/docker-compose.yml at master · SonarSource/docker-sonarqube (github.com)
I already tried different “Modes” for the Volumes. “rw”, “z”, nothing. Even tried “ro” to maybe provoke a different error, but no such luck.
I also ran those commands on the Host Machine based on the Official Documentation:
sysctl -w vm.max_map_count=524288sysctl -w fs.file-max=131072ulimit -n 131072ulimit -u 8192
I do not really understand what i’m doing wrong here, can anyone help?