39

i've installed jenkins server and run it. i've installed kenjins control plugin on intellij as described in this lin https://github.com/dboissier/jenkins-control-plugin

try to configure jenkins settings --> test connection gives me [Missing or bad crumb data]

i am using intellij 2016.3 and jenkins server 2.19.4

thanks a lot.

Bastien Jansen
  • 8,756
  • 2
  • 35
  • 53
jam
  • 485
  • 2
  • 5
  • 14

4 Answers4

40

This solution worked for me. Here are the steps:

  1. Generate an API token by going your Jenkins home page > your name in the top right corner click > Configure > "Add new token". Copy this token.
  2. In Intellij Settings > Tools > Jenkins Plugin, fill in server address and username. For password, put in the token copied in step 1 and leave the "crumb data" section empty.

Test connection should succeed now.

mindreader
  • 1,763
  • 1
  • 20
  • 35
36

CRSF handling has improved these days - you likely don't actually need crumb data, and the error is a misnomer. You may actually need to go to <jenkins-server>/user/<your-user-name>/configure and add an API token. This token is then used as your password in the IDE configuration. See this comment

Sean
  • 2,315
  • 20
  • 25
15

You may need to get the crumb with the following URL on the browser

http://<jenkins_url>/crumbIssuer/api/json?tree=crumb

enter image description here

And put the crumb value in the Jenkins plugin settings.

enter image description here

You can look at here.

fgul
  • 5,763
  • 2
  • 46
  • 32
5

Ran into the same problem. Found the answer (by azharsikander) here: https://github.com/dboissier/jenkins-control-plugin/issues/134.

It's because the current implementation sets .crumb header but Jenkins 2.0 is using Jenkins-Crumb header.

https://github.com/dboissier/jenkins-control-plugin/blob/91ef83f318a7ebe6c50b9395342b24b0f51d542f/src/main/java/org/codinjutsu/tools/jenkins/security/DefaultSecurityClient.java#L45

bknopper
  • 1,193
  • 12
  • 28
  • could you provide more detail? I'm very new to Jenkins and can't get this working. Perhaps step by step instructions? – MikeyE Jan 04 '20 at 00:40
  • This is a somewhat older issue, what problems are you running into? The test connection gives "Missing or bad crumb data"? Are you on the latest IntelliJ and Plugin version? This issue "should" not be around anymore. If you still run into it, have you tried putting the value you get through this URL `http:///crumbIssuer/api/json?tree=crumb` (where you replace the with the url your Jenkins is running) in the *crumb* property in the plugins settings (in IntelliJ)? – bknopper Jan 06 '20 at 07:42
  • Thanks for the reply bknopper. The day after I made my comment I was able to figure out another solution. Our Jenkins server is back up and running smooth now. – MikeyE Jan 07 '20 at 10:02
  • Good to hear! Good luck! – bknopper Jan 09 '20 at 08:28