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

[Github] No token could be found with access to #147

Closed
johanneshiry opened this issue Mar 27, 2020 · 1 comment
Closed

[Github] No token could be found with access to #147

johanneshiry opened this issue Mar 27, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@johanneshiry
Copy link

johanneshiry commented Mar 27, 2020

First of all, thank you for this great plugin!

Describe the bug
I get the following exception if I have configured my app to have access to all my repositories and also new created ones.

2020.03.27 20:34:45 ERROR ce[AXEdtD4zRgI5f1Elp9xm][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 Pull Request on Github
	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.github.GithubPullRequestDecorator.decorateQualityGateStatus(GithubPullRequestDecorator.java:38)
	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.PullRequestPostAnalysisTask.finished(PullRequestPostAnalysisTask.java:132)
	at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.executeTask(PostProjectAnalysisTasksExecutor.java:113)
	at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.finished(PostProjectAnalysisTasksExecutor.java:107)
	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 java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: No token could be found with access to the requested repository with the given application ID and key
	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.github.v3.RestApplicationAuthenticationProvider.getInstallationToken(RestApplicationAuthenticationProvider.java:158)
	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.github.v4.GraphqlCheckRunProvider.createCheckRun(GraphqlCheckRunProvider.java:101)
	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.github.GithubPullRequestDecorator.decorateQualityGateStatus(GithubPullRequestDecorator.java:36)
	... 19 common frames omitted

My organization has less than 10 repos, hence #103 doesn't apply here.

To Reproduce

  1. Setup Sonarqube Version 7.9.3.33349 with Plugin Version 1.3.0
  2. Configure your GitHub Application according to the official sonarqube instructions.
  3. Execute a run on your project
  4. See error in ce.log

Expected behavior
Pull Request decoration works.

Screenshots
If applicable, add screenshots to help explain your problem.

Software Versions

Additional context
I had to switch from a working installation (same app, tokens etc.) with the following software combination (due to server changes):

  • SonarQube Version: 7.9.1.27448 with postgresql (both native)
  • Plugin Version: 1.2.1-SNAPSHOT (from an already closed and merged PR)

Any help really appreciated.
Thanks in advance!

@johanneshiry johanneshiry added the bug Something isn't working label Mar 27, 2020
@johanneshiry
Copy link
Author

After playing around a little bit and upgrading to the latest sonarqube docker image (8.2) and with the help of #112 I got it working with the self compiled version of #112 and the sonarqube docker image for 8.2.

As I did not change anything else, it might be possible that the combination of plugin and sonarqube version I used might be incompatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant