Sonar-Postgres Docker问题

时间:2018-01-20 08:12:01

标签: postgresql docker sonarqube sonarqube-ops

我正在尝试使用声纳和postgres容器。下面是我的docker-compose文件

sonarqube:
  image: sonar-master
  ports:
   - "9000:9000"
  links:
   - db:db
  environment:
   - SONARQUBE_JDBC_URL=jdbc:postgresql://db:5432/sonar
   - SONARQUBE_JDBC_USERNAME=sonar
   - SONARQUBE_JDBC_PASSWORD=sonar
db:
  image: postgres:9.5.3
  ports:
  - "5432:5432"
  environment:
  - POSTGRES_USER=sonar
  - POSTGRES_PASSWORD=sonar

当我尝试点击声纳网址时,我在浏览器中获得以下堆栈跟踪

org.jruby.rack.RackInitializationException: no connection available
from arjdbc/jdbc/RubyJdbcConnection.java:517:in `set_native_database_types'
  from /opt/sonarqube-4.3.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/connection.rb:61:in `initialize'
from /opt/sonarqube-4.3.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:31:in `initialize'
from /opt/sonarqube-4.3.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/connection_methods.rb:6:in `jdbc_connection'
from org/jruby/RubyKernel.java:2227:in `send'
from /opt/sonarqube-4.3.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'
from /opt/sonarqube-4.3.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
from /opt/sonarqube-4.3.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout'
from org/jruby/RubyKernel.java:1519:in `loop'
from /opt/sonarqube-4.3.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `checkout'
from jar:file:/opt/sonarqube-4.3.2/web/WEB-INF/lib/jruby-complete-1.7.9.jar!/META-INF/jruby.home/lib/ruby/1.8/monitor.rb:191:in `mon_synchronize'
from /opt/sonarqube-4.3.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout'
from /opt/sonarqube-4.3.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection'
from /opt/sonarqube-4.3.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'
from /opt/sonarqube-4.3.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'
from /opt/sonarqube-4.3.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'
from /opt/sonarqube-4.3.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:440:in `initialize'
from /opt/sonarqube-4.3.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:401:in `up'
from /opt/sonarqube-4.3.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:383:in `migrate'
from /opt/sonarqube-4.3.2/web/WEB-INF/lib/database_version.rb:62:in `upgrade_and_start'
from /opt/sonarqube-4.3.2/web/WEB-INF/lib/database_version.rb:74:in `automatic_setup'
from /opt/sonarqube-4.3.2/web/WEB-INF/config/environment.rb:239:in `(root)'
from org/jruby/RubyKernel.java:1094:in `load'
from file:/opt/sonarqube-4.3.2/web/WEB-INF/lib/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:1:in `(root)'
from file:/opt/sonarqube-4.3.2/web/WEB-INF/lib/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:25:in `load_environment'
from file:/opt/sonarqube-4.3.2/web/WEB-INF/lib/jruby-rack-1.1.13.2.jar!/jruby/rack/rails_booter.rb:79:in `load_environment'

似乎声纳无法连接到postgres。而且我无法在docker日志中找到任何细节。请帮我确定问题。

0 个答案:

没有答案