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

Client incorrectly sends *.* for Accept header, instead of */* #1774

Closed
2 of 4 tasks
bkelley17 opened this issue Dec 11, 2023 · 8 comments · Fixed by #1778
Closed
2 of 4 tasks

Client incorrectly sends *.* for Accept header, instead of */* #1774

bkelley17 opened this issue Dec 11, 2023 · 8 comments · Fixed by #1778

Comments

@bkelley17
Copy link

bkelley17 commented Dec 11, 2023

Bug summary

The client can send the HTTP Accept header as application/json,*.*;q=0.9 which is invalid. This should be application/json,*/*;q=0.9. Note */* in place of the incorrect *.*. A quick search shows that this comes from resilientsession.py line 165. Amazingly this does not currently fail when calling Jira Cloud, but the incorrect Accept header is (increasingly) likely to return a 406 error.

Is there an existing issue for this?

  • I have searched the existing issues

Jira Instance type

Jira Cloud (Hosted by Atlassian)

Jira instance version

latest

jira-python version

any

Python Interpreter version

any

Which operating systems have you used?

  • Linux
  • macOS
  • Windows

Reproduction steps

from jira import JIRA

jira = JIRA('https://jira.atlassian.com/')

jira.server_info()

Stack trace

None yet.

Expected behaviour

Expect not to get 406 error.

Additional Context

No response

@jabadia
Copy link

jabadia commented Dec 11, 2023

this caused JIRA cloud to return 406 error from /resolutions endpoint last week

@ili-shmidt-wib
Copy link

Any update?
Also 406 error from jira.projectcategories()

roxell added a commit to roxell/jipdate that referenced this issue Dec 14, 2023
Looks like its a bug in Atlassian this was shown.
An issue has been created in the python jira library.

Until its fixed upstream we add this workaround when authenticate in
JIRA with user/pass.

Link: https://community.developer.atlassian.com/t/http-406-status-code-from-rest-api-3-resolution-search/75381/5
Link: pycontribs/jira#1774
Suggested-by: Julianus Larson <julianus.larson@linaro.org>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
roxell added a commit to roxell/jipdate that referenced this issue Dec 14, 2023
Looks like its a bug in the jira python library.  An issue has been
created in Atlassian and in the python jira library.

Until its fixed upstream we add this workaround when authenticate in
JIRA.

Link: https://community.developer.atlassian.com/t/http-406-status-code-from-rest-api-3-resolution-search/75381/5
Link: pycontribs/jira#1774
Suggested-by: Julianus Larson <julianus.larson@linaro.org>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
roxell added a commit to roxell/jipdate that referenced this issue Dec 14, 2023
Looks like its a bug in the jira python library.  An issue has been
created in Atlassian and in the python jira library.

Until its fixed upstream we add this workaround when authenticate in
JIRA.

Link: https://community.developer.atlassian.com/t/http-406-status-code-from-rest-api-3-resolution-search/75381/5
Link: pycontribs/jira#1774
Suggested-by: Julianus Larson <julianus.larson@linaro.org>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
JLLinaro pushed a commit to Linaro/jipdate that referenced this issue Dec 14, 2023
Looks like its a bug in the jira python library.  An issue has been
created in Atlassian and in the python jira library.

Until its fixed upstream we add this workaround when authenticate in
JIRA.

Link: https://community.developer.atlassian.com/t/http-406-status-code-from-rest-api-3-resolution-search/75381/5
Link: pycontribs/jira#1774
Suggested-by: Julianus Larson <julianus.larson@linaro.org>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
maxim-kuvyrkov pushed a commit to maxim-kuvyrkov/jipdate that referenced this issue Dec 15, 2023
Looks like its a bug in the jira python library.  An issue has been
created in Atlassian and in the python jira library.

Until its fixed upstream we add this workaround when authenticate in
JIRA.

Link: https://community.developer.atlassian.com/t/http-406-status-code-from-rest-api-3-resolution-search/75381/5
Link: pycontribs/jira#1774
Suggested-by: Julianus Larson <julianus.larson@linaro.org>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
dbaxa added a commit that referenced this issue Dec 18, 2023
Signed-off-by: David Black <dblack@atlassian.com>
@rachelpeterson89
Copy link

We're experiencing a 406 error from jira.groups() and jira.group_members() as well

@dbaxa
Copy link
Member

dbaxa commented Dec 19, 2023

We're experiencing a 406 error from jira.groups() and jira.group_members() as well

You should be able to workaround the issue by creating JIRA client instances like so ->

JIRA(url_to_jira_instance, basic_auth=("example", "apikeyhere"), 
     options={"headers": {"Accept": "application/json,*/*;q=0.9"}}) 

@solarissmoke
Copy link

This appears to now be affecting pretty much all Jira endpoints. I cannot even instantiate the client any more without getting a 406 error from the serverInfo endpoint.

@thenamanpatwari
Copy link

Affecting all JIRA endpoints and returning 406 errors.
workaround provided by @dbaxa mitigated the issue.

Using jira pypi version 3.5.0

@PavelVanecekAtlassian
Copy link

Hi everyone, just FYI we have reverted the serverInfo endpoint to accept the previous header again. Turns out that there's something out there calling the endpoint a lot!

@sfc-gh-pannadate
Copy link

We had the same issue, we added Headers, which resolved it.

headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}
jira = JIRA(server=jira_url, basic_auth=(jira_username, jira_password), options={'server': jira_url, 'headers': headers})

adehad pushed a commit that referenced this issue Dec 21, 2023
Signed-off-by: David Black <dblack@atlassian.com>
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

Successfully merging a pull request may close this issue.

9 participants