gabrie-allaigre / sonar-gitlab-plugin

Add to each commit GitLab in a global commentary on the new anomalies added by this commit and add comment lines of modified files
GNU Lesser General Public License v3.0
713 stars 207 forks source link

gitlab11.01+mysql issue #152

Closed liao-bo closed 6 years ago

liao-bo commented 6 years ago

i got error message in gitlab production.log when i try to run scan command in gitlab-ci error message:

ActiveRecord::StatementInvalid (Mysql2::Error: Incorrect string value: '\xF0\x9F\x9A\xAB</...' for column 'note_html' at row 1: INSERT INTO notes (note, noteable_type, commit_id, project_id, author_id, discussion_id, created_at, updated_at, note_html, cached_markdown_version, system) VALUES ('SonarQube analysis reported 23 issues\n :no_entry_sign: 4 critical\n :warning: 12 major\n* :arrow_down_small: 7 minor\n\n#### Top 10 extra issues\n\nNote: The following issues were found on lines that were not modified in the commit. Because these issues can\'t be reported as line comments, they are summarized here:\n\n1. :no_entry_sign: Refactor this function to reduce its Cognitive Complexity from 23 to the 15 allowed. :blue_book:\n1. :no_entry_sign: Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed. :blue_book:\n1. :no_entry_sign: Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed. :blue_book:\n1. :no_entry_sign: Refactor this function to reduce its Cognitive Complexity from 72 to the 15 allowed. :blue_book:\n1. :warning: Was \"+=\" meant instead? :blue_book:\n1. :warning: Remove this commented out code. [:blue_book:]

The sonar scanner command : #sonar-scanner -X -Dsonar.host.url="https://sonarqube.hexcloud.cn" -Dsonar.analysis.mode=preview -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -Dsonar.gitlab.project_id=$CI_PROJECT_ID'

TobiX commented 6 years ago

Looks like an unicode issue on the MySQL side, is your MySQL installation correct? https://docs.gitlab.com/ee/install/database_mysql.html#mysql-utf8mb4-support seems like a probable culprit. It seems GitLab does not recommend using MySQL with GitLab...