# Help me figure out why PR decoration doesn't work

**URL:** <https://community.sonarsource.com/t/help-me-figure-out-why-pr-decoration-doesnt-work/20386>\
**Category:** SonarQube Server / Community Build\
**Tags:** pull-request, gitlab\
**Created:** [February 19, 2020, 9:04pm UTC](https://community.sonarsource.com/t/help-me-figure-out-why-pr-decoration-doesnt-work/20386 "2020-02-19T21:04:52Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kyokoluz](https://avatars.discourse-cdn.com/v4/letter/k/e274bd/32.png) [@Kyokoluz](https://community.sonarsource.com/u/Kyokoluz)\
**Post date:** [February 19, 2020, 9:04pm UTC](https://community.sonarsource.com/t/help-me-figure-out-why-pr-decoration-doesnt-work/20386/1 "2020-02-19T21:04:52Z")

</div>

# Good day.

## Versions:

- SonarQube Scanner 4.2.0.1873
- Developer Edition Version 8.1 (build 31237)
- Linux 5.3.0-40-generic amd64

We are trying to implement PR decoration in our proyect following [https://docs.sonarqube.org/latest/analysis/pr-decoration](https://docs.sonarqube.org/latest/analysis/pr-decoration) . However we are encounting a message like this: **Pull request decoration did not happen. Please configure pull request properties in the project administration.**

We are using **gitlab-ci version 12.7.1** using **shell configuration** to use both, sonarqube and scanner in a server (locally) and the repository is remote. Also created a gitlab user and obtained the user token with api access. with token we configured PR decoration tab in the left sonarqube’s panel in Gitlab tab.

Our CI Job is the following:

```auto
sonarqube-check:
    variables:
        SONAR_TOKEN: " ****************************************"
        SONAR_HOST_URL: "http://localhost:2294"
        GIT_DEPTH: 0
    stage: QA
    script:
        - npm install
        - sonar-scanner
    allow_failure: false
    only:
        - merge_requests
        - Development
    tags:
        - sonarqube

```

we obtained token from sonarqube in account security options.

## sonar-scanner.properties are:

```auto
sonar.host.url=http://localhost:2294
sonar.sourceEncoding=UTF-8
sonar.projectKey=FCMovil
sonar.sources=src

```

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![dmeneses](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dmeneses/32/2933_2.png) [@dmeneses](https://community.sonarsource.com/u/dmeneses)\
**Post date:** [February 20, 2020, 12:58am UTC](https://community.sonarsource.com/t/help-me-figure-out-why-pr-decoration-doesnt-work/20386/2 "2020-02-20T00:58:34Z")

</div>

Hi,  
Could you please check your logs (\<sonarqube\_install\>/logs/ce.log\>) and see if there is anything relevant?  
If I understood correctly, you are using a self managed GitLab CI/CD and code repository?

---

<div class="post-metadata">

**Author:** ![Kyokoluz](https://avatars.discourse-cdn.com/v4/letter/k/e274bd/32.png) [@Kyokoluz](https://community.sonarsource.com/u/Kyokoluz)\
**Post date:** [February 20, 2020, 4:49am UTC](https://community.sonarsource.com/t/help-me-figure-out-why-pr-decoration-doesnt-work/20386/3 "2020-02-20T04:49:29Z")

</div>

Hi, i will check later because im not currently on PC. Im using self managed gitlab CI/CD (dedicated runner on the machine using shell) but using a remote repository ([gitlab.com](http://gitlab.com)) not self managed.

---

<div class="post-metadata">

**Author:** ![Kyokoluz](https://avatars.discourse-cdn.com/v4/letter/k/e274bd/32.png) [@Kyokoluz](https://community.sonarsource.com/u/Kyokoluz)\
**Post date:** [February 20, 2020, 1:09pm UTC](https://community.sonarsource.com/t/help-me-figure-out-why-pr-decoration-doesnt-work/20386/4 "2020-02-20T13:09:36Z")

</div>

Hi, this is the log file, i didn’t found anything related to errors.

[ce.log.txt](https://community.sonarsource.com/uploads/short-url/w20vHkxrpnBhqFYOgs2S7M0F4B1.txt) (36.2 KB)

Also added some screenshoots:

## Merge request:

 ![MR](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/2X/8/8b1af87723dfb69fce8322b5f07252e0f19b14cd.png)

## Results in Sonarqube.

 ![Sonar](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/2X/0/0b0369d8569098d39136b50edf1b4a01c0c1a23f.png)

## Gitlab CI Log

[GitlabCi log.txt](https://community.sonarsource.com/uploads/short-url/qNG7KhubmMFFvGXpQoXD6kl5ONH.txt) (9.9 KB)

The src directory that we configured is composed by the next type of files:

- Typescript
- CSS
- HTML

thanks for your answer.

---

<div class="post-metadata">

**Author:** ![dmeneses](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dmeneses/32/2933_2.png) [@dmeneses](https://community.sonarsource.com/u/dmeneses)\
**Post date:** [February 20, 2020, 2:18pm UTC](https://community.sonarsource.com/t/help-me-figure-out-why-pr-decoration-doesnt-work/20386/5 "2020-02-20T14:18:08Z")

</div>

At least the warning should be in the logs. Any chance it got rotated and is in another file?

Based on your setup, my guess is that the scanner running in your self hosted CI is not picking up the correct address for [gitlab.com](http://gitlab.com).

---

<div class="post-metadata">

**Author:** ![Kyokoluz](https://avatars.discourse-cdn.com/v4/letter/k/e274bd/32.png) [@Kyokoluz](https://community.sonarsource.com/u/Kyokoluz)\
**Post date:** [February 20, 2020, 2:26pm UTC](https://community.sonarsource.com/t/help-me-figure-out-why-pr-decoration-doesnt-work/20386/6 "2020-02-20T14:26:45Z")

</div>

I will check other logs related to sonarqube and gitlab-runner to check if there is something that im missing about an error. I will keep you updated.

---

<div class="post-metadata">

**Author:** ![Kyokoluz](https://avatars.discourse-cdn.com/v4/letter/k/e274bd/32.png) [@Kyokoluz](https://community.sonarsource.com/u/Kyokoluz)\
**Post date:** [February 20, 2020, 4:04pm UTC](https://community.sonarsource.com/t/help-me-figure-out-why-pr-decoration-doesnt-work/20386/7 "2020-02-20T16:04:21Z")

</div>

@dmeneses checked all logs that i found and only encountered this, also i didn’t configure logs outputs so that is default:

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/2X/4/4dac9a509886c61aca4be666de60910701459aff.png)

## Gitlab ci log

```auto
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/home/gitlab-runner/.sonar/cache/a89f1943fc75b65becd9fb4ecab8d913/sonar-tsql-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

```

## es.log

```auto
2020.02.20 10:38:10 WARN es[][o.e.d.c.s.Settings] [http.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.

```

## web.log

```auto
2020.02.20 10:38:24 WARN web[][o.s.s.a.LogOAuthWarning] For security reasons, OAuth authentication should use HTTPS. You should set the property 'Administration > Configuration > Server base URL' to a HTTPS URL.
2020.02.20 10:38:24 WARN web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/plugins/download
2020.02.20 10:38:24 WARN web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/permissions/search_templates
2020.02.20 10:38:24 WARN web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/support/info

```

## sonar.log

```auto
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
ERROR: [2] bootstrap checks failed

```

didn’t found any warning or errror in ce.log.

Thanks for your help

---

<div class="post-metadata">

**Author:** ![bugbouncer](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/bugbouncer/32/10396_2.png) [@bugbouncer](https://community.sonarsource.com/u/bugbouncer)\
**Post date:** [February 26, 2020, 8:00am UTC](https://community.sonarsource.com/t/help-me-figure-out-why-pr-decoration-doesnt-work/20386/8 "2020-02-26T08:00:11Z")

</div>

> [@Kyokoluz](#):
>
> not currently on PC. Im using self managed gitla

SonarQube needs a GitLab user to decorate the merge requests. Did you:

- Generate an access token for the GitLab user with scope “API” activated?
- Grant “reporter” permission to the GitLab user for the project where merge requests are performed

In SonarQube, did you:

- Create a “Merge Request Decoration configuration” under (Global-) Administration-\>Pull Request Decoration-\> GitLab?
- For the SonarQube project itself, did you select the above configuration in (Project-) Administration → General Settings → Pull Request Decoration

If all yes, can you see the analysis of the Merge Request in SonarQube (Project-) Administration → Branches & Pull Request → Pull Requests ?  
Any network issues between the 2 servers (e.g. a Firewall)?

---

<div class="post-metadata">

**Author:** ![Kyokoluz](https://avatars.discourse-cdn.com/v4/letter/k/e274bd/32.png) [@Kyokoluz](https://community.sonarsource.com/u/Kyokoluz)\
**Post date:** [February 27, 2020, 4:50pm UTC](https://community.sonarsource.com/t/help-me-figure-out-why-pr-decoration-doesnt-work/20386/9 "2020-02-27T16:50:22Z")

</div>

Hello.

I disabled firewall and did the other steps before and didn’t work. I will try later on another network to see what happens.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![CCFenner](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ccfenner/32/4363_2.png) [@CCFenner](https://community.sonarsource.com/u/CCFenner)\
**Post date:** [March 2, 2020, 8:45pm UTC](https://community.sonarsource.com/t/help-me-figure-out-why-pr-decoration-doesnt-work/20386/10 "2020-03-02T20:45:02Z")

</div>

I’ve struggled with PR decoration on Github for quite a while. We had just the message that you also see “Pull request decoration did not happen…”.  
The reason in the end was that our `.git` folder was not present during the scan and Sonar refused to create PR decorations despite all required settings where made. I think this is a undocumented requirement.

---

<div class="post-metadata">

**Author:** ![pawel](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@pawel](https://community.sonarsource.com/u/pawel)\
**Post date:** [April 2, 2020, 4:47pm UTC](https://community.sonarsource.com/t/help-me-figure-out-why-pr-decoration-doesnt-work/20386/11 "2020-04-02T16:47:18Z")

</div>

I have same issue. SonarQube seems to be configured (GitLab url and token provided). sonar-scanner finished with no errors, analysis on server side as well. Some issues are found in code but PR is not decorated. That’s the only warning I get “Pull request decoration did not happen. Please configure pull request properties in the project administration.”

Last comment doesn’t help cause in my case `.git` folder is in place. SonarQube logs also don’t contain any error/warning messages that could help me debug it. What else could I do to figure it out?

---

<div class="post-metadata">

**Author:** ![dmeneses](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dmeneses/32/2933_2.png) [@dmeneses](https://community.sonarsource.com/u/dmeneses)\
**Post date:** [April 2, 2020, 7:24pm UTC](https://community.sonarsource.com/t/help-me-figure-out-why-pr-decoration-doesnt-work/20386/12 "2020-04-02T19:24:53Z")

</div>

Hi,  
Did you pick your GitLab configuration in the Pull Request Decoration settings? Is your build running in GitLab’s CI?

---

<div class="post-metadata">

**Author:** ![pawel](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@pawel](https://community.sonarsource.com/u/pawel)\
**Post date:** [April 2, 2020, 9:06pm UTC](https://community.sonarsource.com/t/help-me-figure-out-why-pr-decoration-doesnt-work/20386/13 "2020-04-02T21:06:51Z")

</div>

If project’s settings -\> pull request decoration I have configuration chosen and project id empty. Yes, I’m using GitLab’s CI. Scanner is running fine and is able to send results to SonarQube.

Last analysis is still running (for 4 hours now) but that could be unrelated issue. Update: it got somehow canceled after 12h 20m of runtime.

---

<div class="post-metadata">

**Author:** ![dmeneses](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dmeneses/32/2933_2.png) [@dmeneses](https://community.sonarsource.com/u/dmeneses)\
**Post date:** [April 3, 2020, 7:28pm UTC](https://community.sonarsource.com/t/help-me-figure-out-why-pr-decoration-doesnt-work/20386/14 "2020-04-03T19:28:20Z")

</div>

The error message indicates that while processing the analysis, SonarQube did not find the P/R decoration settings for that project.  
Could you try getting `<SONARQUBE_URL>/api/alm_settings/get_binding?project=<project_key>` ?

---

<div class="post-metadata">

**Author:** ![pawel](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@pawel](https://community.sonarsource.com/u/pawel)\
**Post date:** [April 6, 2020, 7:47am UTC](https://community.sonarsource.com/t/help-me-figure-out-why-pr-decoration-doesnt-work/20386/15 "2020-04-06T07:47:30Z")

</div>

You right. That configuration option was missing. Maybe I forgot to click “Save”. Thanks for your help!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [February 3, 2021, 7:21pm UTC](https://community.sonarsource.com/t/help-me-figure-out-why-pr-decoration-doesnt-work/20386/16 "2021-02-03T19:21:55Z")

</div>

Closed on February 3, 2021, 7:21pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
