- SonarQube 9.5.0.56709
- configuration check comes back valid
- Reset configuration to same results of SonarQube decoration comment missing from merge request in GitLab.
Hi,
Welcome to the community!
Is there anything interesting in your server logs? Could it be that your GitLab auth token expired?
Â
Ann
This is from the SQ ce.log. It shows that SQ believes it successfully posted the comment to the MR but there is no actual comment.
2022.08.18 11:47:02 INFO ce[AYKxkGDWX4ZjtWcr_U2j][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Pull Request decoration | status=SUCCESS | time=0ms
Hi @jeverett,
That line doesn’t necessarily mean the decoration succeeded. It means the “Pull Request decoration” task executor was invoked (which is should, for all MRs), and that it didn’t throw any exception. But it could also be that there’s no configuration, so no need to decorate.
- Are there more lines in your logs right after what you posted? Can you post the full logs here (and obfuscate anything that is sensitive)?
- Is your configuration validated by SonarQube?
- You can check the validity of your GitLab integration configuration by going to Administration > General Settings > DevOps Platform Integrations, and clicking on Check configuration.
- You can check the validity of your repository’s binding by going to your SonarQube project, then Project Settings > General Settings > DevOps Platform Integrations, and clicking on Check configuration.
- SonarQube ID information - Version: 9.8.0.63668 - Date: 2023-02-03
- GitLab Enterprise Edition [15.8.1-ee]
- Attempts to fix: (SonarQube stopped posting decoration to GitLab merge request)
Hi @jeverett
Since your new thread was simply a reference to your old thread, I combined the two.
Since there are a couple multi-month gaps in the timeline here, I think it’s worth restating what’s going on.
Â
Ann
All of our configurations check and look valid, however only some of our GitLab projects are not receiving the SonarQube results in the Merge Requests.
Hi,
What’s the difference between those that do & those that don’t?
Â
Ann
I don’t know which GitLab project settings are tied to SonarQube so what settings should we specifically look to review? All the GitLab projects we use with SonarQube have valid configuration checks so maybe there is something in the checks that are missed?
Hi,
Maybe take a look at the Gitlab projects you expect to be getting Merge Request analysis results but aren’t?
Â
Ann
Hi Ann,
GitLab projects have dozens of settings; we don’t know which pertain to this integration. Some guidance other than “look for differences” would be useful. Both successful and unsuccessful projects say in SQ that the configuration is valid, so what does the integration need that the validation check does not test? The analysis is working fine; only the decoration is failing.
Both projects have a properly-configured personal access token. Both have the correct reference to the GitLab API URL in the Admin / General Settings / DevOps Platform Integrations / Gitlab /Configurations screens. Both have correctly identified GitLab Project IDs in each project’s respective Admin / General Settings / DevOps Platform Integration pages. What else is there to check or set?
Also, the documentation w/re to this area presents a circular reference: The page GitLab integration which sends a user to Pull Request analysis which then refers back to the first pagein the section entitled “Report pull request status to your DevOps Platform”. This is less helpful than intended.
Thanks,
Stephen
Hi Stephen,
Welcome to the community!
This is a great starting point.
I suppose both projects (I assume the comparison field is narrowed to one working and one non-working) have the same values for those things?
Can you double-check the background tasks? (I don’t honestly expect to find anything there, but it’s worth looking.) Can you check the $SONARQUBE-HOME/logs/ce.log
to see if it says anything of interest for the failing project?
Ann
Thanks, Ann. Other than the Project IDs, these two projects are configured equally in SonarQube. Just for a gut-check, we recreated the failing project’s personal access token and SQ configuration. Nothing changed. Jesse will take a look at the logs and background tasks per your suggestion.
If this is the right spot in the ce log, I see nothing significant. Here is a scan that produced the comment to the merge request:
2023.02.07 08:42:15 INFO ce[AYYsHKlbHw-sOipOV_Mh][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Pull Request decoration | status=SUCCESS | time=0ms
2023.02.07 08:42:15 INFO ce[AYYsHKlbHw-sOipOV_Mh][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Report branch Quality Gate status to devops platforms | status=SUCCESS | time=0ms
2023.02.07 08:42:15 INFO ce[AYYsHKlbHw-sOipOV_Mh][o.s.c.t.CeWorkerImpl] Executed task | project=TaskMaster | type=REPORT | branch=master | branchType=BRANCH | id=AYYsHKlbHw-sOipOV_Mh | submitter=admin-sonarqube | status=SUCCESS | time=14326ms
Here is a scan that doesn’t produce the comment to the merge request:
2023.02.07 13:44:26 INFO ce[AYYtLknKHw-sOipOV_Mo][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Pull Request decoration | status=SUCCESS | time=0ms
2023.02.07 13:44:26 INFO ce[AYYtLknKHw-sOipOV_Mo][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Report branch Quality Gate status to devops platforms | status=SUCCESS | time=0ms
2023.02.07 13:44:39 INFO ce[AYYtLknKHw-sOipOV_Mo][o.s.c.t.CeWorkerImpl] Executed task | project=CNS | type=REPORT | branch=jeverett-sq-test | branchType=BRANCH | id=AYYtLknKHw-sOipOV_Mo | submitter=admin-sonarqube | status=SUCCESS | time=223936ms
Jesse
Hi,
I’m calling for another pair of eyes.
Â
Ann
It’s worth noting that we have upgraded a few times since this issue started hoping it would fix it but the issue still remains. We are currently running version 9.8.0.63668
Hi, do you have an update on this? TIA
Hi,
Could you please enable the debug logs on SQ Compute Engine and try again an a MR analysis on the project for which the decoration is not working?
Also, if it works for some projects and not for others, that could be a permission issue with the Gitlab Personal Access Token provided in SQ DevOps Plateform Integration Settings. Can you double-check that the owner of this PAT has proper permission on the problematic projects?
We recreated the PAT last week to same results. Here is what I found after enabling DEBUG:
2023.02.13 10:28:14 INFO ce[AYZLYcVbBx1EmaY0D2Rg][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Webhooks | globalWebhooks=0 | projectWebhooks=0 | status=SUCCESS | time=0ms
2023.02.13 10:28:14 INFO ce[AYZLYcVbBx1EmaY0D2Rg][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Pull Request decoration | status=SUCCESS | time=0ms
2023.02.13 10:28:14 INFO ce[AYZLYcVbBx1EmaY0D2Rg][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Report branch Quality Gate status to devops platforms | status=SUCCESS | time=0ms
2023.02.13 10:28:25 INFO ce[AYZLYcVbBx1EmaY0D2Rg][o.s.c.t.CeWorkerImpl] Executed task | project=CNS | type=REPORT | branch=80-mapping-tool-ui-infrastructure-performance-classes-tab | branchType=BRANCH | id=AYZLYcVbBx1EmaY0D2Rg | submitter=admin-sonarqube | status=SUCCESS | time=159663ms
2023.02.13 11:23:13 INFO ce[][o.s.p.ProcessEntryPoint] Gracefully stopping process
2023.02.13 11:23:13 INFO ce[][o.s.ce.app.CeServer] Compute Engine is stopping...
2023.02.13 11:23:13 INFO ce[][o.s.c.t.CeProcessingSchedulerImpl] Gracefully stopping workers...
2023.02.13 11:23:13 INFO ce[][o.s.s.e.CoreExtensionStopper] Stopping Governance
2023.02.13 11:23:13 INFO ce[][o.s.s.e.CoreExtensionStopper] Stopping Governance (done) | time=0ms
2023.02.13 11:23:13 INFO ce[][c.z.h.HikariDataSource] HikariPool-1 - Shutdown initiated...
2023.02.13 11:23:13 INFO ce[][c.z.h.HikariDataSource] HikariPool-1 - Shutdown completed.
2023.02.13 11:23:13 INFO ce[][o.s.ce.app.CeServer] Compute Engine is stopped
2023.02.13 11:23:42 DEBUG ce[][jdk.event.security] SecurityPropertyModification: key:networkaddress.cache.ttl, value:30
2023.02.13 11:23:42 INFO ce[][o.s.p.ProcessEntryPoint] Starting Compute Engine
2023.02.13 11:23:42 INFO ce[][o.s.ce.app.CeServer] Compute Engine starting up...
2023.02.13 11:23:42 DEBUG ce[][o.s.c.a.AnnotationConfigApplicationContext] Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2b6a9d4d