Analysis succeeds on Sonar 4.5 but fails on 4.1 with java.sql.SQLException

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Analysis succeeds on Sonar 4.5 but fails on 4.1 with java.sql.SQLException

senatori
This post has NOT been accepted by the mailing list yet.
Whenever I try to locally run sonar-runner on a sonar-example project my SonarQube 4.1 instance, it fails. In the stack trace, I noticed that it gives the following error:
Caused by: java.sql.SQLException: Access denied for user 'sonar'@'172.23.48.129'
that ip is my local machines IP. My sonar-runner.properties and sonar-project.properties file does not have jdbc set as that anywhere. Even the INFO level log bellow will testify to that.

What's strange is that I can run sonar-runner on the same sample project while pointing to a test instance of SonarQube 4.5 and the analysis runs successfully.


It errors out and give the following output:

sonar-runner -X
SonarQube Runner 2.4
Java 1.7.0_79 Oracle Corporation (64-bit)
Mac OS X 10.10.3 x86_64
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: /Users/senatori/Documents/sonar-runner-2.4/conf/sonar-runner.properties
INFO: Project configuration file: /Users/senatori/Documents/sonar-examples/projects/languages/groovy/groovy-sonar-runner/sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: /Users/senatori/Documents/sonar-examples/projects/languages/groovy/groovy-sonar-runner/./.sonar
INFO: SonarQube Server 4.1.1
18:10:05.102 INFO  - Load batch settings
18:10:05.121 DEBUG - Download: http://sonar.redac.dev/batch_bootstrap/properties?dryRun=false (no proxy)
18:10:05.298 INFO  - User cache: /Users/senatori/.sonar/cache
18:10:05.311 INFO  - Install plugins
18:10:05.311 DEBUG - Download index of plugins
18:10:05.311 DEBUG - Download: http://sonar.redac.dev/deploy/plugins/index.txt (no proxy)
18:10:05.648 INFO  - Install JDBC driver
18:10:05.648 DEBUG - Download index of jdbc-driver
18:10:05.648 DEBUG - Download: http://sonar.redac.dev/deploy/jdbc-driver.txt (no proxy)
18:10:05.699 INFO  - Create JDBC datasource for jdbc:mysql://sonardb001.redac.dev:3306/sonar?useUnicode=true&characterEncoding=utf8
18:10:06.282 DEBUG - To prevent a memory leak, the JDBC Driver [com.mysql.jdbc.Driver] has been forcibly deregistered
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 2.173s
Final Memory: 9M/123M
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:100)
        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:53)
Caused by: java.lang.IllegalStateException: Fail to connect to database
        at org.sonar.core.persistence.DefaultDatabase.start(DefaultDatabase.java:81)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        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:1015)
        at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1008)
        at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:766)
        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:91)
        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
        at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74)
        at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
        ... 9 more
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'sonar'@'172.23.48.129' (using password: YES))
        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.getLogWriter(BasicDataSource.java:1098)
        at org.apache.commons.dbcp.BasicDataSourceFactory.createDataSource(BasicDataSourceFactory.java:350)
        at org.sonar.core.persistence.DefaultDatabase.initDatasource(DefaultDatabase.java:142)
        at org.sonar.core.persistence.DefaultDatabase.start(DefaultDatabase.java:75)
        ... 32 more
Caused by: java.sql.SQLException: Access denied for user 'sonar'@'172.23.48.129' (using password: YES)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4190)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4122)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:927)
        at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1709)
        at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1252)
        at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2486)
        at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2519)
        at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2304)
        at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)
        at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346)
        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)
        ... 37 more`