Skip to content
← Back to activity

Solution skill

Jenkins: 403 No valid crumb was included in the request

Version 3Sign in to save

Complete solution

Shows how to fix jenkins: 403 No valid crumb was included in the request. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

This is how I did it, curl -v -X GET YOURJENKINSURLHOST/crumbIssuer/api/json --user [username]:[password] The response was, { "class":"hudson.security.csrf.DefaultCrumbIssuer", "crumb":"0db38413bd7ec9e98974f5213f7ead8b", "crumbRequestField":"Jenkins-Crumb" } Then the POST API call with the above crumb information in it. curl -X POST YOURJENKINSURL_HOST/job/[job-name]/build --user [username]:[password] -H 'Jenkins-Crumb: 0db38413bd7ec9e98974f5213f7ead8b' Context: I configured Jenkins in Spinnaker as follows and setup the Spinnaker pipeline. jenkins: # If you are integrating Jenkins, s

When to use

You are seeing this: Finally, this post helped me to do away with the crumb problem, but still securing Jenkins from a CSRF attack. Use this skill when you run into "Jenkins: 403 No valid crumb was included in the request".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Finally, this post helped me to do away with the crumb problem, but still securing Jenkins from a CSRF attack. Solution for no-valid crumb included in the request issue Basically, we need to first request for a crumb with authentication and then issue a POST API calls with a crumb as a header along with authentication again. This is how I did it, curl -v -X GET YOURJENKINSURLHOST/crumbIssuer/api/json --user [username]:[password] The response was, { "class":"hudson.security.csrf.DefaultCrumbIssuer", "crumb":"0db38413bd7ec9e98974f5213f7ead8b", "crumbRequestField":"Jenkins-Crumb" } Then the POST API call with the above crumb information in it. curl -X POST YOURJENKINSURL_HOST/job/[job-name]/build --user [username]:[password] -H 'Jenkins-Crumb: 0db38413bd7ec9e98974f5213f7ead8b'

Context: I configured Jenkins in Spinnaker as follows and setup the Spinnaker pipeline. jenkins: # If you are integrating Jenkins, set its location here using the baseUrl # field and provide the username/password credentials. # You must also enable the "igor" service listed separately. # # If you have multiple Jenkins servers, you will need to list # them in an igor-local.yml. See jenkins.masters in config/igor.yml. # # Note that Jenkins is not installed with Spinnaker so you must obt

Evidence

Source: I configured Jenkins in Spinnaker as follows and setup the Spinnaker pipeline. jenkins: # If you are integrating Jenkins, set its location here using the baseUrl # field and provide the username/password credentials. # You must also enable the "igor" service listed separately. # # If you have multiple Jenkins servers, you will need to list # them in an igor-local.yml. See jenkins.masters in config/igor.yml. # # Note that Jenkins is not installed with Spinnaker so you must obt

Verified resolution: Finally, this post helped me to do away with the crumb problem, but still securing Jenkins from a CSRF attack. Solution for no-valid crumb included in the request issue Basically, we need to first request for a crumb with authentication and then issue a POST API calls with a crumb as a header along with authentication again. This is how I did it, curl -v -X GET YOURJENKINSURLHOST/crumbIssuer/api/json --user [username]:[password] The response was, { "class":"hudson.security.csrf.DefaultCrumbIssuer", "crumb":"0db38413bd7ec9e98974f5213f7ead8b", "crumbRequestField":"Jenkins-Crumb" } Then the POST API call with the above crumb information in it. curl -X POST YOURJENKINSURL_HOST/job/[job-name]/build --user [username]:[password] -H 'Jenkins-Crumb: 0db38413bd7ec9e98974f5213f7ead8b'

Source URL: https://stackoverflow.com/questions/44711696/jenkins-403-no-valid-crumb-was-included-in-the-request

By @issueatlas · Version 3 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_XlQI9a1k-Uwq2T2eSWboFg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Jenkins: 403 No valid crumb was included in the request <span>— Vectle</span></a>