SonarQube Plugins
  1. SonarQube Plugins
  2. SONARPLUGINS-1080

Error - Data truncation: Out of range value adjusted for column 'value' at row 1

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: BUILD-STABILITY-1.1.2
    • Fix Version/s: BUILD-STABILITY-1.2
    • Component/s: Build Stability
    • Labels:
      None
    • Environment:
      sonar-2.7, build-stability-1.1.2
    • Number of attachments :
      0

      Description

      I met an exception while analyzing with sonar.
      If I remove the <ciManagement> configuration in pom.xml, there is no error.

      The error occurs on a part of projects using <ciManagement> configuration.
      I don't know why it is. I tried it using sonar project setting. But the result was same.

      • My <ciManagement> configuration (the url is valid. the userid and password for hudson is also correct.)
            <ciManagement>
                <system>Hudson</system>
                <url>http://ci.mycompany.com/job/myproject/</url>
            </ciManagement>
        
      • Error log
        ...
        
        Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
        
        [INFO] [cobertura:cobertura {execution: default-cli}]
        [INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
        Cobertura: Loaded information on 10 classes.
        Report time: 231ms
        
        [INFO] Cobertura Report generation was successful.
        [INFO]  Execute org.codehaus.mojo:cobertura-maven-plugin:2.4:cobertura done: 2626 ms
        [INFO]  Execute maven plugin cobertura-maven-plugin done: 2627 ms
        [INFO]  Initializer CoberturaMavenInitializer...
        [INFO]  Initializer CoberturaMavenInitializer done: 0 ms
        [INFO]  Sensor AsynchronousMeasuresSensor...
        [INFO]  Sensor AsynchronousMeasuresSensor done: 36 ms
        [INFO]  Sensor SquidSensor...
        [INFO]  Java AST scan...
        [INFO]  Java AST scan done: 94 ms
        [INFO]  Java bytecode scan...
        [INFO]  Java bytecode scan done: 95 ms
        [INFO]  Java Squid scan...
        [INFO]  Java Squid scan done: 1 ms
        [INFO]  Squid extraction...
        [INFO]  Package design analysis...
        [INFO]  Package design analysis done: 113 ms
        [INFO]  Squid extraction done: 741 ms
        [INFO]  Sensor SquidSensor done: 982 ms
        [INFO]  Sensor JavaSourceImporter...
        [INFO]  Sensor JavaSourceImporter done: 126 ms
        [INFO]  Sensor FindbugsSensor...
        [INFO]  Execute Findbugs 1.3.9...
        [INFO]  Found findbugs plugin: file:/var/folders/79/79cHJNXIF8WCzedslZ0uxU+++TI/-Tmp-/sonar-batch77459536450945980561301996998172587000/findbugs/findbugs-1.3.9.jar
        [INFO]  Loaded plugin edu.umd.cs.findbugs.plugins.core
        [INFO]  Findbugs output report: /Users/rhapsody/Work/DevSpace/playminime/playminime-notifier/target/sonar/findbugs-result.xml
        [INFO]  Execute Findbugs 1.3.9 done: 2157 ms
        [INFO]  Sensor FindbugsSensor done: 2199 ms
        [INFO]  Sensor SurefireSensor...
        [INFO]  parsing /Users/rhapsody/Work/DevSpace/playminime/playminime-notifier/target/surefire-reports
        [INFO]  Sensor SurefireSensor done: 0 ms
        [INFO]  Sensor CpdSensor...
        [INFO]  Sensor CpdSensor done: 26 ms
        [INFO]  Sensor PmdSensor...
        [INFO]  Execute PMD 4.2.5...
        [INFO]  Java version: 1.6
        [INFO]  PMD configuration: /Users/rhapsody/Work/DevSpace/playminime/playminime-notifier/target/sonar/pmd.xml
        [INFO]  PMD output report: /Users/rhapsody/Work/DevSpace/playminime/playminime-notifier/target/sonar/pmd-result.xml
        [INFO]  Execute PMD 4.2.5 done: 904 ms
        [INFO]  Sensor PmdSensor done: 922 ms
        [INFO]  Sensor ProfileSensor...
        [INFO]  Sensor ProfileSensor done: 0 ms
        [INFO]  Sensor ProjectLinksSensor...
        [INFO]  Sensor ProjectLinksSensor done: 29 ms
        [INFO]  Sensor VersionEventsSensor...
        [INFO]  Sensor VersionEventsSensor done: 22 ms
        [INFO]  Sensor CoberturaSensor...
        [INFO]  parsing /Users/rhapsody/Work/DevSpace/playminime/playminime-notifier/target/site/cobertura/coverage.xml
        [INFO]  Sensor CoberturaSensor done: 91 ms
        [INFO]  Sensor Maven dependencies...
        [INFO]  Sensor Maven dependencies done: 7985 ms
        [INFO]  Sensor TrackerSensor...
        [INFO]  Sensor TrackerSensor done: 8 ms
        [INFO]  Sensor org.sonar.plugins.artifactsize.ArtifactSizeSensor@3ef527f1...
        [INFO]  The file /Users/rhapsody/Work/DevSpace/playminime/playminime-notifier/target/playminime-notifier-2.0.atlassian-plugin does not exist
        [INFO]  Sensor org.sonar.plugins.artifactsize.ArtifactSizeSensor@3ef527f1 done: 0 ms
        [INFO]  Execute decorators...
        [INFO]  -------------  Analyzing playminime-parent
        [INFO]  Selected quality profile : [name=Daum 2,language=java]
        [INFO]  Compare to previous analysis  (2011-04-05)
        [INFO]  Compare over 5 days (2011-03-31, analysis of 2011-03-30 20:46:10.0)
        [INFO]  Compare over 30 days (2011-03-06, analysis of 2011-03-29 11:52:08.0)
        [INFO]  Configure maven plugins...
        [INFO]  Initializer MavenInitializer...
        [INFO]  Java source version: 1.6
        [INFO]  Java target version: 1.6
        [INFO]  Source encoding: UTF-8
        [INFO]  Initializer MavenInitializer done: 0 ms
        [INFO]  Sensor AsynchronousMeasuresSensor...
        [INFO]  Sensor AsynchronousMeasuresSensor done: 113 ms
        [INFO]  Sensor SquidSensor...
        [INFO]  Java Squid scan...
        [INFO]  Java Squid scan done: 0 ms
        [INFO]  Sensor SquidSensor done: 2 ms
        [INFO]  Sensor JavaSourceImporter...
        [INFO]  Sensor JavaSourceImporter done: 0 ms
        [INFO]  Sensor SurefireSensor...
        [INFO]  parsing /Users/rhapsody/Work/DevSpace/playminime/target/surefire-reports
        [INFO]  Sensor SurefireSensor done: 0 ms
        [INFO]  Sensor CpdSensor...
        [INFO]  Sensor CpdSensor done: 1 ms
        [INFO]  Sensor ProfileSensor...
        [INFO]  Sensor ProfileSensor done: 0 ms
        [INFO]  Sensor ProjectLinksSensor...
        [INFO]  Sensor ProjectLinksSensor done: 100 ms
        [INFO]  Sensor VersionEventsSensor...
        [INFO]  Sensor VersionEventsSensor done: 75 ms
        [INFO]  Sensor Maven dependencies...
        [INFO]  Sensor Maven dependencies done: 189 ms
        [INFO]  Sensor org.sonar.plugins.buildstability.BuildStabilitySensor@28f18601...
        [INFO]  CI URL: Hudson:http://ci.daumcorp.com/job/ta-playminime/
        [INFO]  Retrieved 14 builds since Sun Mar 06 18:52:50 KST 2011
        [INFO]  Sensor org.sonar.plugins.buildstability.BuildStabilitySensor@28f18601 done: 724 ms
        [INFO]  Sensor TrackerSensor...
        [INFO]  Sensor TrackerSensor done: 0 ms
        [INFO]  Sensor JiraSensor...
        [WARN]  The server url, the filter name, the username and the password must not be empty.
        [INFO]  Sensor JiraSensor done: 1 ms
        [INFO]  Sensor org.sonar.plugins.artifactsize.ArtifactSizeSensor@446a27f1...
        [INFO]  The file /Users/rhapsody/Work/DevSpace/playminime/target/playminime-parent-2.0.1-SNAPSHOT.pom does not exist
        [INFO]  Sensor org.sonar.plugins.artifactsize.ArtifactSizeSensor@446a27f1 done: 0 ms
        [INFO]  Execute decorators...
        [WARN]  SQL Error: 1264, SQLState: 22001
        [ERROR]  Data truncation: Out of range value adjusted for column 'value' at row 1
        [INFO] ------------------------------------------------------------------------
        [ERROR] FATAL ERROR
        [INFO] ------------------------------------------------------------------------
        [INFO] org.hibernate.exception.DataException: could not insert: [org.sonar.api.database.model.MeasureModel]
        Data truncation: Out of range value adjusted for column 'value' at row 1
        [INFO] ------------------------------------------------------------------------
        [INFO] Trace
        javax.persistence.PersistenceException: org.hibernate.exception.DataException: could not insert: [org.sonar.api.database.model.MeasureModel]
        	at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
        	at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:226)
        	at org.sonar.jpa.session.JpaDatabaseSession.internalSave(JpaDatabaseSession.java:110)
        	at org.sonar.jpa.session.JpaDatabaseSession.save(JpaDatabaseSession.java:87)
        	at org.sonar.api.database.model.MeasureModel.save(MeasureModel.java:501)
        	at org.sonar.batch.index.MeasurePersister.dump(MeasurePersister.java:126)
        	at org.sonar.batch.index.DefaultPersistenceManager.dump(DefaultPersistenceManager.java:63)
        	at org.sonar.batch.phases.Phases.execute(Phases.java:77)
        	at org.sonar.batch.ProjectBatch.execute(ProjectBatch.java:55)
        	at org.sonar.batch.Batch.analyzeModule(Batch.java:158)
        	at org.sonar.batch.Batch.analyzeModules(Batch.java:76)
        	at org.sonar.batch.Batch.execute(Batch.java:62)
        	at org.sonar.maven.SonarMojo.executeBatch(SonarMojo.java:151)
        	at org.sonar.maven.SonarMojo.execute(SonarMojo.java:142)
        	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
        	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
        	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
        	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        	at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        	at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        	at java.lang.reflect.Method.invoke(Method.java:597)
        	at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        	at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        	at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        	at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
        Caused by: org.hibernate.exception.DataException: could not insert: [org.sonar.api.database.model.MeasureModel]
        	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:100)
        	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
        	at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64)
        	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2176)
        	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2656)
        	at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
        	at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
        	at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321)
        	at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
        	at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)
        	at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)
        	at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)
        	at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)
        	at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)
        	at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:646)
        	at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:620)
        	at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:624)
        	at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:220)
        	... 31 more
        Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of range value adjusted for column 'value' at row 1
        	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3564)
        	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)
        	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
        	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
        	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568)
        	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2113)
        	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2409)
        	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2327)
        	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2312)
        	at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94)
        	at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
        	... 46 more
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 3 minutes 2 seconds
        [INFO] Finished at: Tue Apr 05 18:52:51 KST 2011
        [INFO] Final Memory: 62M/123M
        [INFO] ------------------------------------------------------------------------
        
        
        

        Issue Links

          Activity

          Hide
          Curtis Boyden added a comment -

          At the same code location as you I got a slightly different error: "Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of range value for column 'value' at row 1"

          Mine was caused by value=4.2384084002E10 being passed in. The default definition of the 'project_measures'.'value' field that Sonar uses is Decimal(30,20) where my data requires 11 digits before the decimal and only 10 are available.
          – My fix was to alter the column of the Sonar database and make it larger.

          The only reason this cropped up for me is that someone saved a failed build from more than a year ago and therefore the 'build_average_time_to_fix_failure' metric was ridiculously (even inaccurately) long.

          I do not know if this is the issue here with this case, but I hope this information helps someone.

          Show
          Curtis Boyden added a comment - At the same code location as you I got a slightly different error: "Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of range value for column 'value' at row 1" Mine was caused by value=4.2384084002E10 being passed in. The default definition of the 'project_measures'.'value' field that Sonar uses is Decimal(30,20) where my data requires 11 digits before the decimal and only 10 are available. – My fix was to alter the column of the Sonar database and make it larger. The only reason this cropped up for me is that someone saved a failed build from more than a year ago and therefore the 'build_average_time_to_fix_failure' metric was ridiculously (even inaccurately) long. I do not know if this is the issue here with this case, but I hope this information helps someone.
          Hide
          Jean-Philippe Briend added a comment -

          Same problem for me, same cause as Curtis.

          I had a build saved 6 months ago in Jenkins.
          Thus, the metric was very long and out of limit of the database field size.

          Maybe a solution to this would be to limit the 'build_average_time_to_fix_failure' metric (and maybe others).
          Values superior to a limit should be displayed with something like 'too old' and excluded from graphs and co.

          Show
          Jean-Philippe Briend added a comment - Same problem for me, same cause as Curtis. I had a build saved 6 months ago in Jenkins. Thus, the metric was very long and out of limit of the database field size. Maybe a solution to this would be to limit the 'build_average_time_to_fix_failure' metric (and maybe others). Values superior to a limit should be displayed with something like 'too old' and excluded from graphs and co.
          Hide
          Julien HENRY added a comment -

          In order to avoid too big values we should avoid to have too old builds analysed. With previous version the latest build was always considered even if its date was older than configured analysis period.
          With my change we will not consider this build if it is older than number of configured days (30 by default) so we should not reach Sonar DB limit (can handle almost 1 year and a half).

          When CI Server is configured for a project but no build is in the analysis period then a message will be displayed in the widget.

          Show
          Julien HENRY added a comment - In order to avoid too big values we should avoid to have too old builds analysed. With previous version the latest build was always considered even if its date was older than configured analysis period. With my change we will not consider this build if it is older than number of configured days (30 by default) so we should not reach Sonar DB limit (can handle almost 1 year and a half). When CI Server is configured for a project but no build is in the analysis period then a message will be displayed in the widget.
          Hide
          Julien HENRY added a comment -

          Fixed

          Show
          Julien HENRY added a comment - Fixed
          Hide
          Fabrice Bellingard added a comment -

          Manually tested!

          Show
          Fabrice Bellingard added a comment - Manually tested!

            People

            • Assignee:
              Julien HENRY
              Reporter:
              rhapsody
            • Votes:
              4 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: