我试图在Ubuntu 14.04 64位上将Sonarqube从4.5升级到4.5.1。软件包管理器服务于新版本,它显然安装没有任何问题。但是,当我尝试访问Web UI时,它会将我带到需要升级数据库的页面。所以我转到 my_sonar_server / setup 页面并单击升级。几秒钟后,出现以下消息
感叹号无法升级数据库
迁移失败:发生错误,以后所有迁移都被取消:ActiveRecord :: ConnectionNotEstablished:无可用连接:alter table snapshot_sources modify data longtext。 请检查日志。
sonar.log有以下异常
2014.11.10 10:04:38 INFO web [DbMigration] MysqlMediumtextToLongtext:迁移
2014.11.10 10:04:42 ERROR web [o.s.s.ui.JRubyFacade]无法升级数据库发生错误,以后所有迁移都被取消:
ActiveRecord :: ConnectionNotEstablished:没有可用的连接:alter table snapshot_sources修改数据longtext /opt/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:227:in
log' /opt/sonar/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:183:in
执行' /opt/sonar/web/WEB-INF/db/migrate/600_mysql_mediumtext_to_longtext.rb:42:inapply' /opt/sonar/web/WEB-INF/db/migrate/600_mysql_mediumtext_to_longtext.rb:30:in
起来' org / jruby / RubyKernel.java:2223:insend' /opt/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:282:in
migrate' 罐子:文件:/opt/sonar/lib/server/jruby-complete-1.7.9.jar /META-INF/jruby.home/lib/ruby/1.8/benchmark.rb:293:在measure' /opt/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:282:in
迁移' org / jruby / RubyKernel.java:2227:insend' /opt/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:365:in
migrate' /opt/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:491:inmigrate' org/jruby/RubyProc.java:290:in
呼叫' org / jruby / RubyProc.java:224:在call' /opt/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:567:in
ddl_transaction' /opt/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:490:inmigrate' org/jruby/RubyArray.java:1613:in
各' /opt/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:477:inmigrate' /opt/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:401:in
起来' /opt/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:383:inmigrate' /opt/sonar/web/WEB-INF/lib/database_version.rb:62:in
upgrade_and_start' /opt/sonar/web/WEB-INF/app/models/database_migration_manager.rb:109:instart_migration' org/jruby/RubyProc.java:290:in
呼叫' org / jruby / RubyProc.java:228:在`call'
非常感谢任何帮助!
由于
答案 0 :(得分:3)
问题是其中一个表(snapshot_sources
)在某些时候被破坏了,大概是我们克隆了我们的生产服务器以获得测试服务器。
当我尝试通过phpmyadmin或命令行访问该特定表上的特定行时,数据库连接丢失(mysqld
进程自行重启)。我调查了问题的根源(通过挖掘/var/log/mysql/error.log
)和我们的IT团队,并得出了上述结论。
因此,由于迁移试图改变snapshot_sources
表以将data
字段从mediumtext
转换为longtext
,因此数据库的迁移因此而中断truncate
我修复它的方式是:
希望这可以帮助其他人,或者至少它是Sonar团队的一个主管。
答案 1 :(得分:-1)
日志足够明确:ConnectionNotEstablished
。这意味着您尚未正确配置SonarQube实例以访问数据库...