Sonarqube_1 | Error: Unable to access jarfile lib/sonar-application-9.4.0.54424.jar

We have noticed in our current project that Sonarqube is no longer working for coworkers that are running macOS Monterey (v 12.3.1) using docker-compose, however we can run it with docker only without compose.

This is our script:

    "presonar:run": "docker-compose -f docker-compose.sonar.yml up -d && node wait-on-sonar.js",
    "sonar:run": "sonar-scanner -Dsonar.projectKey=service -Dsonar.sources=. -Dsonar.host.url=http://localhost:9000 -Dsonar.login=admin -Dsonar.password=admin"

Following error:

Starting service_sonarqube_1 ... done
Attaching to service_sonarqube_1
sonarqube_1  | Dropping Privileges
sonarqube_1  | Error: Unable to access jarfile lib/sonar-application-9.4.0.54424.jar

docker-compose.sonar.yml

version: '3'
volumes:
  sonarq:
    driver_opts:
      type: none
      device: '${HOME}/sonarq'
      o: bind
services:
  sonarqube:
    image: sonarqube:latest
    ports:
      - '9000:9000'
    volumes:
      - sonarq:/opt/sonarqube

Must-share information (formatted with Markdown):

  • sonarqube:latest
  • run sonarqube
  • what have you tried so far to achieve this

Hi,

Welcome to the community!

When you say MacOS Monterey, is this on the M1 architecture? Because there are some changes we need to make to support that.

 
Ann

Thanks for the quick response on this!

I checked with the team and everyone are running mac with intel processors.

Please let me know if you need any other information from us :slight_smile:

Hi,

Thanks for the update. I’m going to pass this to the team for a deeper look.

 
Ann

hi @ollebergkvist ,

Our documentation shows this volume configuration:

    volumes:
      - sonarqube_data:/opt/sonarqube/data
      - sonarqube_extensions:/opt/sonarqube/extensions
      - sonarqube_logs:/opt/sonarqube/logs

I suspect your volume mapping is overwriting everything in /opt/sonarqube including all the binaries