[JIRA] (JENKINS-47776) sonarqube integration doesn't authenticate

12 views
Skip to first unread message

jonas.d.lindstrom@netent.com (JIRA)

unread,
Apr 13, 2018, 10:11:02 AM4/13/18
to jenkinsc...@googlegroups.com
Jonas Lindström edited a comment on Improvement JENKINS-47776
 
Re: sonarqube integration doesn't authenticate
I have tried the suggested solution with a {{withSonarQubeEnv}} block, i.e.
{code:java}
withSonarQubeEnv(<SonarQube installation ID>) {
  step([$class : 'InfluxDbPublisher',
  customData : null,
  customDataMap : null,
  customPrefix : null,
  customProjectName: null,
  target : 'jenkins_data'])
}{code}
Unfortunately I still get HTTP 401. I have verified that SONAR_AUTH_TOKEN is set inside the block, but it's not accessible to the InfluxDB plugin, it is still {{null}}. Perhaps I am doing something wrong. Have you been able to verify the fix with Jenkins pipeline, [~aleksisimell]?


Running plugin version 1.14.
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

jonas.d.lindstrom@netent.com (JIRA)

unread,
Apr 13, 2018, 10:11:02 AM4/13/18
to jenkinsc...@googlegroups.com

I have tried the suggested solution with a withSonarQubeEnv block, i.e.

withSonarQubeEnv(<SonarQube installation ID>) {
  step([$class : 'InfluxDbPublisher',
  customData : null,
  customDataMap : null,
  customPrefix : null,
  customProjectName: null,
  target : 'jenkins_data'])
}

Unfortunately I still get HTTP 401. I have verified that SONAR_AUTH_TOKEN is set inside the block, but it's not accessible to the InfluxDB plugin, it is still null. Perhaps I am doing something wrong. Have you been able to verify the fix with Jenkins pipeline, Aleksi Simell?

cwebb@thoughtworks.com (JIRA)

unread,
Apr 17, 2018, 5:50:03 AM4/17/18
to jenkinsc...@googlegroups.com
Christopher Webb reopened an issue
 

Confirmed that this doesn't work in a Jenkins declarative pipeline

Jenkins / Improvement JENKINS-47776
Change By: Christopher Webb
Resolution: Done
Status: Resolved Reopened

trysharmaji@gmail.com (JIRA)

unread,
Jun 26, 2018, 9:37:02 PM6/26/18
to jenkinsc...@googlegroups.com
Rahul Sharma commented on Improvement JENKINS-47776
 
Re: sonarqube integration doesn't authenticate

Can someone post an example snippet on how to pass the Auth Token to the plugin in a jenkins Pipeline. It works fine if i add a JUnit in the code base but i am not able to pass it from Pipeline to the plugin in a real environment.

This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

christoph.forster@swarovski.com (JIRA)

unread,
Nov 7, 2018, 3:08:02 AM11/7/18
to jenkinsc...@googlegroups.com

Problem still occurs with Plugin Version 1.20

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

christoph.forster@swarovski.com (JIRA)

unread,
Nov 7, 2018, 3:31:02 AM11/7/18
to jenkinsc...@googlegroups.com
Christoph Forster edited a comment on Improvement JENKINS-47776
Problem still occurs with Plugin Version 1.20 .

Jenkins: 2.150

SonarQube: 7.1

The Token is valid and Environment Variable "SONAR_AUTH_TOKEN" is set with the correct value

christoph.forster@swarovski.com (JIRA)

unread,
Dec 3, 2018, 9:05:02 AM12/3/18
to jenkinsc...@googlegroups.com

I managed it to send the Authentication using a "Jenkins Global Environment Variable" named "SONAR_AUTH_TOKEN".

Also it is important (using SonarQube  7.4 and InfluxDB Plugin 1.20.1) to set an Environment Variable "SONAR_HOST_URL".

Nevertheless I receive a JSonException now, but this is another Problem ...

christoph.forster@swarovski.com (JIRA)

unread,
Dec 3, 2018, 9:07:02 AM12/3/18
to jenkinsc...@googlegroups.com
Christoph Forster edited a comment on Improvement JENKINS-47776
I managed it to send the Authentication using a "Jenkins Global Environment Variable" named "SONAR_AUTH_TOKEN".

Also it is important (using SonarQube  7.4 and InfluxDB Plugin 1.20.1) to set an Environment Variable "SONAR_HOST_URL".

Nevertheless I receive a JSonException now, but I don't receive JSon Content but the loading page of SonarQube this is another Problem ...

christoph.forster@swarovski.com (JIRA)

unread,
Dec 19, 2018, 7:48:02 AM12/19/18
to jenkinsc...@googlegroups.com

jonas.d.lindstrom@netent.com (JIRA)

unread,
Dec 19, 2018, 8:01:03 AM12/19/18
to jenkinsc...@googlegroups.com

christoph.forster@swarovski.com (JIRA)

unread,
Dec 19, 2018, 9:33:02 AM12/19/18
to jenkinsc...@googlegroups.com

axel@latvala.com (JIRA)

unread,
Jul 1, 2019, 9:35:06 AM7/1/19
to jenkinsc...@googlegroups.com

This seems to be an issue with some kind of scope (I am not terribly familiar with the inner workings of jenkins).

Using the WithSonarQubeEnv provides the auth token and host url, but the InfluxDB plugin seems not to be able to access it (even tho it reads this variable in the same exact way as the host url, which succeeds). BUT as a workaround, doing as Christoph Forster mentioned, setting the sonar auth token as a GLOBAL env variable (that is, Manage Jenkins -> Configure System -> Global properties -> Environment variables, enable and add SONAR_AUTH_TOKEN). This is insecure, since this kind of information is supposed to be handled by Credentials Provider, so use only in dire situations. I am confident that Aleksi Simell will find the root cause to this and correct it (I made a small PR relating to this, wink wink).

axel@latvala.com (JIRA)

unread,
Jul 1, 2019, 9:36:03 AM7/1/19
to jenkinsc...@googlegroups.com
Axel Latvala edited a comment on Improvement JENKINS-47776
This seems to be an issue with some kind of scope (I am not terribly familiar with the inner workings of jenkins).

Using the WithSonarQubeEnv provides the auth token and host url, but the InfluxDB plugin seems not to be able to access it (even tho it reads this variable in the same exact way as the host url, which succeeds). BUT as a workaround, doing as [~forster_ch] mentioned, setting the sonar auth token as a GLOBAL env variable (that is, Manage Jenkins -> Configure System -> Global properties -> Environment variables, enable and add SONAR_AUTH_TOKEN). This is insecure, since this kind of information is supposed to be handled by Credentials Provider, so use only in dire situations. I am confident that [~aleksisimell] will find the root cause to this and correct it (I made a small PR relating to this, wink wink).

And to add, I am using the Multibranch Declarative Pipelines when testing this.

aleksi.simell@eficode.com (JIRA)

unread,
Aug 22, 2019, 5:43:02 AM8/22/19
to jenkinsc...@googlegroups.com
Aleksi Simell updated Improvement JENKINS-47776
 

Issue fixed with https://github.com/jenkinsci/influxdb-plugin/pull/74. Will be available in next release.

Change By: Aleksi Simell
Status: Reopened Fixed but Unreleased
Resolution: Fixed

aleksi.simell@eficode.com (JIRA)

unread,
Aug 28, 2019, 7:01:05 AM8/28/19
to jenkinsc...@googlegroups.com

aleksi.simell@eficode.com (JIRA)

unread,
Oct 23, 2019, 6:38:04 AM10/23/19
to jenkinsc...@googlegroups.com
Aleksi Simell closed an issue as Fixed
Change By: Aleksi Simell
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

aleksi.simell@eficode.com (JIRA)

unread,
Oct 23, 2019, 6:38:05 AM10/23/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages