Hi all,
I am trying to connect to our internal JIRA server using some examples but have a problem. I am using the following code:
from jira import JIRA
from getpass import getpass
import sys
import http.client
def main():
http.client.HTTPConnection.debuglevel=2
http.client.HTTPResponse.debuglevel=2
jira_options = {
'server': 'https://jira.internal.server/',
'verify': 'False'
}
try:
jira = JIRA(options=jira_options, basic_auth=('user1', 'mypassword')) # a username/password tuple
except Exception as e:
jira = None
sys.exit(1)
# Get the mutable application properties for this server (requires
# jira-system-administrators permission)
# props = jira.application_properties()
# Find all issues reported by the admin
issues = jira.search_issues('assignee=user1')
# Find the top three projects containing issues reported by admin
from collections import Counter
top_three = Counter(
[issue.fields.project.key for issue in issues]).most_common(3)
if __name__ == "__main__":
main()Below is failed result:
send: b'CONNECT jira.internal.server:443 HTTP/1.0'
send: b''
WARNING:root:[Errno 2] No such file or directory while doing GET https://jira.internal.server/rest/api/2/serverInfo [{'headers': {'Accept-Encoding': 'gzip, deflate', 'Connection': 'keep-alive', 'User-Agent': 'python-requests/2.7.0 CPython/3.5.0 Windows/7', 'X-Atlassian-Token': 'no-check', 'Accept': '*/*', 'Cache-Control': 'no-cache', 'Content-Type': 'application/json'}, 'params': None}]
WARNING:root:Got recoverable error from GET https://jira.internal.server/rest/api/2/serverInfo, will retry [1/3] in 10s. Err: [Errno 2] No such file or directory
send: b'CONNECT jira.internal.server:443 HTTP/1.0'
send: b''
WARNING:root:[Errno 2] No such file or directory while doing GET https://jira.internal.server/rest/api/2/serverInfo [{'headers': {'Accept-Encoding': 'gzip, deflate', 'Connection': 'keep-alive', 'User-Agent': 'python-requests/2.7.0 CPython/3.5.0 Windows/7', 'X-Atlassian-Token': 'no-check', 'Accept': '*/*', 'Cache-Control': 'no-cache', 'Content-Type': 'application/json'}, 'params': None}]
WARNING:root:Got recoverable error from GET https://jira.internal.server/rest/api/2/serverInfo, will retry [2/3] in 20s. Err: [Errno 2] No such file or directory
send: b'CONNECT jira.internal.server:443 HTTP/1.0'
send: b''
WARNING:root:[Errno 2] No such file or directory while doing GET https://jira.internal.server/rest/api/2/serverInfo [{'headers': {'Accept-Encoding': 'gzip, deflate', 'Connection': 'keep-alive', 'User-Agent': 'python-requests/2.7.0 CPython/3.5.0 Windows/7', 'X-Atlassian-Token': 'no-check', 'Accept': '*/*', 'Cache-Control': 'no-cache', 'Content-Type': 'application/json'}, 'params': None}]
WARNING:root:Got recoverable error from GET https://jira.internal.server/rest/api/2/serverInfo, will retry [3/3] in 30s. Err: [Errno 2] No such file or directory
Process finished with exit code 1Does anybody know what is wrong with this code ?