Sonarqube configured with Oracle not working

  • Sonarqube Version -: 7.3
  • Cent OS -7.5
  • Oracle - 12.2.0.1

I am trying to connect Sonarqube with Oracle.
In Oracle i have created new user name as sonar and gave all the permissions. with below command.

CREATE USER sonar IDENTIFIED BY sonar;
GRANT ALL PRIVILEGES TO sonar;

When I start my sonarqube first time it was working as expected but once I have stopped and start again It is throwing error like below.

ERROR web[][o.s.s.p.Platform] Web server startup failed
java.lang.IllegalStateException: Can not connect to database. Please check connectivity and settings (see the properties prefixed by ‘sonar.jdbc.’).

When I totally remove and reinstall whole sonar setup with oracle users its working as expected but after stop it is not working.

Thanks in advance!!!

Hello,

Thanks for sharing the web.log file as well as your jdbc url property from the sonar.properties file.

Alex.

Hi Alexandre,

Thanks for your reply. PFA Web.log and sonar.properties file.

web.txt (7.2 KB)

sonar.properties.txt (19.7 KB)

Thanks,
Vaishal

Hi,

Any Update on this?

Thanks,
Vaishal

Hello,

From what I can read in the log there is an issue on the dataserver side.
Can you check that you can open a socket on the database server from the sonarqube server ?
You can do it by using telnet and ultimately, if you have an Oracle driver installed on your sonarqube server you should try to connect to your database with sqlplus and the login/password set in your sonar.properties file.

Alex.

Hi Alexandre,

Thanks for your reply.

I have tried both the option and it is working. but when we are trying with sonar.properties file for few minuets we are able to connect to Oracle database and then throwing same error.

Regards,
Vaishal Shah

Hello,

It may be related to the random generator set in your java distribution to secure the connection with entropy.
Have a look at the following thread and try to replace the /dev/random with /dev/urandom.

Alex.

1 Like

Hi Alex,

Thanks for your answer.
After made changes in JVM parameter it is working.

Thanks again for your support :slight_smile:

Regards,
Vaishal