Sonar Analysis Fails with error Unable to evict pr

2019-08-30 10:18发布

问题:

We migrated our oracle 11.2 schema to new oracle 11.2 DB server. On running analysis on sonarqube 4.3.2 against new schema fails with following error.

In addition the Server ID is shown as empty in GUI though there is a entry for field sonar.core.id in DB. Not able to generate ID as well. Not sure if this si related.

 Unable to evict preview database: /batch_bootstrap/evict?project=724277: Fail to execute request [code=500, url=http://pchiroadmap01.lnx.in.here.com:9000/batch_bootstrap
/evict?project=724277]: Fail to download 
[http://pchiroadmap01.lnx.in.here.com:9000/batch_bootstrap
/evict?project=724277]. Response code: 500 -> [Help 1]

The sonar log shows following exceptions.

ActiveRecord::JDBCError: ORA-00904: "NOTE": invalid identifier
: INSERT INTO properties (prop_key, resource_id, text_value, user_id, name, value, note, id) VALUES('sonar.dryRun.cache.lastUpdate', 724277, empty_clob(), NULL, NULL, NULL, NULL, ?)
        /local_data/sonarqube-4.3.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log'
        /local_data/sonarqube-4.3.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/oracle/adapter.rb:183:in `ora_insert'

Please suggest what can be done.

Thanks,

Jayesh

回答1:

As you can see on this DDL file (from SonarQube 4.3.2), there is no "note" column on the "properties" table - nor "value" nor "name". This means that the following error in your log:

ActiveRecord::JDBCError: ORA-00904: "NOTE": invalid identifier
: INSERT INTO properties (prop_key, resource_id, text_value, user_id, name, value, note, id) VALUES('sonar.dryRun.cache.lastUpdate', 724277, empty_clob(), NULL, NULL, NULL, NULL, ?)
        /local_data/sonarqube-4.3.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log'
        /local_data/sonarqube-4.3.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/oracle/adapter.rb:183:in `ora_insert'

indicates that your DB schema has been altered somehow. In such situation, you can't expect SonarQube to work properly.

Update:

One thing that might help you: this might be linked to the JDBC user that you are using for SonarQube. Such error can happen if this user is able to access two schema that contains two SonarQube database. So you should check this point.



标签: sonarqube