1

I'm using jira-python library to gain API access to our company account on Jira. This is the block of code that should work according to the docs:

from jira.client import JIRA

jira = JIRA(options={'server': 'https://jira.xyz.co.uk'},
        basic_auth=('marek@xyz.co.uk', 'my_token'))

Taking into account the fact that cookie-based authentication no longer works I generated API tokens and parsed them into code, yet I'm getting error:

WARNING:root:Got recoverable error from GET https://jira.xyz.co.uk/rest/api/2/serverInfo, will retry [2/3] in 5.527397890949137s. Err: 401 

And this just loops and loops until I hit Ctrl+c.

I found this topic here Issue in connecting with JIRA python where somebody asked the very same question but the solution didn't work for me as the missing libraries aren't missing on my system.

What else I could try ?

Christopher Graf
  • 1,929
  • 1
  • 17
  • 34
Mark
  • 1,385
  • 3
  • 16
  • 29
  • 401 indicates that something is wrong with your token: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401 – Michael H. Aug 20 '19 at 21:09
  • @MichaelH. Well .... don't know what to say ... I'm using token generated by Atlassian itself (Atlassian is the company behind Jira). – Mark Aug 20 '19 at 21:11
  • I deleted the one I've used until now and generated new one. No change. Same error. – Mark Aug 20 '19 at 21:14
  • Have you tried `auth` instead of `basic_auth`? From https://github.com/pycontribs/jira/blob/master/jira/client.py it's not obvious to me which one is "better". – Michael H. Aug 20 '19 at 21:18
  • It might also be related to your specific Jira instance. I saw similar errors when people at work were still using the normal (username, password) tuples (with the username/password they were using to sign in to Jira in the browser) instead of API tokens while in the meantime my boss changed the security settings of our Jira cloud instance. – Michael H. Aug 20 '19 at 21:21
  • 1
    Can you provide the response header and body? Maybe you are just running in the CAPTCHA challenge from too many wrong tries? – Christopher Graf Aug 27 '19 at 06:38

0 Answers0