Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After container restart quality rules disappear #75

Closed
ranying666 opened this issue Apr 17, 2017 · 4 comments
Closed

After container restart quality rules disappear #75

ranying666 opened this issue Apr 17, 2017 · 4 comments
Labels

Comments

@ranying666
Copy link

sonarqube:6.1
First time start container everythis is ok.
When I restart container,all quality rules disappear.
But scan results still exist.
Why?
Dockerfile:
VOLUME "/opt/sonarqube/data"

@jonmosco
Copy link

I am experiencing this issue as well with 5.6.6 LTS.

@Godin
Copy link
Member

Godin commented Jul 13, 2017

@ranying666 @jonmosco What are the exact steps to reproduce this?

I'm asking because can't reproduce:

$ docker version
Client:
 Version:      17.06.0-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:31:53 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      17.06.0-ce
 API version:  1.30 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:51:55 2017
 OS/Arch:      linux/amd64
 Experimental: true

$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
sonarqube           5.6.6               87a7536c1a6b        5 days ago          872MB

$ docker run -d --name sonarqube -p 9000:9000 sonarqube:5.6.6

$ docker restart sonarqube

$ docker stop sonarqube

$ docker start sonarqube

$ docker logs sonarqube | grep -E "Web server is (stopped|started)"
2017.07.13 10:29:33 INFO  web[o.s.s.a.TomcatAccessLog] Web server is started
2017.07.13 10:31:14 INFO  web[o.s.s.a.TomcatAccessLog] Web server is stopped
2017.07.13 10:31:46 INFO  web[o.s.s.a.TomcatAccessLog] Web server is started
2017.07.13 10:32:12 INFO  web[o.s.s.a.TomcatAccessLog] Web server is stopped
2017.07.13 10:32:52 INFO  web[o.s.s.a.TomcatAccessLog] Web server is started

Rules are shown in UI as well as in query of web service after such restarts:

$ curl http://localhost:9000/api/rules/search | grep -E -o "\"total\":[0-9]*"
"total":913

@Godin Godin added the invalid label Jul 13, 2017
@simonbrandhof
Copy link

The thread https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/sonarqube/tnSz1ugaYf0/XFjuuu-NBwAJ provides more details. To sum-up:

  • unexpected shutdown may come from Azure
  • plugins should be extracted from the container by mapping the directory extensions/plugin outside the container. That deserves the directory to be published in Dockerfile as a volume.

@Godin
Copy link
Member

Godin commented Jul 26, 2017

@simonbrandhof thank you for the information about Azure.

Regarding

plugins should be extracted from the container by mapping the directory extensions/plugin outside the container. That deserves the directory to be published in Dockerfile as a volume.

We removed declaration of volume for directory extensions in 80366e3 for the very good reasons after discussion in docker-library/official-images#2437 (comment)

And AFAIK absence of explicit declaration of volume does not prevent externalization of this directory:

$ docker run -v /tmp/sonarqube/extensions:/opt/sonarqube/extensions sonarqube

or using docker-compose:

version: "2"

services:
  sonarqube:
    image: sonarqube
    volumes:
      - ./extensions:/opt/sonarqube/extensions

So I'm closing this ticket.

In case of problems with infrastructure (as with Azure), please consider contacting service provider.

@Godin Godin closed this as completed Jul 26, 2017
@Godin Godin mentioned this issue Aug 5, 2017
@SonarSource SonarSource locked as resolved and limited conversation to collaborators Jan 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants