JDBC error while starting up an upgraded instance of version 6.7.5-unable to start web server

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)

I have currently upgraded from 5.6.3 version to 6.7.5 version of SonarQube(Community version) .I have installed or placed the new versions/compatible versions of plugins as below too.

[userid@server plugins]$ ls
README.txt                              sonar-plsql-plugin-3.2.0.1753.jar
sonar-csharp-plugin-7.5.0.6605.jar      sonar-python-plugin-1.10.0.2131.jar
sonar-flex-plugin-2.4.0.1222.jar        sonar-scm-git-plugin-1.3.0.869.jar
sonar-java-plugin-5.7.0.15470.jar       sonar-scm-svn-plugin-1.6.0.860.jar
sonar-javascript-plugin-4.2.1.6529.jar  sonar-swift-plugin-4.0.0.2853.jar
sonar-ldap-plugin-2.1.0.507.jar         sonar-typescript-plugin-1.8.0.3332.jar
sonar-php-plugin-2.14.0.3569.jar        sonar-xml-plugin-1.5.1.1452.jar
[userid@server plugins]$ pwd
/apps/ci/data/opt/sonar/sonarqube-6.7.5/extensions/plugins
  • what are you trying to achieve

Bringing up the SonarQube instance (6.7.5v) with a proper db connection.

  • what have you tried so far to achieve this

After updating plugins,we are facing issue in starting the instance getting below error for JDBC as well…
Note*:Earlier we did not had proper DB connection for our Sandbox instance & this is the first time we have made use of a clone of DB ,used by UAT instance.Our DBA team has already checked on the connection and they are able to connect to the DB schema,which our instance is unable to connect to…
please find the error below in web logs:

2018.09.17 03:48:34 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.').
        at org.sonar.db.DefaultDatabase.checkConnection(DefaultDatabase.java:108)
        at org.sonar.db.DefaultDatabase.start(DefaultDatabase.java:75)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
        at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
        at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
        at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
        at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
        at org.picocontainer.behaviors.Stored.start(Stored.java:110)
        at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
        at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
        at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:134)
        at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:90)
        at org.sonar.server.platform.Platform.start(Platform.java:211)
        at org.sonar.server.platform.Platform.startLevel1Container(Platform.java:170)
        at org.sonar.server.platform.Platform.init(Platform.java:86)
        at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:45)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-01017: invalid username/password; logon denied
)
        at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
        at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
        at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
        at org.sonar.db.profiling.NullConnectionInterceptor.getConnection(NullConnectionInterceptor.java:31)
        at org.sonar.db.profiling.ProfiledDataSource.getConnection(ProfiledDataSource.java:323)
        at org.sonar.db.DefaultDatabase.checkConnection(DefaultDatabase.java:106)
        ... 29 common frames omitted
Caused by: java.sql.SQLException: ORA-01017: invalid username/password; logon denied

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:389)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:382)
        at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:573)
        at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:431)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
        at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:366)
        at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:752)
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:366)
        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:536)
        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:228)
        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
        at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
        at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
        at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
        at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
        ... 34 common frames omitted

Note*:we have added the same jar file under /extensions/jdbc-driver/oracle,which we use in UAT instance.

Please help us to resolve this issue at earliest…

Thanks

Hello,

Have you checked the requirements for Oracle in this page ?
Pay attention to the supported driver versions.

Please share the sonar.properties content related to the jdbc url and the login and username (anonymized) to give me a chance to review it.

Greetings,
Alex.

Hi Alex,
Please find the parameters we have setup in sonar.properties for jdbc…

sonar.jdbc.username:sonar_snx
sonar.jdbc.password:xxxxxxx
sonar.jdbc.url: jdbc:oracle:thin:@lndbd201.hphc.org:1531:toldev1
#sonar.jdbc.driverClassname: oracle.jdbc.OracleDriver
sonar.jdbc.dialect: oracle
sonar.jdbc.validationQuery: select 1 from dual

Thanks

Hi Alex,
1.)Please let me know what are the below plugins used for & do we need to install new version of them under /data folder or not…

/ci/sonar/sonar-5.6.3/data/web/deploy/plugins/java/META-INF/lib>
asm-debug-all-5.0.3.jar java-jacoco-previous-4.2.1.6971.jar
cglib-nodep-3.1.jar java-maven-model-4.2.1.6971.jar
commons-lang-2.6.jar java-surefire-4.2.1.6971.jar
gson-2.6.2.jar jsr305-1.3.9.jar
guava-19.0.jar org.jacoco.core-0.7.5.201505241946.jar
java-checks-4.2.1.6971.jar picocontainer-2.14.1.jar
java-frontend-4.2.1.6971.jar sslr-core-1.21.jar
java-jacoco-4.2.1.6971.jar sslr-squid-bridge-2.6.1.jar

