Soanr9.9 in docker cant create sharememory

Make sure to tell us:

  • What version are you upgrading from?
    Sonar 8.2-community
  • System information (Operating system, Java version, Database provider/version)
    Linux(kail), openjdk17.0.6, postgresql13.3, docker-compose version 1.29.2, docker version 20.10.23
  • What’s the issue you’re facing?
    Actually is 2 issue:
    The old sonar is using docker-compose to run, alone with postgresql linked.
    Here is 1st issue, i followed upgrade docker section to stop old sonar and rm it; then manully using provided docker run command to start a new sonar with network attached like this "docker run --name sonarqube1 --network sonar_init_sonarnet -e sonar.jdbc.password=sonar -e sonar.jdbc.username=sonar -e sonar.jdbc.url=jdbc:postgresql://postgres/sonar -v sonarqube_data:/opt/sonarqube/data -v sonarqube_extensions:/opt/sonarqube/extensions -v sonarqube_logs:/opt/sonarqube/logs -p 9000:9000 -d sonarqube:lts-community". Then it running, and not using postgresql but the internal database. I try to ping each other in container its ok, so i dont know what to do next.Is upgrade failed?
    Issue 2nd, i try to using docker compose to create sonar9.9 directly, but it caught a error
2023.04.03 10:04:36 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2023.04.03 10:04:36 ERROR app[][o.s.application.App] Startup failure
java.lang.IllegalArgumentException: Unable to create shared memory :
        at org.sonar.process.sharedmemoryfile.AllProcessesCommands.<init>(AllProcessesCommands.java:103)
        at org.sonar.application.AppFileSystem.reset(AppFileSystem.java:63)
        at org.sonar.application.App.start(App.java:53)
        at org.sonar.application.App.main(App.java:81)
Caused by: java.io.FileNotFoundException: /opt/sonarqube/temp/sharedmemory (Permission denied)
        at java.base/java.io.RandomAccessFile.open0(Native Method)
        at java.base/java.io.RandomAccessFile.open(Unknown Source)
        at java.base/java.io.RandomAccessFile.<init>(Unknown Source)
        at java.base/java.io.RandomAccessFile.<init>(Unknown Source)
        at org.sonar.process.sharedmemoryfile.AllProcessesCommands.<init>(AllProcessesCommands.java:100)
        ... 3 common frames omitted

so…what shoud i do?

Hey there.

Let’s start with getting you up to SonarQube v8.9 LTS.

Make sure you are using the environment variables as documented in the v8.9 LTS documentation (SONAR_JDBC_USERNAME, SONAR_JDBC_PASSWORD and SONAR_JDBC_URL)