Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Make sktm work with Jenkins CSRF protection enabled #22

Open
spbnick opened this issue Apr 3, 2018 · 0 comments
Open

Make sktm work with Jenkins CSRF protection enabled #22

spbnick opened this issue Apr 3, 2018 · 0 comments

Comments

@spbnick
Copy link
Contributor

spbnick commented Apr 3, 2018

Make sktm work with Jenkins with Cross Site Request Forgery protection enabled. At the moment sktm fails to access Jenkins if it's enabled:

[skt@bkr-hv02 ~]$ ${HOME}/sktm/sktm.py -v baseline git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
[9362] 2018-04-03 04:12:54,953     INFO   checking baseline: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git [for-next]
Traceback (most recent call last):
  File "/home/skt/sktm/sktm.py", line 127, in <module>
    args.func(sw, cfg)
  File "/home/skt/sktm/sktm.py", line 85, in cmd_baseline
    sw.check_baseline()
  File "/home/skt/sktm/sktm/__init__.py", line 161, in check_baseline
    makeopts=self.makeopts),
  File "/home/skt/sktm/sktm/jenkins.py", line 212, in build
    self.server.build_job(jobname, params)
  File "/usr/lib/python2.7/site-packages/jenkinsapi/jenkins.py", line 170, in build_job
    self[jobname].invoke(build_params=params or {})
  File "/usr/lib/python2.7/site-packages/jenkinsapi/job.py", line 209, in invoke
    allow_redirects=False
  File "/usr/lib/python2.7/site-packages/jenkinsapi/utils/requester.py", line 151, in post_and_confirm_status
    response.text.encode('UTF-8')
jenkinsapi.custom_exceptions.JenkinsAPIException: Operation failed. url=http://bkr-hv02.dsal.lab.eng.bos.redhat.com:8080/job/skt_test/buildWithParameters, data={'json': '{"redirectTo": ".", "parameter": [{"name": "baserepo", "value": "git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git"}, {"name": "ref", "value": "for-next"}], "statusCode": "303"}', 'ref': 'for-next', 'baserepo': 'git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git'}, headers={'Content-Type': 'application/x-www-form-urlencoded'}, status=403, text=<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 403 No valid crumb was included in the request</title>
</head>
<body><h2>HTTP ERROR 403</h2>
<p>Problem accessing /job/skt_test/buildWithParameters. Reason:
<pre>    No valid crumb was included in the request</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>

</body>
</html>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant