Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-13290

Merge Request decoration on GitLab is stuck during the background analysis

    XMLWordPrintable

    Details

    • Edition:
      Developer
    • Production Notes:
      None

      Description

      SonarQube decoration on GitLab MR is using the GitLab API :

      https://[mygitlab]/api/v4/projects/${project_id}/mergerequests/${mr_id}/notes?body=xxxxx

      The body query parameter can be too long for the GitLab embedded Nginx reverse proxy, with the default configuration.

      The visible effect of this is that the SonarQube background task is looping forever on the MR decoration, without ever failing (no timeout).

      For on-prem GitLab instance, the fix for users is to add to the gitlab.rb configuration file this configuration :

      nginx['custom_gitlab_server_config'] = "large_client_header_buffers 4 32k;\nhttp2_max_field_size 32k;\nhttp2_max_header_size 64k;\n"

      which allows a bigger URL.

      The definitive fix would be to fail properly on the SonarQube side, with a proper error. The same query with curl raise a correct error :

      414 Request-URI Too Large

      SonarQube should be able to detect such an error and fail accordingly, with the advice to increase the URL limit on the Gitlab size.

      For GitLab.com, there is no workaround yet. But the limit has already been increased a bit, so the issue has not been reported yet. The issue will happen if a user has a very long Sonarqube URL (because of the links we put in the markdown).

       

      From the community: https://community.sonarsource.com/t/gitlab-ci-loop-of-empty-posts-for-pr-decoration-when-quality-gate-fails/19137/33, and credits to Antoine DAVID for the suggested workaround.

        Attachments

          Activity

            People

            Assignee:
            pierre.guillot Pierre Guillot
            Reporter:
            pierre.guillot Pierre Guillot
            Votes:
            10 Vote for this issue
            Watchers:
            19 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: