When run “sonar-runer” throw exception :“Caused by: Unknown database status: FRESH_INSTALL”

孤街醉人 提交于 2019-12-24 02:43:00

问题


I need help

First , it throw exception

cannot load class 'com.mysql.xxx.JDBC'",so I copy the sonarqube-4.0/extensions/jdbc-driver/mysql/mysql-connector-java-5.1.26.jar to the /usr/lib/jvm/java-7-sun/jre/lib/ext/

Then I run sonar-runner again, it throws this exception:

Unknown database status: FRESH_INSTALL

My heart is broken , plz help me


回答1:


I saw this error when the database is empty (no tables are created). Usually tables are created during first start of sonar.

Can you reach sonar by web interface?

Make sure that settings in your conf/sonar.properties file in Sonar directory are correct, these lines should be uncommented.

sonar.jdbc.url:                            jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true
sonar.jdbc.username:                       mysqlusername
sonar.jdbc.password:                       mysqlpassword

Then check if your conf/sonar-runner.properties file in sonar-runer directory has the same settings.

#----- MySQL
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8

#----- Global database settings
sonar.jdbc.username=mysqlusername
sonar.jdbc.password=mysqlpassword

Also make sure that the line for default embeded database is commented.

#sonar.jdbc.url:                            jdbc:h2:tcp://localhost:9092/sonar



回答2:


Sonar stopped supporting the property "sonar.jdbc.schema" from 4.2 version. Please refer link http://jira.codehaus.org/browse/SONAR-5000. To fix the issue on PostgreSQL based sonar deployment, execute the following SQL command on the database:

ALTER USER $dbUser$ SET search_path to $soanrQubeSchema$




回答3:


I just encountered the same problem, and I solved it by restarting sonar server after creating proper user and database in mysql.
In fact, sonar server will fill the empty mysql database with many tables after restarting, and that removed the "FRESH_INSTALL" problem.



来源:https://stackoverflow.com/questions/19901783/when-run-sonar-runer-throw-exception-caused-by-unknown-database-status-fre

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!