Hi All,
Recently we have migrated to 2.440.1 LTS version of Jenkins. Update all the required plugin to fulfill the compatibility. But we are facing several issue to execute our freestyle and pipeline jobs.
It throws 403 for any type of POST request. I have fixed one place where it shows the content type set was text/plain at hudson-behaviour.json file.
I have changed headers: crumb.wrap({}), to headers: crumb.wrap({
“Content-Type”: “application/x-www-form-urlencoded”,
}),
and it is working. But at build now option, it asked to changed at configurable.js file. But i am unable to find this file under jenkins folder or Jenkins home folder. Please help me to resolve this issue. If you required any more info, please let me know.
You shouldn’t need to modify any files in order to be able to run jobs.
If this doesn’t work that would mean there is a severe bug in Jenkins. Using 2.440.1 myself and all works fine without issues.
403 normally means that you lack permission to run the job.
Which version of Jenkins did you use before?
Do you see this behaviour when triggering jobs via UI or via rest api? If via rest api, are you using a user with token or user with password.
Which line in hudson-behaviour.js did you change?
Do you have this problem for jobs with parameters or jobs without parameters?
Hi Markus,
Thank you for reply on this.
I have migrated from 2.387.1 version to 2.440.1.
When i add a parameter to job, then it is working fine. I mean Build with Parameter is working fine.
In hudson-behaviour.js i have make the following changes:
At line no 2092 : make headers: crumb.wrap({}), To headers: crumb.wrap({
** “Content-Type”: “application/x-www-form-urlencoded”,**
** }),**
I have problem with jobs without parameters. Job with parameter is working fine.
Please suggest.
The line you changed should not have an effect whether the job can be built. The method it is in (refreshPart) is there to update the sidepanel widgets (build history).
Anything logged in the browser console?
In the browser try to set a break point at /adjuncts/(random string)/lib/hudson/project/configurable/configurable.js line 7 and /adjuncts/(random string)/lib/layout/task/task.js line 12 and if it doesn’t get there in line 2
You are right Markus. The change I have done in hudson-behaviour.json is only for build history.
I have made the similar changes in configurable.js and task.js using chrome dev tool. And it works perfectly. But I am unable to find configurable.js file to make this changes permanently. Can you help me on this.
The 2 files are adjuncts that means they are inside the jar file of jenkins-core.
And modifying things in the FS is not really sustainable. The next jenkins update will require that you repeat your changes.
Still strange that you run into this problem. I would expect that only when the job has parameters that you need to set the Content-Type.
Do you see this problem on all jobs without parameters or only for some of them?
Maybe some plugin implicitly adds parameters that are not visible?
Can you create a new freestyle job that does nothing. Just create and save without configuring anything. Then click on Build Now
And post the created config.xml here please
Do the same with a pipeline job.
Also can you please provide a list of all plugins with version that you have installed
I setup a jenkins with all the mentioned plugin (but in latest version) and everything works as expected.
As you don’t have latest plugin version please update all plugins to the latest version.
These 3 plugins are not required anymore and should be uninstalled:
JavaScript GUI Lib: ACE Editor bundle plugin
JavaScript GUI Lib: Handlebars bundle plugin
JavaScript GUI Lib: Moment.js bundle plugin
Some plugins can be uninstalled because only one of them can be used:
e.g from the following only one is required
Google Login
LDAP
PAM Authentication
Gitlab Authentication
Same for
Matrix authorization
Role Strategy
Unused plugins:
bootstrap 4 API
poppers.js 2 api
poppers.js api (after uninstalling bootstrap 4)
Thank you for reply on this. As per your suggestion, I have uninstalled/update plugins. But issue is still there. I am not able to build a job without parameter and not able to stop it.
One thing I want to inform you that it is working fine at localhost. We have deployed at server and access it through https, it fails on both places.
How are you running your Jenkins?
Have you installed the Jenkins package via package manager, are you using a docker container.
Do you have a reverse proxy in front that is doing the ssl termination?