SonarQube docker keeps stopping - docker

I am testing out SonarQube locally on my machine using docker, however the docker container keeps stopping, not sure why this is the case. Am using Mac and am not sure if the Java version affects SonarQube but am running Java version 11 on my machine.
These are the logs I am getting
2021.07.22 16:49:46 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2021.07.22 16:49:46 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:39173]
2021.07.22 16:49:46 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2021.07.22 16:49:47 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2021.07.22 16:49:47 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2021.07.22 16:49:47 INFO app[][o.s.a.SchedulerImpl] Process[es] is stopped
2021.07.22 16:49:47 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
This is the command I used to run the docker container
docker run --name sonarqube --restart always -p 9000:9000 -d sonarqube
What am I missing?

I updated the version of docker on my machine to the latest(Been skipping for almost a year) and it worked

Related

docker sonarqube process exited with exit value [ElasticSearch]: 1

I tried to install sonarqube with docker like below
sudo docker pull sonarqube
sudo docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube
when i run sudo docker ps -a the status always exited
CONTAINER ID IMAGE COMMAND STATUS PORTS
c76d3a0ee7db sonarqube "/opt/sonarqube/bin/…" Exited (0) 26 seconds ago
aa6eebb7d9d5 docker.elastic.co/elasticsearch/elasticsearch:8.6.0 "/bin/tini -- /usr/l…" Up 2 minutes 0.0.0.0:9200->9200/tcp, 9300/tcp
the docker logs
2023.01.20 08:13:04 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2023.01.20 08:13:04 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:33739]
2023.01.20 08:13:04 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [/opt/sonarqube/elasticsearch]:
/opt/sonarqube/elasticsearch/bin/elasticsearch
could not find java in ES_JAVA_HOME at
/usr/lib/jvm/java-17-openjdk/bin/java
2023.01.20 08:13:04 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 1
2023.01.20 08:13:04 INFO app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2023.01.20 08:13:04 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2023.01.20 08:13:04 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped

Want to upgrade my docker from 19.03.5 to latest where many countainers are running

I am new to docker and linux. I am running docker 19.03.5. I had sonarqube 7.9.2 installed but I had to upgrade the sonarqube. After the upgrade I hit this issue. Now as per my understaning I don't have any choice but to upgrade docker too. Docker has many contaniers running and I am afraid that this upgrade will effect others work- Any suggestion are welcome!
After a search I get that all the containers will restart after docker start but I still want to confirm if there is anything I should keep in mind?
Issue to resolve is:
After upgrade the sonarqube contanier close with error
Dropping Privileges
2022.05.02 12:18:50 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2022.05.02 12:18:50 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:36393]
2022.05.02 12:18:50 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
could not find java in ES_JAVA_HOME at /usr/lib/jvm/java-11-openjdk/bin/java
2022.05.02 12:18:50 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 1
2022.05.02 12:18:50 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2022.05.02 12:18:50 INFO app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2022.05.02 12:18:50 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
[1]: https://github.com/SonarSource/docker-sonarqube/issues/493
[1]: https://github.com/SonarSource/docker-sonarqube/issues/493
and to solve this I have to upgrade Docker as mentioned here. I am open for any other way to solve the issue.

Sonarqube docker container fails to restart, offline

