Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not decorate Gitlab merge request. 'sonar.pullrequest.gitlab.instanceUrl' has not been set in scanner properties #201

Closed
enginates opened this issue Jun 29, 2020 · 3 comments
Labels
awaiting release Merged but not currently in release version bug Something isn't working

Comments

@enginates
Copy link

enginates commented Jun 29, 2020

Describe the bug
I am getting this when I use those settings for VS C# solution. i set instanceUrl but keep getting that error.

SonarScanner.MSBuild.exe begin /k:"testgitlab"  /d:sonar.host.url="http://localhost:9000" /d:sonar.login="xxxxxxxxxxxxxxxx" /d:sonar.pullrequest.key=1 /d:sonar.pullrequest.branch=test1 /d:sonar.pullrequest.base=master /d:sonar.pullrequest.gitlab.**instanceUrl**="https://gitlab.xxxxxx.com/" /d:sonar.pullrequest.gitlab.projectId=19 /d:sonar.pullrequest.gitlab.projectUrl="https://gitlab.xxxxxx.com/testuser/gitlabtest"

MsBuild.exe /t:Rebuild

SonarScanner.MSBuild.exe end /d:sonar.login="xxxxxxxxxxxxxxxx"
2020.06.28 23:18:35 ERROR ce[AXL-FQeqAN6gvW1Hfvud][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Execution of task class com.github.mc1arke.sonarqube.plugin.ce.pullrequest.PullRequestPostAnalysisTask failed
java.lang.IllegalStateException: **Could not decorate Gitlab merge request. 'sonar.pullrequest.gitlab.instanceUrl' has not been set in scanner properties**
	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.gitlab.GitlabServerPullRequestDecorator.lambda$decorateQualityGateStatus$1(GitlabServerPullRequestDecorator.java:108)
	at java.base/java.util.Optional.orElseThrow(Optional.java:401)
	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.gitlab.GitlabServerPullRequestDecorator.decorateQualityGateStatus(GitlabServerPullRequestDecorator.java:108)
	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.PullRequestPostAnalysisTask.finished(PullRequestPostAnalysisTask.java:160)
	at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.executeTask(PostProjectAnalysisTasksExecutor.java:118)
	at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.finished(PostProjectAnalysisTasksExecutor.java:109)
	at org.sonar.ce.task.step.ComputationStepExecutor.executeListener(ComputationStepExecutor.java:91)
	at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:63)
	at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:81)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:209)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:191)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:158)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:133)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:85)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:53)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	at java.base/java.lang.Thread.run(Thread.java:832)
2020.06.28 23:18:35 INFO  ce[AXL-FQeqAN6gvW1Hfvud][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Pull Request Decoration | status=FAILED | time=46ms

To Reproduce
Steps to reproduce the behavior:

SonarScanner.MSBuild.exe begin /k:"testgitlab"  /d:sonar.host.url="http://localhost:9000" /d:sonar.login="xxxxxxxxxxxxxxxx" /d:sonar.pullrequest.key=1 /d:sonar.pullrequest.branch=test1 /d:sonar.pullrequest.base=master /d:sonar.pullrequest.gitlab.**instanceUrl**="https://gitlab.xxxxxx.com/" /d:sonar.pullrequest.gitlab.projectId=19 /d:sonar.pullrequest.gitlab.projectUrl="https://gitlab.xxxxxx.com/testuser/gitlabtest"

MsBuild.exe /t:Rebuild

SonarScanner.MSBuild.exe end /d:sonar.login="xxxxxxxxxxxxxxxx"
``

**Software Versions**
 - SonarQube Version: 8.3.1
 - Plugin Version: sq-8_2-support
@enginates enginates added the bug Something isn't working label Jun 29, 2020
@MukeshAtGit
Copy link

MukeshAtGit commented Jul 13, 2020

Same issue with me here are the logs(ce.log):

java.lang.IllegalStateException: Could not decorate Gitlab merge request. 'sonar.pullrequest.gitlab.instanceUrl' has not been set in scanner properties
	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.gitlab.GitlabServerPullRequestDecorator.lambda$decorateQualityGateStatus$1(GitlabServerPullRequestDecorator.java:105)

sonarqube version: 8.2
Plugin Version: sq-8_2-support

please reply

@MukeshAtGit
Copy link

Hi all this work for me:
#112 (comment)

PiekJ added a commit to PiekJ/sonarqube-community-branch-plugin that referenced this issue Jul 23, 2020
Fixed setting the project id on sonarqube project pull decorate option when selecting GitLab.
When project id is set use that instead of the sonarqube scanner property.
Fixed always evaluating fetching sonarqube scanner property for instance url.
PiekJ added a commit to PiekJ/sonarqube-community-branch-plugin that referenced this issue Jul 23, 2020
Fixed setting the project id on sonarqube project pull decorate option when selecting GitLab.
When project id is set use that instead of the sonarqube scanner property.
Fixed always evaluating fetching sonarqube scanner property for instance url.
PiekJ added a commit to PiekJ/sonarqube-community-branch-plugin that referenced this issue Jul 23, 2020
Fixed setting the project id on sonarqube project pull decorate option when selecting GitLab.
When project id is set use that instead of the sonarqube scanner property.
Fixed always evaluating fetching sonarqube scanner property for instance url.
PiekJ added a commit to PiekJ/sonarqube-community-branch-plugin that referenced this issue Jul 23, 2020
Fixed setting the project id on sonarqube project pull decorate option when selecting GitLab.
When project id is set use that instead of the sonarqube scanner property.
Fixed always evaluating fetching sonarqube scanner property for instance url.
PiekJ added a commit to PiekJ/sonarqube-community-branch-plugin that referenced this issue Jul 25, 2020
Fixed setting the project id on sonarqube project pull decorate option when selecting GitLab.
When project id is set use that instead of the sonarqube scanner property.
Fixed always evaluating fetching sonarqube scanner property for instance url.
PiekJ added a commit to PiekJ/sonarqube-community-branch-plugin that referenced this issue Jul 27, 2020
Fixed setting the project id on sonarqube project pull decorate option when selecting GitLab.
When project id is set use that instead of the sonarqube scanner property.
Fixed always evaluating fetching sonarqube scanner property for instance url.
PiekJ added a commit to PiekJ/sonarqube-community-branch-plugin that referenced this issue Aug 3, 2020
Fixed setting the project id on sonarqube project pull decorate option when selecting GitLab.
When project id is set use that instead of the sonarqube scanner property.
Fixed always evaluating fetching sonarqube scanner property for instance url.
mc1arke pushed a commit that referenced this issue Aug 3, 2020
SonarQube 8.2 introduced the ability to set the repository ID through the front-end for use when decorating a Gitlab Merge Request, although this was missed from the plugin when implementing the appropriate interfaces. This change therefore introduces the required implementation, and additional only attempts to resolve the server ID from scanner properties when the ID has not been set through the front-end,
@mc1arke mc1arke added the awaiting release Merged but not currently in release version label Aug 4, 2020
@mc1arke
Copy link
Owner

mc1arke commented Oct 27, 2020

Released in 1.5.0 of the plugin

@mc1arke mc1arke closed this as completed Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting release Merged but not currently in release version bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants