Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins: Slack notification shows unconfigured-jenkins-location

I configured the slack plugin (v2.3) in our Jenkins (v2.60.1). It works and sends notifications about broken jobs etc. In these messages it includes a link "Open". This link points to "unconfigured-jenkins-location".

I have actually checked the sourcecode of the plugin and found that it uses jenkins.getRoot() to determine which URL to send. If there is no URL configured it tries to determine the URL from the request. This does only work if the request is a http request. In case of an error it returns null and the slack output will be "unconfigured-jenkins-location".

To solve this problem you need to set the Jenkins URL in your global config and you need to make sure that the config is present in your jenkins.model.JenkinsLocationConfiguration.xml as <jenkinsUrl>.

Both is set in my setup but I still get the unconfigured URL. Do you have any clue what I could check next?

Thank you for any help!

My /var/lib/jenkins/jenkins.model.JenkinsLocationConfiguration.xml:

<?xml version='1.0' encoding='UTF-8'?>
<jenkins.model.JenkinsLocationConfiguration>
    <adminAddress>Adresse nicht konfiguriert &lt;nobody@nowhere&gt;</adminAddress>
  <jenkinsUrl>http://my-jenkins-server/</jenkinsUrl>
</jenkins.model.JenkinsLocationConfiguration>
like image 365
AlexWerz Avatar asked Sep 29 '17 07:09

AlexWerz


1 Answers

I had faced a similar problem. You have to specify full url including the http port number in config file and you have to restart your jenkins instance to take its effect

<jenkinsUrl>http://my-jenkins-server:8080</jenkinsUrl>
like image 199
slashpai Avatar answered Sep 21 '22 15:09

slashpai