Pack: Jira Token issue

(LuisN) #1

I know what the 1st thing i will receive, did you read the instructions =) yes 10 times

Still getting the following, and I follow all the steps. the generator still gives an error but outputs the URL and auth key / secret just fine. config file has the same values givem, i approved the access in jira and registered all configs in st2. still no go


  Visit to the following URL to provide authorization:

Traceback (most recent call last):
  File "", line 45, in <module>
    while raw_input("Press any key to continue..."):
NameError: name 'raw_input' is not defined
WARNING:root:Got recoverable error from GET, will retry [1/3] in 3.91456855975s. Err: 401 Unauthorized
WARNING:root:Got recoverable error from GET, will retry [2/3] in 16.8720036128s. Err: 401 Unauthorized
WARNING:root:Got recoverable error from GET, will retry [3/3] in 24.4791964296s. Err: 401 Unauthorized
Traceback (most recent call last):
  File "/opt/stackstorm/st2/local/lib/python2.7/site-packages/python_runner/", line 325, in <module>
  File "/opt/stackstorm/st2/local/lib/python2.7/site-packages/python_runner/", line 183, in run
    action = self._get_action_instance()
  File "/opt/stackstorm/st2/local/lib/python2.7/site-packages/python_runner/", line 252, in _get_action_instance
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2common/runners/", line 143, in get_action_class_instance
    action_instance = action_cls(**kwargs)
  File "/opt/stackstorm/packs/jira/actions/lib/", line 17, in __init__
    self._client = self._get_client()
  File "/opt/stackstorm/packs/jira/actions/lib/", line 37, in _get_client
    client = JIRA(options=options, oauth=oauth_creds)
  File "/opt/stackstorm/virtualenvs/jira/lib/python2.7/site-packages/jira/", line 472, in __init__
    si = self.server_info()
  File "/opt/stackstorm/virtualenvs/jira/lib/python2.7/site-packages/jira/", line 2133, in server_info
    j = self._get_json('serverInfo')
  File "/opt/stackstorm/virtualenvs/jira/lib/python2.7/site-packages/jira/", line 2549, in _get_json
    r = self._session.get(url, params=params)
  File "/opt/stackstorm/virtualenvs/jira/lib/python2.7/site-packages/jira/", line 151, in get
    return self.__verb('GET', url, **kwargs)
  File "/opt/stackstorm/virtualenvs/jira/lib/python2.7/site-packages/jira/", line 147, in __verb
    raise_on_error(response, verb=verb, **kwargs)
  File "/opt/stackstorm/virtualenvs/jira/lib/python2.7/site-packages/jira/", line 57, in raise_on_error
    r.status_code, error, r.url, request=request, response=r, **kwargs)
jira.exceptions.JIRAError: JiraError HTTP 401 url:
	text: oauth_problem=token_rejected
	response headers = {'Content-Length': '28', 'Server': 'Apache-Coyote/1.1', 'Connection': 'close', 'Date': 'Mon, 11 Mar 2019 22:01:52 GMT', 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', 'WWW-Authenticate': 'OAuth realm="", OAuth realm="", oauth_problem="token_rejected"'}
	response text = oauth_problem=token_rejected
(Lindsay Hill) #2

Maybe try basic auth?

(LuisN) #3

Want to stay away from username / pass. so if the pack was written for oauth1, atlasian 7.X is using oauth2 im pretty sure this is why im getting the error. any plans to update?

(Lindsay Hill) #4

Pack updates are user-driven. Basically someone has an itch, they scratch it. I haven’t heard of anyone working on adding oauth2 support, but it would most likely show up as a finished PR, rather than work in progress.

You could start a PR at, or failing that, write up a detailed issue explaining what’s going on, and what’s needed. If it’s related to specific Jira versions, include that. You could also update the README to advise that oauth1 won’t work with Jira 7.x (or whatever the relevant versions are)

(Cygnetix) #5

Are you sure Jira supports OAuth2? That’d be awesome if it does but I haven’t seen anything to suggest that’s the case.

Here’s the feature request to have OAuth2 added. Hopefully support does come soon: