<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">The bug[1] is reporting this issue.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">And there is a bufix patch[2] for jenkins 2.46.2 version</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">[1] <a href="https://storyboard.openstack.org/#!/story/2001074">https://storyboard.openstack.org/#!/story/2001074</a></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">[2] <a href="https://gerrit.wikimedia.org/r/#/c/351606/">https://gerrit.wikimedia.org/r/#/c/351606/</a></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Best,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">xinliang</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 26 June 2017 at 17:26, Xinliang Liu <span dir="ltr"><<a href="mailto:xinliang.liu@linaro.org" target="_blank">xinliang.liu@linaro.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Hi,</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On 26 June 2017 at 16:42, 沈敏江 <span dir="ltr"><<a href="mailto:shenminjiang@fusionstack.cn" target="_blank">shenminjiang@fusionstack.cn</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hi,</div><div>I am trying to set up a CI environment, and get some troubles. I follow the guild '<a href="https://docs.openstack.org/infra/openstackci/third_party_ci.html" target="_blank">https://docs.openstack.org/in<wbr>fra/openstackci/third_party_ci<wbr>.html</a>', and in the end of step 'start nodepool' I get a HTTP Error 405, following is the error log in /var/log/nodepool/nodepool.log<wbr>:</div><div>```</div><div><div>2017-06-22 10:53:08,712 INFO nodepool.NodeLauncher: Node id: 469 is ready</div><div>2017-06-22 10:53:08,889 ERROR nodepool.NodeLauncher: HTTPError launching node id: 469 in provider: local_01 error:</div><div>Traceback (most recent call last):</div><div> File "/usr/local/lib/python2.7/dist<wbr>-packages/nodepool/nodepool.<wbr>py", line 426, in _run</div><div> dt = self.launchNode(session)</div><div> File "/usr/local/lib/python2.7/dist<wbr>-packages/nodepool/nodepool.<wbr>py", line 581, in launchNode</div><div> self.createJenkinsNode()</div><div> File "/usr/local/lib/python2.7/dist<wbr>-packages/nodepool/nodepool.<wbr>py", line 606, in createJenkinsNode</div><div> jenkins.createNode(**args)</div><div> File "/usr/local/lib/python2.7/dist<wbr>-packages/nodepool/jenkins_<wbr>manager.py", line 112, in createNode</div><div> return self.submitTask(CreateNodeTask<wbr>(**args))</div><div> File "/usr/local/lib/python2.7/dist<wbr>-packages/nodepool/task_manage<wbr>r.py", line 121, in submitTask</div><div> return task.wait()</div><div> File "/usr/local/lib/python2.7/dist<wbr>-packages/nodepool/task_manage<wbr>r.py", line 57, in run</div><div> self.done(self.main(client))</div><div> File "/usr/local/lib/python2.7/dist<wbr>-packages/nodepool/jenkins_<wbr>manager.py", line 49, in main</div><div> jenkins.create_node(**args)</div><div> File "/usr/local/lib/python2.7/dist<wbr>-packages/nodepool/myjenkins.<wbr>py", line 139, in create_node</div><div> self.server + CREATE_NODE % urlparse.urlencode(params)))</div><div> File "/usr/local/lib/python2.7/dist<wbr>-packages/jenkins/__init__.py"<wbr>, line 453, in jenkins_open</div><div> response = urlopen(req, timeout=self.timeout).read()</div><div> File "/usr/lib/python2.7/urllib2.py<wbr>", line 127, in urlopen</div><div> return _opener.open(url, data, timeout)</div><div> File "/usr/lib/python2.7/urllib2.py<wbr>", line 410, in open</div><div> response = meth(req, response)</div><div> File "/usr/lib/python2.7/urllib2.py<wbr>", line 523, in http_response</div><div> 'http', request, response, code, msg, hdrs)</div><div> File "/usr/lib/python2.7/urllib2.py<wbr>", line 448, in error</div><div> return self._call_chain(*args)</div><div> File "/usr/lib/python2.7/urllib2.py<wbr>", line 382, in _call_chain</div><div> result = func(*args)</div><div> File "/usr/lib/python2.7/urllib2.py<wbr>", line 531, in http_error_default</div><div> raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)</div><div>HTTPError: HTTP Error 405: Method Not Allowed</div><div>2017-06-22 10:53:09,976 INFO nodepool.NodePool: Deleted jenkins node id: 469</div></div><div>```</div><div>I checked the code at the end of file '/usr/local/lib/python2.7/dist<wbr>-packages/nodepool/myjenkins.<wbr>py', and found that the default http method is 'GET', so I change the method to 'POST',and solved the problem.</div><div>The changed code is following, where the commented code is the original code, and the rest are what I added.:</div><div>```</div><div><div> req = urlrequest.Request(</div><div> self.server + CREATE_NODE % urlparse.urlencode(params))</div><div> method = "POST"</div><div> req.get_method = lambda: method</div><div> self.jenkins_open(req)</div><div> #self.jenkins_open(urlrequest.<wbr>Request(</div><div> # self.server + CREATE_NODE % urlparse.urlencode(params)))</div></div><div>```</div><div>So, my question is: Are there any config file that I can set the HTTP method to 'POST', or is there a bug needed to be fixed? I need your help, thanks!</div></blockquote><div><br></div></div></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I met the same issue recently. This cause might be new jenkins (>= 2.46.1) change to POST method.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Add a empty body in the request will make it use POST method which should fix this issue:</div><div class="gmail_default"><font face="arial, helvetica, sans-serif">self.server + CREATE_NODE % urlparse.urlencode(params))) ==> self.server + CREATE_NODE % urlparse.urlencode(params), b''))</font><br></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">Best,</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">xinliang</font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><br></div><div>Best regards</div><div>Minjiang Shen</div><br>______________________________<wbr>_________________<br>
OpenStack-Infra mailing list<br>
<a href="mailto:OpenStack-Infra@lists.openstack.org" target="_blank">OpenStack-Infra@lists.openstac<wbr>k.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-infra" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi<wbr>-bin/mailman/listinfo/openstac<wbr>k-infra</a><br></blockquote></div><br></div></div>
</blockquote></div><br></div>