I resolved the issue by deleting the database and re-creating it. But didn't create a new schema.
Also re-installed Sonarqube and used the default 'public' schema i.e. left the property sonar.jdbc.schema commented(#) under sonar.properties
문제
I'm running Sonarqube4.0 and PostgreSQL9.3 database and the sonarqube-runner2.3 on different servers.
Connectivity between Sonarqube and Postgresql database is fine as I can get to the console http://[sonar-host]:9000, login change password and do all activities. I can also see the tables created under my schema in the database
The issue I have is with the sonar-runner. When I run sonar-runner from my source directory I get the below Exception:
09:52:21.736 DEBUG - To prevent a memory leak, the JDBC Driver [org.postgresql.Driver] has been forcibly deregistered
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 2.791s
Final Memory: 5M/220M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:90)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:41)
Caused by: Unknown database status: FRESH_INSTALL
I know there is a similar post on stack overflow but, all the properties file have the correct URLs usernames and passwords
sonar-project.properties:
sonar.host.url=http://[sonar-host]:9000
sonar.jdbc.url=jdbc:postgresql://[dbhost]:5432/sonarqube-sit
sonar.jdbc.username=sonarqube-sit
sonar.jdbc.password=xEgIVeyr0kw1
sonar.jdbc.schema=sonarqubesit
sonar.jdbc.driverClassName=org.postgresql.Driver
sonar.login=admin
sonar.password=7nQ36mrnk0UCsX1
sonar.properties:
sonar.jdbc.username=sonarqube-sit
sonar.jdbc.password={aes}ftWqQkON7XUqwNmJyHqzJA==
sonar.jdbc.url=jdbc:postgresql://[dbhost]:5432/sonarqube-sit
sonar.jdbc.schema=sonarqubesit
pg_hba.conf has entry for each of the servers and users
I also get some error in postgres log as below when I run the sonar-runner:
2014-01-22 09:52:21 GMT ERROR: relation "schema_migrations" does not exist at character 15
2014-01-22 09:52:21 GMT STATEMENT: select * from schema_migrations
Firstly, I can see the schema_migartions table in the database under sonarqubesit schema. And Secondly, I don't know why its trying to use schema_migrations? as I'm not migrating to a different schema?
Can anyone help me resolve this please. I'm assuming it is something to do with the way the schema is defined in sonar-runner properties, but I can't see anything obvious.
해결책
I resolved the issue by deleting the database and re-creating it. But didn't create a new schema.
Also re-installed Sonarqube and used the default 'public' schema i.e. left the property sonar.jdbc.schema commented(#) under sonar.properties