Issue in connecting with JIRA python

六眼飞鱼酱① 提交于 2019-12-11 05:47:23

问题


I am using JIRA authentication in python:

from jira.client import JIRA
option={'server':'https://jira.nutanix.com/','verify':False}
jira_obj=JIRA(options=options, basic_auth=(user, password))

The code is not correct, I just want to show the way I call the JIRA API.

I am getting error as:

WARNING:root:EOF occurred in violation of protocol (_ssl.c:590) while doing GET https://jira.nutanix.com/rest/api/2/serverInfo [{u'headers': {'Accept-Encoding': 'gzip, deflate', 'Accept': '/', 'User-Agent': 'python-requests/2.10.0', 'Connection': 'keep-alive', u'X-Atlassian-Token': u'no-check', u'Cache-Control': u'no-cache', u'Content-Type': u'application/json'}, 'params': None}]

WARNING:root:Got recoverable error from GET https://jira.nutanix.com/rest/api/2/serverInfo, will retry [1/3] in 10s. Err: EOF occurred in violation of protocol (_ssl.c:590) Traceback (most recent call last):

Any help on this? I'm on macOS 10.11

Full traceback:

Traceback (most recent call last):
  File "/Users/syam.mohan/PycharmProjects/cluster_busy/gold_closer.py",   line 25, in <module>
  print connect_jira('syam.mohan','pwd',option)
  File "/Users/syam.mohan/PycharmProjects/cluster_busy/gold_closer.py",    line 12, in connect_jira
    jira = JIRA('https://jira.nutanix.com/',basic_auth=(user,    password))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/jira/client.py", line 261, in __init__
si = self.server_info()
  File    "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-  packages/jira/client.py", line 1619, in server_info
    return self._get_json('serverInfo')
  File    "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-  packages/jira/client.py", line 2035, in _get_json
    r = self._session.get(url, params=params)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/jira/resilientsession.py", line 130, in get
    return self.__verb('GET', url, **kwargs)
  File     "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-   packages/jira/resilientsession.py", line 116, in __verb
    if self.__recoverable(response_or_exception, url, verb.upper(),     retry_number):
  File  "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/jira/resilientsession.py", line 88, in __recoverable
    time.sleep(delay)

KeyboardInterrupt


回答1:


Please try

sudo apt-get install libffi-dev
sudo pip install -U requests[security]

Source: Python Requests requests.exceptions.SSLError: [Errno 8] _ssl.c:504: EOF occurred in violation of protocol



来源:https://stackoverflow.com/questions/45104975/issue-in-connecting-with-jira-python

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!