Background: I have a system behind a proxy/firewall. I can access docker to pull images, but do not have a username/password to access any other sites. Therefore my docker container of sonarqube is essentially offline.
Question: The docker container starts fine the first time, but fails to restart. This happens in two instances, either a manually installed plugin presents an error that it fails to download the update-center url, or it simply starts shutting down immediately as it starts. Both fail the application which closes the container. I do not seem to be able (or understand how to) modify the sonar.properties to get the update-center disabled and need guidance.
I have inquired on the github for the container without much help: https://github.com/SonarSource/docker-sonarqube/issues/76#issuecomment-364563967 The '-Dsonar.updatecenter.activate=false' option does not work when I try it.
Simply shutting down
2018.02.09 21:45:38 INFO ce[][o.s.p.ProcessEntryPoint] Starting ce
2018.02.09 21:45:38 INFO ce[][o.s.ce.app.CeServer] Compute Engine starting up...
2018.02.09 21:45:39 INFO ce[][o.e.p.PluginsService] no modules loaded
2018.02.09 21:45:39 INFO ce[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.index.reindex.ReindexPlugin]
2018.02.09 21:45:39 INFO ce[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
2018.02.09 21:45:39 INFO ce[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
2018.02.09 21:45:39 INFO ce[][o.e.p.PluginsService] loaded plugin org.elasticsearch.transport.Netty4Plugin]
2018.02.09 21:45:41 INFO ce[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
2018.02.09 21:45:41 INFO ce[][o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://pgsonar:5432/sonar
2018.02.09 21:45:43 INFO ce[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonarqube
2018.02.09 21:45:43 INFO ce[][o.s.c.c.CePluginRepository] Load plugins
2018.02.09 21:45:45 INFO ce[][o.s.c.q.PurgeCeActivities] Delete the Compute Engine tasks created before Sun Aug 13 21:45:45 UTC 2017
2018.02.09 21:45:45 INFO ce[][o.s.ce.app.CeServer] Compute Engine is operational
2018.02.09 21:45:45 INFO app[][o.s.a.SchedulerImpl] Process[ce] is up
2018.02.09 21:45:45 INFO app[][o.s.a.SchedulerImpl] SonarQube is up
2018.02.09 21:47:12 INFO app[][o.s.a.SchedulerImpl] Stopping SonarQube
2018.02.09 21:47:13 INFO ce[][o.s.p.StopWatcher] Stopping process
2018.02.09 21:47:13 INFO ce[][o.s.ce.app.CeServer] Compute Engine is stopping...
2018.02.09 21:47:13 INFO ce[][o.s.c.t.CeProcessingSchedulerImpl] Waiting for workers to finish in-progress tasks
2018.02.09 21:47:14 INFO ce[][o.s.ce.app.CeServer] Compute Engine is stopped
2018.02.09 21:47:15 INFO app[][o.s.a.SchedulerImpl] Process [ce] is stopped
2018.02.09 21:47:15 INFO web[][o.s.p.StopWatcher] Stopping process
2018.02.09 21:47:18 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped
2018.02.09 21:47:18 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2018.02.09 21:47:18 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
2018.02.09 21:47:18 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
chown: cannot access '/opt/sonarqube/temp/README.txt': No such file or directory
Will update with the fail to download later (no access to logs at this exact moment)
Regarding the README.txt issue, you have to create a volume and mount the temp folder (note that I use the postgres setup from anorak:girl). You can then start and stop with no problems.
sudo docker volume create sonarqube-temp
sudo docker run -d --name sonarqube --link sonar-postgres:pgsonar -p 9000:9000 -e SONARQUBE_JDBC_USERNAME=sonar -e SONARQUBE_JDBC_PASSWORD='secure' -e SONARQUBE_JDBC_URL=jdbc:postgresql://pgsonar:5432/sonar -v sonarqube-temp:/opt/sonarqube/temp sonarqube:lts
Regarding the UpdateCenter issue, workaround is to specify a configuration with the run command (this is specific to Godin's docker container for sonarqube - through his run.sh script):
sudo docker run -d --name sonarqube --link sonar-postgres:pgsonar -p 9000:9000 -e SONARQUBE_JDBC_USERNAME=sonar -e SONARQUBE_JDBC_PASSWORD='secure' -e SONARQUBE_JDBC_URL=jdbc:postgresql://pgsonar:5432/sonar -v sonarqube-temp:/opt/sonarqube/temp sonarqube:lts -Dsonar.updatecenter.activate=false

SonarQube docker container can't start, elasticsearch issue

I'm trying to run official SonarQube Docker container locally. I'm using the command provided here:
https://hub.docker.com/_/sonarqube/
It exits about 1 minute after it was started. Logs are reporting Elasticsearch connectivity issue
2017.09.05 08:16:40 INFO web[][o.e.client.transport] [Edwin Jarvis] failed to connect to node [{#transport#-1}{127.0.0.1}{127.0.0.1:9001}], removed from nodes list
org.elasticsearch.transport.ConnectTransportException: [][127.0.0.1:9001] connect_timeout[30s]
.....
Caused by: java.net.ConnectException: Connection refused: /127.0.0.1:9001
.....
... 3 common frames omitted
2017.09.05 08:17:10 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped
2017.09.05 08:17:10 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
Turns out SonarQube container didn't have enough resources. I shut down other docker containers and it works for me now.

Using Docker with Sensu

i am a Novice in Docker and wanted to use Sensu for monitoring containers. I have set up a Sensu server and Sensu client ( where my Docker containers are running ) using the below material:
Click [here] (http://devopscube.com/monitor-docker-containers-guide/)
I get the Sensu client information in Uchiwa Dashboard while running the below command:
docker run -d --name sensu-client --privileged \
-v $PWD/load-docker-metrics.sh:/etc/sensu/plugins/load-docker-metrics.sh \
-v /var/run/docker.sock:/var/run/docker.sock \
usman/sensu-client SENSU_SERVER_IP RABIT_MQ_USER RABIT_MQ_PASSWORD CLIENT_NAME CLIENT_IP
However, when i try to fire a new container from the same host machine , i do not get the information of the client in Uchiwa Dashboard.
It would be great if anyone have used Sensu with Docker to monitor Docker containers can guide on the same.
Thanks for the time.
Please logs of the sensu-client
'Supervisord is running as root and it is searching '
2017-01-09 04:11:47,210 CRIT Supervisor running as root (no user in config file)
2017-01-09 04:11:47,212 INFO supervisord started with pid 12
2017-01-09 04:11:48,214 INFO spawned: 'sensu-client' with pid 15
2017-01-09 04:11:49,524 INFO success: sensu-client entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-01-09 04:11:49,530 INFO exited: sensu-client (exit status 0; expected)
[ec2-user#ip-172-31-0-89 sensu-client]$ sudo su
[root#ip-172-31-0-89 sensu-client]# docker logs sensu-client
/usr/lib/python2.6/site-packages/supervisor-3.1.3-py2.6.egg/supervisor/options.py:296: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (
including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
'Supervisord is running as root and it is searching '
2017-01-09 04:11:47,210 CRIT Supervisor running as root (no user in config file)
2017-01-09 04:11:47,212 INFO supervisord started with pid 12
2017-01-09 04:11:48,214 INFO spawned: 'sensu-client' with pid 15
2017-01-09 04:11:49,524 INFO success: sensu-client entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-01-09 04:11:49,530 INFO exited: sensu-client (exit status 0; expected)

Resources