I am getting the following error when running sonar-runner-2.3 (with sonar-3.7). Any help is greatly appreciated. I have double checked the database configuration in both the sonar server and sonar runner and it looks good. Also, searching for similar errors on stackoverflow hasn't helped.
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: org.sonar.core.persistence.BadDatabaseVersion: Unknown database status: FRESH_INSTALL
Related
Getting org.javalite.activejdbc.DBException frequently while connecting to DB using activejdbc**
Please help to know why this is happening frequently??
exception occurred while getting user :
org.javalite.activejdbc.DBException:
com.mysql.jdbc.CommunicationsException: Communications link failure
due to underlying exception:
** BEGIN NESTED EXCEPTION ** >
java.net.SocketException
MESSAGE: Connection reset by peer: socket write error>
STACKTRACE:>
java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(Unknown Source)
at java.net.SocketOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.flush(Unknown Source)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2637)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1554)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3176)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1153)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1266)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:353)
at org.javalite.activejdbc.DB.find(DB.java:505)
at org.javalite.activejdbc.LazyList.hydrate(LazyList.java:329)
at org.javalite.activejdbc.AbstractLazyList.isEmpty(AbstractLazyList.java:42)
at org.javalite.activejdbc.ModelDelegate.findFirst(ModelDelegate.java:223)
at com.nb.ats.db.model.UserModel.findFirst(UserModel.java:2358)
** END NESTED EXCEPTION **>
Last packet sent to the server was 0 ms ago.,*
I am using the activejdbc-1.4.14.j7-20180227.053828-4.jar with MYSQLDB
Please help to know why this is happening frequently??
And how to fix this error?
Thanks in advance
"Connection reset by peer.." means your application loses a connection to the database. You may have a network or some other connectivity issue. ActiveJDBC has nothing to so with it,
I am upgrading from Sonarqube 4.5.2 to 5.3 and the db migration failed. I am running on RH-Linux using MySQL. After running for 7 hours I got the following stacktrace. What is the state of the DB? What is my next step?
2016.02.29 18:36:16 INFO web[o.s.d.v.MassUpdate] 114749 issue_changes processed
(183 items/sec)
2016.02.29 18:37:09 ERROR web[o.s.s.d.m.DatabaseMigrator] Fail to execute databa
se migration: org.sonar.db.version.v51.FeedIssueChangesLongDates
java.lang.IllegalStateException: Error during processing of row: [created_at=201
5-07-01 23:54:59.0,updated_at=2015-07-01 23:54:59.0,issue_change_creation_date=2
015-07-01 23:28:45.0,id=1418038]
at org.sonar.db.version.SelectImpl.newExceptionWithRowDetails(SelectImpl
.java:89) ~[sonar-db-5.3.jar:na]
at org.sonar.db.version.SelectImpl.scroll(SelectImpl.java:81) ~[sonar-db
-5.3.jar:na]
at org.sonar.db.version.MassUpdate.execute(MassUpdate.java:76) ~[sonar-d
b-5.3.jar:na]
at org.sonar.db.version.v51.FeedIssueChangesLongDates.execute(FeedIssueC
hangesLongDates.java:49) ~[sonar-db-5.3.jar:na]
at org.sonar.db.version.BaseDataChange.execute(BaseDataChange.java:45) ~
[sonar-db-5.3.jar:na]
at org.sonar.server.db.migrations.DatabaseMigrator.executeMigration(Data
baseMigrator.java:95) ~[sonar-server-5.3.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.
0_72]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57) ~[na:1.7.0_72]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43) ~[na:1.7.0_72]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_72]
at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(Ja
vaMethod.java:455) [jruby-complete-1.7.9.jar:na]
at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:316) [j
ruby-complete-1.7.9.jar:na]
at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvo
ker.java:61) [jruby-complete-1.7.9.jar:na]
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:
168) [jruby-complete-1.7.9.jar:na]
:
:
:
2016.02.29 18:37:09 INFO web[o.s.s.d.m.PlatformDatabaseMigration] DB migration failed | time=25048064ms
2016.02.29 18:37:09 ERROR web[o.s.s.d.m.PlatformDatabaseMigration] DB Migration or container restart failed. Process ended with an exception
org.jruby.exceptions.RaiseException: (StandardError) An error has occurred, all later migrations canceled:
Fail to execute database migration: org.sonar.db.version.v51
.FeedIssueChangesLongDates
You have to restore a backup. I hope you made one before starting the upgrade. Searching for FeedIssueChangesLongDates you can find the here the implementation. Look at the queries and the action executed on the records found. Based on that you can investigate the problematic records and correct/update in SQL directly.
Situation
We're running sonar with a MySQL database, jenkins and a build environment with maven.
Problem
When executing a jenkins job it is aborted with the message:
[ERROR] Failed to execute goal
org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on
project playground_eb: Can not execute Sonar: Fail to connect to
database: Cannot create JDBC driver of class 'com.mysql.jdbc.Driver'
for connect URL 'http://192.168.1.220:3306': No suitable driver
Configuration
Servers
192.168.1.220 (Debian 6.0.6):
- runs Jenkins (# port 8080)
- Sonar (# port 9000)
- MySQL Database (# port 3306)
192.168.1.221 (Windows 7):
- runs Maven and the whole build environment
Configurations
The database was configured in the sonar.properties file - with localhost.
Sonar and its database were configured via the jenkins web interface - with the IP.
I guess this could cause errors but configuring the IP in the sonar.properties file causes sonar to not even start up anymore.
Full exception stack
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project playground_eb: Can not execute Sonar
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:118)
at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:65)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:90)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.IllegalStateException: Fail to connect to database
at org.sonar.core.persistence.DefaultDatabase.start(DefaultDatabase.java:74)
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:601)
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:1009)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1002)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:760)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:72)
at org.sonar.batch.bootstrap.Module.start(Module.java:67)
at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:83)
at org.sonar.batch.bootstrap.Module.start(Module.java:68)
at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:75)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:60)
at org.sonar.maven3.SonarMojo.execute(SonarMojo.java:142)
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:113)
... 23 more
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'com.mysql.jdbc.Driver' for connect URL 'http://192.168.1.220:3306'
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1452)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
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:131)
at org.sonar.core.persistence.DefaultDatabase.start(DefaultDatabase.java:68)
... 44 more
Caused by: java.sql.SQLException: No suitable driver
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1443)
... 49 more
Just found the problem.
In Jenkins the Sonar database URL was set to
http://192.168.1.221:3306/sonar
Now I set it to the WHOLE JDBC-URL (including jdbc: ...) just like in the sonar.properties file
... and now it works.
Hi I am getting the following exception frequently in glassfish can any one help me on this.
The log message is null.
The log message is null.
java.sql.SQLException: Error in allocating a connection. Cause: java.lang.IllegalStateException: Wrong XAState: 0
at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:115)
at com.sify.beaserv.bean.PollBoxBean.getNode(PollBoxBean.java:754)
at com.sify.beaserv.bean.PollBoxBean.buildAlarm(PollBoxBean.java:317)
at com.sify.beaserv.bean.PollBoxBean.processNode(PollBoxBean.java:652)
at com.sify.beaserv.bean.PollBoxBean.onMessage(PollBoxBean.java:60)
at sun.reflect.GeneratedMethodAccessor185.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1011)
at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:175)
at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2929)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4020)
at com.sun.ejb.containers.MessageBeanContainer.deliverMessage(MessageBeanContainer.java:1111)
at com.sun.ejb.containers.MessageBeanListenerImpl.deliverMessage(MessageBeanListenerImpl.java:74)
at com.sun.enterprise.connectors.inflow.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:179)
at $Proxy76.onMessage(Unknown Source)
at com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:258)
at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:76)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
The exception message Wrong XAState: 0 suggests that you're trying to use an XA driver, which is correct for two-phase commit. Is that true? Do you know which JDBC driver and which database vendor you're using? Do you get this message right at start up, or is it after you've been running successfully for a while?
I changed my Sonar DB from Oracle to Default Derby. I successfully configured the Sonar Server, however I have error during the integration with Hudson.
Caused by: java.sql.SQLException: SQL driver not found oracle.jdbc.OracleDriver
at org.sonar.jpa.session.DriverDatabaseConnector.getConnection(DriverDatabaseConnector.java:91)
at org.sonar.jpa.session.AbstractDatabaseConnector.testConnection(AbstractDatabaseConnector.java:185)
... 41 more
Caused by: java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.sonar.jpa.session.DriverDatabaseConnector.getConnection(DriverDatabaseConnector.java:88)
... 42 more
Error states that I can't found OracleDriver, Which I should not use anymore.
In my Hudson configuration, I have removed my oracle configuration and replaced it with these :
Any idea on what I configured wrongly?
fixed by changing the driver to "org.apache.derby.jdbc.ClientDriver". Turns out that the remarks "Do not set if you use default embedded" is a misleading.