GithubHelp home page GithubHelp logo

Comments (5)

patrickmslatteryvt avatar patrickmslatteryvt commented on July 28, 2024 1

What I found when I used a MySQL DB was that the database name had to be sonar, so that might be hardcoded somewhere, I didn't dig into it too far.
For your other error use sh instead of bash as Alpine Linux does not include bash by default:

- docker exec -it sonarqube bash
+ docker exec -it sonarqube sh

from docker-sonarqube.

majinding avatar majinding commented on July 28, 2024

now I running with raw "docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube" is ok
but when I command "docker exec -it sonarqube bash" was error "rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: \"bash\": executable file not found in $PATH""

default

from docker-sonarqube.

Godin avatar Godin commented on July 28, 2024

@patrickmslatteryvt First of all thank you for helping here! This is very much appreciated! โค๏ธ

You're right about bash and Alpine image. ๐Ÿ‘

However as shown below, I cannot reproduce any of problems with MySQL that were mentioned here including

when used a MySQL DB was that the database name had to be sonar, so that might be hardcoded somewhere

Maybe this was about default user and password for DB that are both sonar - see

SONARQUBE_JDBC_USERNAME=sonar \
SONARQUBE_JDBC_PASSWORD=sonar \


After creation of MySQL with database named sq:

docker run --rm \
    --name db \
    -e MYSQL_DATABASE=sq \
    -e MYSQL_ROOT_PASSWORD=root-password \
    -e MYSQL_USER=user \
    -e MYSQL_PASSWORD=user-password \
    mysql

SonarQube succesfully connects to it:

docker run --rm \
    --link db:db \
    -e SONARQUBE_JDBC_URL="jdbc:mysql://db/sq?useUnicode=true&characterEncoding=utf8" \
    -e SONARQUBE_JDBC_USERNAME=user \
    -e SONARQUBE_JDBC_PASSWORD=user-password \
    sonarqube

as log shows:

...
2017.08.15 18:29:50 INFO  web[][o.sonar.db.Database] Create JDBC data source for jdbc:mysql://db/sq?useUnicode=true&characterEncoding=utf8
...
2017.08.15 18:29:52 INFO  web[][DbMigrations] Executing DB migrations...
2017.08.15 18:29:52 INFO  web[][DbMigrations] #1 'Create initial schema'...
2017.08.15 18:29:53 INFO  web[][DbMigrations] #1 'Create initial schema': success | time=1698ms
2017.08.15 18:29:53 INFO  web[][DbMigrations] #2 'Populate initial schema'...
...

@majinding

was not work

what was in log?

from docker-sonarqube.

patrickmslatteryvt avatar patrickmslatteryvt commented on July 28, 2024

@Godin You are correct, I tried to replicate the issue with my Ansible deployment scripts and was not able to make the Sonarqube install break when I changed the MySQL DB name.
I know I did have issues with this when I wrote the deployment scripts as I put this line in:

      mysql_database: sonar  # THE DB _MUST_ BE CALLED "sonar"

But it all works now! :-)

A few minor differences I had were that:

  1. I used networks rather than links (which are deprecated) but that shouldn't break it
  2. I used the MySQL image from Oracle (mysql/mysql-server)
  3. I used Sonarqube v6.4 rather than v6.5, I tested with both just now and they both connect to MySQL DBs with names other than sonar
docker image pull mysql/mysql-server:5.7
docker image pull sonarqube:6.4
docker image pull sonarqube:6.5
docker network create sonarqube

docker run \
  -it \
  --rm \
  --name db \
  --env MYSQL_DATABASE=sq \
  --env MYSQL_ROOT_PASSWORD=root-password \
  --env MYSQL_USER=user \
  --env MYSQL_PASSWORD=user-password \
  --network=sonarqube \
  mysql/mysql-server:5.7

docker run \
  -it \
  --rm \
  --env SONARQUBE_JDBC_URL="jdbc:mysql://db/sq?useUnicode=true&characterEncoding=utf8&useSSL=false" \
  --env SONARQUBE_JDBC_USERNAME=user \
  --env SONARQUBE_JDBC_PASSWORD=user-password \
  --network=sonarqube \
  sonarqube:6.4

  2017.08.15 20:43:02 INFO  web[][o.s.s.p.d.m.AutoDbMigration] Automatically perform DB migration on fresh install
  2017.08.15 20:43:02 INFO  web[][DbMigrations] Executing DB migrations...
  2017.08.15 20:43:02 INFO  web[][DbMigrations] #1 'Create initial schema'...
  2017.08.15 20:43:03 INFO  web[][DbMigrations] #1 'Create initial schema': success | time=712ms
  2017.08.15 20:43:03 INFO  web[][DbMigrations] #2 'Populate initial schema'...
  2017.08.15 20:43:03 INFO  web[][DbMigrations] #2 'Populate initial schema': success | time=55ms
  <snip>
  2017.08.15 20:43:31 INFO  app[][o.s.a.SchedulerImpl] SonarQube is up

from docker-sonarqube.

majinding avatar majinding commented on July 28, 2024

I'm sorry, I didn't know how to check the log before the container started

Now the reason for the problem has been found, because the mysql5.1 version is too low
image

Thanks @patrickmslatteryvt , @Godin

from docker-sonarqube.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.