Sonarqube Docker Container exits after every reboot

Sonarqube running as docker container in ubuntu 18.04
Docker-compose .yml file looks like

Everything was working fine but recently its getting exited when we reboot the machine .

We have enabled systemctl docker service as well .

Help me to fix this !

Hi @Kirupakaran,

What do the logs say why the service stops?

Hi ,
Thank you for your response.
Attaching the logs for exited sonarqube:community container .
sonarlogs.zip (9.9 KB)

Let me know any other details required

java.lang.IllegalArgumentException: Password must be different from old password

Did you already try setting the admin password to something else than “admin”?
In general I would assume that this would not crash the application but this looks like it

Yes changed the passwd from admin .
This will create a problem during reboot ?

Tried to spinup new container for sonarqube . Again its exiting after machine reboot.
We didn’t face this issue previously .
Came across this error in logs

May be this is the reason for exiting not sure !

Nah if you take a look at the logs you provided you can clearly see that sq stops because it encountered a illegal state, which is the admin password is changed to the default one.
I would try to reset the admin password via the database (see docs how to do that: Security | SonarQube Docs ) and see if sq starts afterwards. If it does, change it to something else than the default

username - admin
passwd - not as default (default - admin)
Passwd is not default we have changed it after 1st time login .
Still getting this error .
Any idea ?

But sq starts after the password reset? And it still stops with the same illegal state exception?

Sq starting & running fine without issues .
only when rebooting the machine it gets exits .

Okay maybe I am misunderstanding your issue. So sonarqube runs when you start the stack manually but it does not start automatically after a system reboot? If this is the case you are probably missing a restart policy in your compose file: Compose file version 3 reference | Docker Documentation

I was under the impression that sonarqube was not starting at all and was searching for an exception in the logs

Yes . Thank you for your response !.
Let me try adding restart policy & verify once .

This is my upated docker-compose file
version: “3”

services:
sonarqube:
image: sonarqube:community
deploy:
restart_policy:
condition: always
delay: 5s
max_attempts: 3
window: 120s
depends_on:
- db
environment:
SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
SONAR_JDBC_USERNAME: sonar
SONAR_JDBC_PASSWORD: sonar
volumes:
- /opt/sonarqube/sonarqube_data:/opt/sonarqube/data
- /opt/sonarqube/sonarqube_extensions:/opt/sonarqube/extensions
- /opt/sonarqube/sonarqube_logs:/opt/sonarqube/logs
ports:
- “9000:9000”
db:
image: postgres:12
deploy:
restart_policy:
condition: always
delay: 5s
max_attempts: 3
window: 120s
environment:
POSTGRES_USER: sonar
POSTGRES_PASSWORD: sonar
volumes:
- /opt/sonarqube/postgresql:/var/lib/postgresql
- /opt/sonarqube/postgresql_data:/var/lib/postgresql/data

volumes:
sonarqube_data:
sonarqube_extensions:
sonarqube_logs:
postgresql:
postgresql_data:

You see could i have added the restart policy .
But again after reboot its exited and not in running state.

Attaching the logs of sq & postgres containers.

postgres logs.zip (910 Bytes)
sq logs.zip (5.0 KB)

@DefinitelyNotTobi Any idea !

what would be the version of your docker and compose installation? This seems more related to a issue with the container runtime and not with sonarqube. are other containers on the same system working as intended?

Docker & docker-compose version
image

What is this the RCA for this !
Please let me know what to do further

This version of docker compose was released in 2017, so nearly 5 years ago. You should update.

Also can you answer the other question? Do other container on the same system work as expected after a reboot?

Yes its working now .
Docker containers are running after reboot.
After upgrading the docker-compose version its working.

No there no other docker container running currently .

Thanks a lot for your support !

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.