0
votes

sonarqube runner 2.4 on sonarcube server 6.1 is able to analyse and produce report successfully but server is not able to process the report and throws following error:

2016.11.12 13:41:05 TRACE ce[AVhXlYUu6eaRvX5y_I2S][sql] time=265ms | sql=INSERT INTO issues (kee, rule_id, severity, manual_severity, message, line, locations, gap, effort, status, tags, resolution, checksum, assignee, author_login, issue_attributes, issue_creation_date, issue_update_date, issue_close_date, created_at, updated_at, component_uuid, project_uuid, issue_type) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?, ?, ?, ?, ?, ?, ?) | params=AVhXlgd3R6hiEKFMKI0Y, 417, MAJOR, false, Class "Command" has 34 methods, which is greater than 20 authorized. Split it into smaller classes., 32, [B@51e88e5, 8, 60, OPEN, brain-overload, 12, 56a5cf39bde2227246f55f9c64d17971, 12, 12, , 1478937725000, 1478937725000, -5, 1478938264903, 1478938264903, AVhXcDrFyWOqRIX3Ks1c, AVhXcBE2vDxoF5vpXWIC, 1 2016.11.12 13:41:07 ERROR ce[AVhXlYUu6eaRvX5y_I2S][o.s.s.c.t.CeWorkerCallableImpl] Failed to execute task AVhXlYUu6eaRvX5y_I2S org.apache.ibatis.exceptions.PersistenceException:

Error committing transaction. Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.issue.IssueMapper.insert (batch index #2) failed. 1 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Incorrect string value: '\xF0\x9F\x92\x9A S...' for column 'message' at row 189

Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.issue.IssueMapper.insert (batch index #2) failed. 1 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Incorrect string value: '\xF0\x9F\x92\x9A S...' for column 'message' at row 189

System config is Centos mysql Ver 14.14 Distrib 5.7.16, for Linux (x86_64) using EditLine wrapper

Database sets:

mysql>  SHOW VARIABLES LIKE 'char%';

+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+

For some reason server is trying to insert UTF8mb4 instead of utf-8 characters into table 'issues'.

Edited 15 NOV 16

Following JDBC URL is allready added to Sonar runner and sonar server- sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar??useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance

Please Find Bytes Flow on MySQL Below:

    0, 'Remove this unused "$definition" local variable.', 106,
x'0A08086A106A180C2017',
null, 5, 'OPEN',
'unused', null, '99ac744eeafa6b37f7e8eac5c646437c',
null, null,
'',
1479190059000,1479190059000, null,
1479190593317, 1479190593317,
'AVhmn_WkMWzR03Kl-FYv', 'AVhmn8tKDHDOdW61_fap', 1),('AVhmoE2ZMWzR03Kl-I4i', 480,
'CRITICAL',
0, 'Define a constant instead of duplicating this literal "raw_text" 4 times.', 152,
x'0A0A089801109801181B2025120E0A0C120A089801109801181B2025120E0A0C120A0898011098011834203E120E0A0C120A08C20110C201181B2025120E0A0C120A08C20110C2011834203E',
4.0, 10, 'OPEN',
'design', null, '60c1c8e7e300be894ca50e3d8148a45e',
null, null,
'',
1479190059000,1479190059000, null,
1479190593317, 1479190593317,
'AVhmn_WkMWzR03Kl-FYw', 'AVhmn8tKDHDOdW61_fap', 1),('AVhmoE2ZMWzR03Kl-I4j', 480,
'CRITICAL',
0, 'Define a constant instead of duplicating this literal "name_width" 6 times.', 38,
x'0A080826102618242030120C0A0A12080826102618242030120C0A0A120808261026183E204A120C0A0A1208083A103A18242030120C0A0A1208083A103A183E204A120C0A0A1208085C105C18542060120C0A0A1208086910691850205C',
6.0, 14, 'OPEN',
'design', null, '8ff134e37a45467429fb6ed08813ef27',
null, null,
'',
1479190059000,1479190059000, null,
1479190593318, 1479190593318,
'AVhmn_WkMWzR03Kl-FYw', 'AVhmn8tKDHDOdW61_fap', 1),('AVhmoE2ZMWzR03Kl-I4k', 475,
'MINOR',
0, 'Remove the literal "true" boolean value.', 195,
x'0A0A08C30110C3011846204A',
null, 2, 'OPEN',
'clumsy', null, 'c24b378689aac9d485209fd0a4e3ade1',
null, null,
'',
1479190059000,1479190059000, null,
1479190593319, 1479190593319,
'AVhmn_WkMWzR03Kl-FYw', 'AVhmn8tKDHDOdW61_fap', 1)
2016-11-15T06:16:33.374835Z    12 Query rollback
2016-11-15T06:16:33.390547Z    12 Query SET autocommit=1
2016-11-15T06:16:35.947505Z    12 Query SELECT 1
2016-11-15T06:16:35.948774Z    12 Query SET autocommit=0
2016-11-15T06:16:35.949893Z    12 Query select

cq.uuid,
cq.task_type as taskType,
cq.component_uuid as componentUuid,
cq.status as status,
cq.submitter_login as submitterLogin,
cq.started_at as startedAt,
cq.created_at as createdAt,
cq.updated_at as updatedAt

from ce_queue cq
where cq.uuid='AVhmn81bDHDOdW61_faq'
2016-11-15T06:16:35.957953Z    12 Query insert into ce_activity (
  uuid,
  component_uuid,
  analysis_uuid,
  status,
  task_type,
  is_last,
  is_last_key,
  submitter_login,
  submitted_at,
  started_at,
  executed_at,
  created_at,
  updated_at,
  execution_time_ms,
  error_message,
  error_stacktrace
)
values (
  'AVhmn81bDHDOdW61_faq',
  'AVhmn8tKDHDOdW61_fap',
  null,
  'FAILED',
  'REPORT',
  0,
  'REPORTAVhmn8tKDHDOdW61_fap',
  'admin',
  1479190500789,
  1479190502631,
  1479190595952,
  1479190595955,
  1479190595955,
  93321,
  '\n### Error committing transaction.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.issue.IssueMapper.insert (batch index #1) failed. Cause: java.sql.BatchUpdateException: Incorrect string value: \'\\xF0\\x9F\\x92\\x9A S...\' for column \'message\' at row 189\n### Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.issue.IssueMapper.insert (batch index #1) failed. Cause: java.sql.BatchUpdateException: Incorrect string value: \'\\xF0\\x9F\\x92\\x9A S...\' for column \'message\' at row 189',
  'org.apache.ibatis.exceptions.PersistenceException: \n### Error committing transaction.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.issue.IssueMapper.insert (batch index #1) failed. Cause: java.sql.BatchUpdateException: Incorrect string value: \'\\xF0\\x9F\\x92\\x9A S...\' for column \'message\' at row 189\n### Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.issue.IssueMapper.insert (batch index #1) failed. Cause: java.sql.BatchUpdateException: Incorrect string value: \'\\xF0\\x9F\\x92\\x9A S...\' for column \'message\' at row 189\n at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)\n  at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:177)\n    at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:169)\n    at org.sonar.db.DbSession.commit(DbSession.java:41)\n   at org.sonar.db.BatchSession.commit(BatchSession.java:168)\n    at org.sonar.db.BatchSession.increment(BatchSession.java:205)\n at org.sonar.db.BatchSession.insert(BatchSession.java:125)\n    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:51)\n   at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52)\n  at com.sun.proxy.$Proxy48.insert(Unknown Source)\n  at org.sonar.server.computation.task.projectanalysis.step.PersistIssuesStep.execute(PersistIssuesStep.java:71)\n    at org.sonar.server.computation.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:64)\n   at org.sonar.server.computation.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:52)\n    at org.sonar.server.computation.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:75)\n   at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.executeTask(CeWorkerCallableImpl.java:84)\n  at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:57)\n at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:35)\n at java.util.concurrent.FutureTask.run(FutureTask.java:266)\n   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n    at java.util.concurrent.FutureTask.run(FutureTask.java:266)\n   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)\n  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)\n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n    at java.lang.Thread.run(Thread.java:745)\nCaused by: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.issue.IssueMapper.insert (batch index #1) failed. Cause: java.sql.BatchUpdateException: Incorrect string value: \'\\xF0\\x9F\\x92\\x9A S...\' for column \'message\' at row 189\n  at org.apache.ibatis.executor.BatchExecutor.doFlushStatements(BatchExecutor.java:127)\n at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:114)\n at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:109)\n at org.apache.ibatis.executor.BaseExecutor.commit(BaseExecutor.java:201)\n  at org.apache.ibatis.executor.CachingExecutor.commit(CachingExecutor.java:104)\n    at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:174)\n    ... 23 more\nCaused by: java.sql.BatchUpdateException: Incorrect string value: \'\\xF0\\x9F\\x92\\x9A S...\' for column \'message\' at row 189\n    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\n   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n   at java.lang.reflect.Constructor.newInstance(Constructor.java:423)\n    at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)\n   at com.mysql.jdbc.Util.getInstance(Util.java:387)\n at com.mysql.jdbc.SQLError.createBatchUpdateException(SQLError.java:1161)\n at com.mysql.jdbc.PreparedStatement.executeBatchedInserts(PreparedStatement.java:1582)\n    at com.mysql.jdbc.PreparedStatement.executeBatchInternal(PreparedStatement.java:1248)\n at com.mysql.jdbc.StatementImpl.executeBatch(StatementImpl.java:958)\n  at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)\n at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)\n at sun.reflect.GeneratedMethodAccessor73.invoke(Unknown Source)\n   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n  at java.lang.reflect.Method.invoke(Method.java:498)\n   at org.sonar.db.profiling.InvocationUtils.invokeQuietly(InvocationUtils.java:34)\n  at org.sonar.db.profiling.ProfilingPreparedStatementHandler.invoke(ProfilingPreparedStatementHandler.java:45)\n at com.sun.proxy.$Proxy24.executeBatch(Unknown Source)\n    at org.apache.ibatis.executor.BatchExecutor.doFlushStatements(BatchExecutor.java:103)\n ... 28 more\nCaused by: java.sql.SQLException: Incorrect string value: \'\\xF0\\x9F\\x92\\x9A S...\' for column \'message\' at row 189\n    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:963)\n  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3966)\n at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902)\n at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2526)\n  at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2673)\n   at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)\n    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)\n  at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2073)\n    at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2009)\n    at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5098)\n   at com.mysql.jdbc.PreparedStatement.executeBatchedInserts(PreparedStatement.java:1543)\n    ... 39 more\n'
)
2016-11-15T06:16:35.960623Z    12 Query select uuid
from ce_activity
where is_last_key='REPORTAVhmn8tKDHDOdW61_fap'
  and status <> 'CANCELED'
order by id desc

EDITED 16 NOV 16

Last few commits of error TABLE 'issues'

2016-11-15T06:16:33.100057Z    12 Query commit
2016-11-15T06:16:33.326963Z    12 Query INSERT INTO issues (kee, rule_id, severity, manual_severity,
message, line, locations, gap, effort, status, tags,
resolution, checksum, assignee, author_login, issue_attributes, issue_creation_date, issue_update_date,
issue_close_date, created_at, updated_at, component_uuid, project_uuid, issue_type)
VALUES ('AVhmoExZMWzR03Kl-I0r', 480,
'CRITICAL',
0, 'Define a constant instead of duplicating this literal "Australia/Brisbane" 4 times.', 51,
x'0A08083310331826203A120C0A0A1208083310331826203A120E0A0C120A08AF0110AF011826203A120E0A0C120A08A50210A50218242038120E0A0C120A08E30210E302180E2022',
4.0, 10, 'OPEN',
'design', null, '4c83bf60e890268e4c28fc0d535fbead',
null, null,

 '',
1479190059000,1479190059000, null,
1479190593306, 1479190593306,
'AVhmn_WjMWzR03Kl-FYn', 'AVhmn8tKDHDOdW61_fap', 1),('AVhmoE13MWzR03Kl-I4W', 463,
'MAJOR',
0, 'Remove the unused function parameter "$input".', 191,
x'0A0A08BF0110BF0118312037',
null, 5, 'OPEN',
'cert,misra,unused', null, '2537f941461c393954f764887895a456',
null, null,
'',
1479190059000,1479190059000, null,
1479190593307, 1479190593307,
'AVhmn_WjMWzR03Kl-FYn', 'AVhmn8tKDHDOdW61_fap', 1),('AVhmoE13MWzR03Kl-I4X', 463,
'MAJOR',
0, 'Remove the unused function parameter "$output".', 191,
x'0A0A08BF0110BF0118492050',
null, 5, 'OPEN',
'cert,misra,unused', null, '2537f941461c393954f764887895a456',
null, null,
'',
1479190059000,1479190059000, null,
1479190593308, 1479190593308,
'AVhmn_WjMWzR03Kl-FYn', 'AVhmn8tKDHDOdW61_fap', 1),('AVhmoE13MWzR03Kl-I4Y', 417,
'MAJOR',
0, 'Class "Command" has 34 methods, which is greater than 20 authorized. Split it into smaller classes.', 32,
x'0A080820102018002005',
null, 60, 'OPEN',
'brain-overload', null, '56a5cf39bde2227246f55f9c64d17971',
null, null,
'',
1479190059000,1479190059000, null,
1479190593308, 1479190593308,
'AVhmn_WjMWzR03Kl-FYn', 'AVhmn8tKDHDOdW61_fap', 1),('AVhmoE14MWzR03Kl-I4Z', 486,
'MAJOR',
0, 'Rename "$name" which has the same name as the field declared at line 35.', 520,
x'0A0A0888041088041808200D120C0A0A120808231023180C2011',
null, 5, 'OPEN',
'cert,pitfall', null, '4387290590318a46e73a00de79200861',
null, null,
'',
1479190059000,1479190059000, null,
1479190593309, 1479190593309,
'AVhmn_WjMWzR03Kl-FYn', 'AVhmn8tKDHDOdW61_fap', 1),('AVhmoE19MWzR03Kl-I4a', 480,
'CRITICAL',
0, 'Define a constant instead of duplicating this literal "format" 4 times.', 41,
x'0A080829102918202028120C0A0A12080829102918202028120C0A0A120808501050181E2026120C0A0A120808551055180C2014120C0A0A120808551055182A2032',
4.0, 10, 'OPEN',
'design', null, '16686315e25cf56e4ddca44fccd55317',
null, null,
'',
1479190059000,1479190059000, null,
1479190593310, 1479190593310,
'AVhmn_WkMWzR03Kl-FYo', 'AVhmn8tKDHDOdW61_fap', 1),('AVhmoE2BMWzR03Kl-I4b', 480,
'CRITICAL',
0, 'Define a constant instead of duplicating this literal "format" 4 times.', 72,
x'0A0808481048181E2026120C0A0A120808481048181E2026120C0A0A1208084D104D180C2014120C0A0A1208084D104D182D2035120C0A0A1208085C105C181C2024',
4.0, 10, 'OPEN',
'design', null, '0e27a71d30ca3a85d427d4187dcd2509',
null, null,
'',
1479190059000,1479190059000, null,
1479190593311, 1479190593311,
'AVhmn_WkMWzR03Kl-FYp', 'AVhmn8tKDHDOdW61_fap', 1),('AVhmoE2BMWzR03Kl-I4c', 480,
'CRITICAL',
0, 'Define a constant instead of duplicating this literal "namespace" 3 times.', 79,
x'0A08084F104F180C2017120C0A0A1208084F104F180C2017120C0A0A1208084F104F182F203A120C0A0A120808591059181E2029',
3.0, 8, 'OPEN',
'design', null, '1a02bd65046ea1936adb8f6b555770e3',
null, null,
'',
1479190059000,1479190059000, null,
1479190593312, 1479190593312,
'AVhmn_WkMWzR03Kl-FYp', 'AVhmn8tKDHDOdW61_fap', 1),('AVhmoE2QMWzR03Kl-I4d', 480,
'CRITICAL',
0, 'Define a constant instead of duplicating this literal "description" 3 times.', 103,
x'0A0808671067180C2019120C0A0A120808671067180C2019120C0A0A120808791079180C2019120E0A0C120A089F01109F01180C2019',
3.0, 8, 'OPEN',
'design', null, '9936da4d327342ba3432096385e745fc',
null, null,
'',
1479190059000,1479190059000, null,
1479190593313, 1479190593313,
'AVhmn_WkMWzR03Kl-FYu', 'AVhmn8tKDHDOdW61_fap', 1),('AVhmoE2QMWzR03Kl-I4e', 480,
'CRITICAL',
0, 'Define a constant instead of duplicating this literal "namespace" 3 times.', 64,
x'0A0808401040182D2038120C0A0A120808401040182D2038120C0A0A12080840104018462051120C0A0A120808491049182D2038',
3.0, 8, 'OPEN',
'design', null, '6912cec8ed8dd70391c1cc14d15130d1',
null, null,
'',
1479190059000,1479190059000, null,
1479190593314, 1479190593314,
'AVhmn_WkMWzR03Kl-FYu', 'AVhmn8tKDHDOdW61_fap', 1),('AVhmoE2UMWzR03Kl-I4f', 480,
'CRITICAL',
0, 'Define a constant instead of duplicating this literal "<none>" 6 times.', 34,
x'0A080822102218312039120C0A0A12080822102218312039120C0A0A120808251025183F2047120C0A0A1208083210321875207D120C0A0A120808361036183D2045120C0A0A120808601060183E2046120C0A0A120808621062186E2076',
6.0, 14, 'OPEN',
'design', null, '1b6527507aa924b426507804f2901b43',
null, null,
'',
1479190059000,1479190059000, null,
1479190593315, 1479190593315,
'AVhmn_WkMWzR03Kl-FYv', 'AVhmn8tKDHDOdW61_fap', 1),('AVhmoE2UMWzR03Kl-I4g', 480,
'CRITICAL',
0, 'Define a constant instead of duplicating this literal "* Description: " 3 times.', 37,
x'0A0808251025180D201E120C0A0A120808251025180D201E120C0A0A120808361036180D201E120C0A0A120808601060180D201E',
3.0, 8, 'OPEN',
'design', null, 'a30f23c3ee9c6650ad296e3e26ec6260',
null, null,
'',
1479190059000,1479190059000, null,
1479190593316, 1479190593316,
'AVhmn_WkMWzR03Kl-FYv', 'AVhmn8tKDHDOdW61_fap', 1),('AVhmoE2UMWzR03Kl-I4h', 468,
'MINOR',
0, 'Remove this unused "$definition" local variable.', 106,
x'0A08086A106A180C2017',
null, 5, 'OPEN',
'unused', null, '99ac744eeafa6b37f7e8eac5c646437c',
null, null,
'',
1479190059000,1479190059000, null,
1479190593317, 1479190593317,
'AVhmn_WkMWzR03Kl-FYv', 'AVhmn8tKDHDOdW61_fap', 1),('AVhmoE2ZMWzR03Kl-I4i', 480,
'CRITICAL',
0, 'Define a constant instead of duplicating this literal "raw_text" 4 times.', 152,
x'0A0A089801109801181B2025120E0A0C120A089801109801181B2025120E0A0C120A0898011098011834203E120E0A0C120A08C20110C201181B2025120E0A0C120A08C20110C2011834203E',
4.0, 10, 'OPEN',
'design', null, '60c1c8e7e300be894ca50e3d8148a45e',
null, null,
'',
1479190059000,1479190059000, null,
1479190593317, 1479190593317,
'AVhmn_WkMWzR03Kl-FYw', 'AVhmn8tKDHDOdW61_fap', 1),('AVhmoE2ZMWzR03Kl-I4j', 480,
'CRITICAL',
0, 'Define a constant instead of duplicating this literal "name_width" 6 times.', 38,
x'0A080826102618242030120C0A0A12080826102618242030120C0A0A120808261026183E204A120C0A0A1208083A103A18242030120C0A0A1208083A103A183E204A120C0A0A1208085C105C18542060120C0A0A1208086910691850205C',
6.0, 14, 'OPEN',
'design', null, '8ff134e37a45467429fb6ed08813ef27',
null, null,
'',
1479190059000,1479190059000, null,
1479190593318, 1479190593318,
'AVhmn_WkMWzR03Kl-FYw', 'AVhmn8tKDHDOdW61_fap', 1),('AVhmoE2ZMWzR03Kl-I4k', 475,
'MINOR',
0, 'Remove the literal "true" boolean value.', 195,
x'0A0A08C30110C3011846204A',
null, 2, 'OPEN',
'clumsy', null, 'c24b378689aac9d485209fd0a4e3ade1',
null, null,
'',
1479190059000,1479190059000, null,
1479190593319, 1479190593319,
'AVhmn_WkMWzR03Kl-FYw', 'AVhmn8tKDHDOdW61_fap', 1)
2016-11-15T06:16:33.374835Z    12 Query rollback
2016-11-15T06:16:33.390547Z    12 Query SET autocommit=1
2016-11-15T06:16:35.947505Z    12 Query SELECT 1
2016-11-15T06:16:35.948774Z    12 Query SET autocommit=0
2016-11-15T06:16:35.949893Z    12 Query select

cq.uuid,
cq.task_type as taskType,
cq.component_uuid as componentUuid,
cq.status as status,
cq.submitter_login as submitterLogin,
cq.started_at as startedAt,
cq.created_at as createdAt,
cq.updated_at as updatedAt

from ce_queue cq
where cq.uuid='AVhmn81bDHDOdW61_faq'
2016-11-15T06:16:35.957953Z    12 Query insert into ce_activity (
  uuid,
  component_uuid,
  analysis_uuid,
  status,
  task_type,
  is_last,
  is_last_key,
  submitter_login,
  submitted_at,
  started_at,
  executed_at,
  created_at,
  updated_at,
  execution_time_ms,
  error_message,
  error_stacktrace
)
values (
  'AVhmn81bDHDOdW61_faq',
  'AVhmn8tKDHDOdW61_fap',
  null,
  'FAILED',
  'REPORT',
  0,
  'REPORTAVhmn8tKDHDOdW61_fap',
  'admin',
  1479190500789,
  1479190502631,
  1479190595952,
  1479190595955,
  1479190595955,
  93321,
  '\n### Error committing transaction.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.issue.IssueMapper.insert (batch index #1) failed. Cause: java.sql.BatchUpdateException: Incorrect string value: \'\\xF0\\x9F\\x92\\x9A S...\' for column \'message\' at row 189\n### Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.issue.IssueMapper.insert (batch index #1) failed. Cause: java.sql.BatchUpdateException: Incorrect string value: \'\\xF0\\x9F\\x92\\x9A S...\' for column \'message\' at row 189',
  'org.apache.ibatis.exceptions.PersistenceException: \n### Error committing transaction.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.issue.IssueMapper.insert (batch index #1) failed. Cause: java.sql.BatchUpdateException: Incorrect string value: \'\\xF0\\x9F\\x92\\x9A S...\' for column \'message\' at row 189\n### Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.issue.IssueMapper.insert (batch index #1) failed. Cause: java.sql.BatchUpdateException: Incorrect string value: \'\\xF0\\x9F\\x92\\x9A S...\' for column \'message\' at row 189\n at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)\n  at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:177)\n    at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:169)\n    at org.sonar.db.DbSession.commit(DbSession.java:41)\n   at org.sonar.db.BatchSession.commit(BatchSession.java:168)\n    at org.sonar.db.BatchSession.increment(BatchSession.java:205)\n at org.sonar.db.BatchSession.insert(BatchSession.java:125)\n    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:51)\n   at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52)\n  at com.sun.proxy.$Proxy48.insert(Unknown Source)\n  at org.sonar.server.computation.task.projectanalysis.step.PersistIssuesStep.execute(PersistIssuesStep.java:71)\n    at org.sonar.server.computation.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:64)\n   at org.sonar.server.computation.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:52)\n    at org.sonar.server.computation.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:75)\n   at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.executeTask(CeWorkerCallableImpl.java:84)\n  at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:57)\n at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:35)\n at java.util.concurrent.FutureTask.run(FutureTask.java:266)\n   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n    at java.util.concurrent.FutureTask.run(FutureTask.java:266)\n   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)\n  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)\n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n    at java.lang.Thread.run(Thread.java:745)\nCaused by: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.issue.IssueMapper.insert (batch index #1) failed. Cause: java.sql.BatchUpdateException: Incorrect string value: \'\\xF0\\x9F\\x92\\x9A S...\' for column \'message\' at row 189\n  at org.apache.ibatis.executor.BatchExecutor.doFlushStatements(BatchExecutor.java:127)\n at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:114)\n at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:109)\n at org.apache.ibatis.executor.BaseExecutor.commit(BaseExecutor.java:201)\n  at org.apache.ibatis.executor.CachingExecutor.commit(CachingExecutor.java:104)\n    at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:174)\n    ... 23 more\nCaused by: java.sql.BatchUpdateException: Incorrect string value: \'\\xF0\\x9F\\x92\\x9A S...\' for column \'message\' at row 189\n    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\n   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n   at java.lang.reflect.Constructor.newInstance(Constructor.java:423)\n    at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)\n   at com.mysql.jdbc.Util.getInstance(Util.java:387)\n at com.mysql.jdbc.SQLError.createBatchUpdateException(SQLError.java:1161)\n at com.mysql.jdbc.PreparedStatement.executeBatchedInserts(PreparedStatement.java:1582)\n    at com.mysql.jdbc.PreparedStatement.executeBatchInternal(PreparedStatement.java:1248)\n at com.mysql.jdbc.StatementImpl.executeBatch(StatementImpl.java:958)\n  at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)\n at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)\n at sun.reflect.GeneratedMethodAccessor73.invoke(Unknown Source)\n   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n  at java.lang.reflect.Method.invoke(Method.java:498)\n   at org.sonar.db.profiling.InvocationUtils.invokeQuietly(InvocationUtils.java:34)\n  at org.sonar.db.profiling.ProfilingPreparedStatementHandler.invoke(ProfilingPreparedStatementHandler.java:45)\n at com.sun.proxy.$Proxy24.executeBatch(Unknown Source)\n    at org.apache.ibatis.executor.BatchExecutor.doFlushStatements(BatchExecutor.java:103)\n ... 28 more\nCaused by: java.sql.SQLException: Incorrect string value: \'\\xF0\\x9F\\x92\\x9A S...\' for column \'message\' at row 189\n    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:963)\n  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3966)\n at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902)\n at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2526)\n  at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2673)\n   at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)\n    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)\n  at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2073)\n    at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2009)\n    at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5098)\n   at com.mysql.jdbc.PreparedStatement.executeBatchedInserts(PreparedStatement.java:1543)\n    ... 39 more\n'
)
2
I see the "Incorrect string value" in the error message, but not in the "values()"; where is it?Rick James
@RickJames. I could not find the string in values either. I have added last few commits of error TABLE 'issues' with its structure. thxKay
None of those hex strings seem to be relevant either.Rick James
@RickJames. Then what could be a solution ? It is the message column in table 'issues'.Kay
issues sounds like a monitoring system, not the real system. Go back into your code.Rick James

2 Answers

0
votes

\xF0\x9F\x92\x9A is the utf8mb4 encoding for 💚. You need to establish that the client has utf8mb4 bytes.

Assuming you are using JDBC, Add ?useUnicode=yes&characterEncoding=UTF-8 to the JDBC URL.

If there are more issues, please provide more details of bytes as it flows through your system.

0
votes

As answered by Rick James, the problem occurs when the message of an issue contains an emoji. The root cause is that tables have the charset named utf8... which is not UTF-8 on MySQL. Indeed only utf8mb4 supports 4-bytes characters like emojis.

As this constraint has major side-effects on the way to design data model on MySQL, fix won't be straightforward. The only workaround is currently to exclude source files with emojis from analysis.

Problem is tracked in https://jira.sonarsource.com/browse/SONAR-8496.