Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unauthorized (JIRA::HTTPError) during Jira connect via Access Token #404

Open
kszorin opened this issue May 10, 2023 · 1 comment
Open

Comments

@kszorin
Copy link

kszorin commented May 10, 2023

Environment

Jira standalone 8.20.10
Authorization to Jira via User Token
jira-ruby version: 2.2.0, 2.3.0
Bundler 2.4.12

Steps

  • run job on Gitlab at the and of April 2023
  • jira-ruby try to connect to Jira
options = {
    :site => ENV['JIRA_URL'],
    :context_path => '',
    :auth_type => :jwt,
    :default_headers => { 'Authorization' =>  "Bearer #{ENV['JIRA_ACCESS_TOKEN']}" }
  }
  client =  JIRA::Client.new(options)

   ...
  jql = "PROJECT = '#{project_name}' AND fixVersion = '#{jira_version}'"
  issues = client.Issue.jql(jql)   # <----------------------------------------------------- EXCEPTION!

Expect

Successful connection and JQL Response

Actual

bundler: failed to load command: fastlane (/builds/...-App/...-app-android/vendor/ruby/3.0.0/bin/fastlane)
/builds/...-App/...-app-android/vendor/ruby/3.0.0/gems/jira-ruby-2.3.0/lib/jira/request_client.rb:13:in `request': Unauthorized (JIRA::HTTPError)
	from /builds/...-App/...-app-android/vendor/ruby/3.0.0/gems/jira-ruby-2.3.0/lib/jira/client.rb:306:in `request'
	from /builds/...-App/...-app-android/vendor/ruby/3.0.0/gems/jira-ruby-2.3.0/lib/jira/client.rb:279:in `get'
	from /builds/...-App/...-app-android/vendor/ruby/3.0.0/gems/jira-ruby-2.3.0/lib/jira/resource/issue.rb:80:in `jql'
	from /builds/...-App/...-app-android/vendor/ruby/3.0.0/gems/jira-ruby-2.3.0/lib/jira/base_factory.rb:31:in `block (2 levels) in delegate_to_target_class'

What have I already checked

Token is valid (checked by curl)
JQL is valid (checked by curl)
Connection between GitLab and Jira (checked by curl)


Has anyone encountered this problem?

@paderich
Copy link

I have the same issue currently. It worked a week ago, now I get this issue, nothing in my setup changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants