I’m trying to create docker container with SonarQube inside it, but I get this error while composing for the first time:
Caused by: java.util.concurrent.ExecutionException: org.apache.lucene.index.CorruptIndexException: checksum failed (hardware problem?) : expected=f736ed01 actual=298dcde2 (resource=BufferedChecksumIndexInput(NIOFSIndexInput(path="/opt/sonarqube/data/es7/nodes/0/_state/_7w.fdt")))
I tried installing it on a fresh instance with fresh docker installation, I even tried to install it on a different server to rule out hardware failure, and I still get the same error. What could be the cause of it?
docker-compose.yml
version: "3"
services:
sonarqube:
image: sonarqube:community
depends_on:
- db
environment:
SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
SONAR_JDBC_USERNAME: sonar
SONAR_JDBC_PASSWORD: sonar
volumes:
- sonarqube_data:/opt/sonarqube/data
- sonarqube_extensions:/opt/sonarqube/extensions
- sonarqube_logs:/opt/sonarqube/logs
ports:
- "9000:9000"
db:
image: postgres:12
environment:
POSTGRES_USER: sonar
POSTGRES_PASSWORD: sonar
volumes:
- postgresql:/var/lib/postgresql
- postgresql_data:/var/lib/postgresql/data
volumes:
sonarqube_data:
sonarqube_extensions:
sonarqube_logs:
postgresql:
postgresql_data:
3
Answers
Solved it by using
image: sonarqube:9.2.4-developer
Updated answer (august 2022)
Problem is fixed in the official v9.6 image.
Updated answer (june 2022)
I was able to build a working image by using this Dockerfile:
(credits to this Github comment)
Original answer (april 2022)
As stated in this issue from the Docker-Sonarqube repository:
This bug appeared when the alpine base image has been updated to 3.14.5+. So you have two choices for now:
If its running docker inside a vm, try to enable nested virtualization for the vm.
Link to understand nested virt (https://cloud.google.com/compute/docs/instances/nested-virtualization/overview)