In our Jenkins System Log we see many instances of messages like these:
Jun 08, 2021 12:09:17 PM WARNING hudson.security.csrf.CrumbFilter doFilter
Found invalid crumb 3554fd3884df49f975319b4852c6caef3f8f0f96da8e2bfbcc493abf78cdc9d3. If you are calling this URL with a script, please use the API Token instead. More information: https://jenkins.io/redirect/crumb-cannot-be-used-for-script
Jun 08, 2021 12:09:17 PM WARNING hudson.security.csrf.CrumbFilter doFilter
No valid crumb was included in request for /jenkins/view/Matrix%20jobs/ajaxBuildQueue by <username>. Returning 403.
This now mostly happens with multiple tabs (some of which have pages loaded under the old session with a now invalid/expired crumb), or when youâre using some sort of bad automation that still assumes that crumbs for specific users never expire.
If we stop logging this, we also no longer help users understand why their old scripts stopped working.
Iâm not saying we shouldnât change this, just pointing out thereâs a downside. If we want some folks to have a cleaner system log while no longer helping others to understand why their scripts start breaking after a long overdue update, we can easily change this.
Hello,
We start to configure the Jenkins Operator (latest version - Latest (v0.6.x)Latest (v0.6.x) | Jenkins Operator jenkins/jenkins:2.277.4-lts-alpine).
In some cases we get in jenkins UI the following error message:
HTTP ERROR 403 No valid crumb was included in the request
The original topic was about getting the error while doing api calls. That recommends you use api tokens so you donât have the issue.
For UI issues though, thats usually misconfiguration, proxy not passing headers right. Your jenkins url in your config doesnât match the url your accessing with it. http vs https, etc.
is is possible that the operator is doing something weird. Just in case we are going to ping @Sig00rd
Operator only runs a script to enable CSRF Protection with Default Crumb Issuer.
You can configure Operator not to set this (setting Jenkins CRâs spec.master.disableCSRFProtection to true) if youâre fine with less secure connection.
In general this problem doesnât happen with standard Jenkins installations with Operator, and it probably requires some additional configuration to fix, eg. if in your case the requests to Jenkins API go through some load balancer.