we have these plugins in our UAT instance which is still 5.6.3version .Need little explanation on the purpose of /web folder under /data folder (we have got this after unzipping the package).

2.)do we need to copy /edit everything under /apps/ci/data/sonar/sonarqueb-5.6.3/web to new version???because i do see many files & plugins are not available in new version /web folder…

Thanks

Hi,

When installing a new version of SonarQube you need to follow step by step the documentation and a very important point is to never copy items from the former setup to the new one.
So you must not do what you mention in your 2nd point.

If you want to install plugins on your new 6.7.5 instance I recommend you to do it through the Marketplace.

To diagnose your connexion issue, I would suggest you to try first to tnsping your database from the SQ server so you can check if the socket can be open between the two hosts.
If this goes well, then you can try to connect to the database with sqlplus.

let me know the outcome of this.

Greetings,
Alex.

Hi Alex,
Thank you .we did not had 11G jdbc driver installed in the server.we got it installed now.But when i start SonarQube ,It has been started but I’m getting a message saying below:


SonarQube is under maintenance

While waiting, you might want to investigate new plugins to extend the current functionality.

If you are an administrator and have no idea why this message is being shown, you should read the upgrade guide.


Please guide on the same…

Thanks

Hi,

Have a look at step 6 in the upgrading documentation, executing it will do the job.

Greetings,
Alex.

Hi Alex,
the particular link in that step is not redirecting to exact page & its showing as below:

image

What does this means??

Thanks

Hi,

it means that you need to click on the upgrade button and the database upgrade will start.

Greetings,
Alexandre.

1 Like

Hi Alex,

Does it mean i need to upgrade the actual DB that is having details of the project?will it not affect the whole DB details if i click on it?Please let me know the purpose of it …

&

i did clicked on it and Sonar instance went down with an error ,i have attached an attachment for the errored log(ce.log).Please provide if any licenses needed for any of the plugins as below:

[userid@server plugins]$ ls
README.txt
sonar-javascript-plugin-4.2.1.6529.jar
sonar-python-plugin-1.10.0.2131.jar
sonar-typescript-plugin-1.8.0.3332.jar
sonar-csharp-plugin-7.5.0.6605.jar
sonar-ldap-plugin-2.1.0.507.jar
sonar-scm-git-plugin-1.3.0.869.jar
sonar-xml-plugin-1.5.1.1452.jar
sonar-flex-plugin-2.4.0.1222.jar
sonar-php-plugin-2.14.0.3569.jar
sonar-scm-svn-plugin-1.6.0.860.jar
sonar-java-plugin-5.7.0.15470.jar
sonar-plsql-plugin-3.2.0.1753.jar
sonar-swift-plugin-4.0.0.2853.jar

Thanks,
Nagashree

ce_logs.txt (5.1 KB)

Kindly Please help us fix the issue,we are already passed the deadline of the project & our client is waiting for our reply on it .Please help us with high priority…

Thanks ,
Nagashree

Hello,

The message org.sonar.updatecenter.common.exception.PluginNotFoundException: The plugin 'license' required by 'plsql' is missing. means that you need to install the license manager plugin.
You can download it from here.

Greetings,
Alexandre.

Hi Alex,

Thank you for the support .I have a question regarding setting up the admin credentials for the instance.in documentation page,it talks about a query execution.Does it mean we must connect to the DB & execute the query?

Thanks,
Nagashree

Hi,

As explained in the doc, you need to run this query in case you lost the admin password and want to reset it.
Otherwise no, you don’t need to run the query.

Greetings,
Alexandre.

Hi Alex,

The instance is successfully running now & upgraded to 6.7.5v but we dont have admin credentials .Thus we were checking on running the query over the db .Please let us know the process of how to add admin credentials/fetch admin credentials …

Thanks,
Nagashree

From the documentation page:

Hi Alex,

I tried with the default credentials,It did not work ,Thus we are requesting to guide us on the query (how to go about…)

Thanks,
Nagashree

You should check the Authentication documentation, it has a note about situations where admin password would be lost.

Hi Nicholas/Alex,

Please let me know how i can connect to a oracle database from sonar qube server ??I am unable to find the command to do so…

Thanks,
Nagashree

You don’t connect to it from SonarQube, just use a regular database client if you need to issue a specific SQL command.