Sonarqube + Postgresql 容器无法确定数据库方言

Sonarqube + Postgresql containers unable to determine database dialect

我在 docker 群中为 运行 Sonarqube 定义了 2 个服务:

version: "3"

services:

sonar-a:
    image: library/sonarqube:6.7.5
    ports:
      - "9000:9000"
    environment:
     - SONARQUBE_JDBC_USERNAME=sonar
     - SONARQUBE_JDBC_PASSWORD=sonar
     - SONARQUBE_JDBC_URL="jdbc:postgresql://10.11.12.13:5432/sonar"
    deploy:
      placement:
        constraints:
          - node.hostname == some-node

  sonar-a-db:
    image: library/postgres:10.5
    ports:
      - "5432:5432"
    environment:
     - POSTGRES_USER=sonar
     - POSTGRES_PASSWORD=sonar
     - POSTGRES_DB=sonar
    deploy:
      placement:
        constraints:
          - node.hostname == some-node

(我删除了卷以简化测试)

但我总是收到这个错误,告诉我声纳不能 "determine database dialect" :

...

2018.09.28 15:22:42 INFO web[][o.s.p.ProcessEntryPoint] Starting web

2018.09.28 15:22:42 INFO web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read

2018.09.28 15:22:42 INFO web[][o.e.p.PluginsService] no modules loaded

2018.09.28 15:22:42 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]

2018.09.28 15:22:42 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]

2018.09.28 15:22:42 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]

2018.09.28 15:22:43 INFO web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]

2018.09.28 15:22:43 INFO web[][o.s.s.p.LogServerVersion] SonarQube Server / 7.1.0.11001 / 9f47ce9daecebb16fc777249a418252625ae774a

2018.09.28 15:22:43 ERROR web[][o.s.s.p.Platform] Web server startup failed: Unable to determine database dialect to use within sonar with dialect null jdbc url "jdbc:postgresql://10.4.140.56:5432/sonar"

2018.09.28 15:22:48 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped ...

我尝试了不同的版本,我尝试了 mysql,我尝试在 SONARQUBE_JDBC_URL 中传递一个方言变量,但没有任何改变 有什么想法吗?

YAML 中的字符串应在不带引号的情况下定义。现在你的 JDBC URL 等于 "jdbc:postgresql://10.11.12.13:5432/sonar" 而不是 jdbc:postgresql://10.11.12.13:5432/sonar.

你必须改变这个:

- SONARQUBE_JDBC_URL="jdbc:postgresql://10.11.12.13:5432/sonar"

至:

- SONARQUBE_JDBC_URL=jdbc:postgresql://10.11.12.13:5432/sonar