SonarQube Docker Installation CorruptIndexException: checksum failed

Viewed 1361

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

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:

FROM sonarqube:community
USER root
RUN apk add --no-cache --upgrade 'zlib>=1.2.12-r1';
USER sonarqube

(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:

  • Either rollback Sonarqube 9.2.4 (prior versions have the Log4J vulnerability)
  • Re-build the latest Sonarqube image yourself with alpine version set to 3.14.3 (as explained in this comment)

Solved it by using image: sonarqube:9.2.4-developer

Related