fjira icon indicating copy to clipboard operation
fjira copied to clipboard

When clicking on F2 to search for assignee, 404 error appears

Open felipereisdev opened this issue 2 years ago • 13 comments

Desktop:

  • OS: MacOS Ventura
  • Terminal: warp or default
  • Architecture: Apple
  • Fjira version: 0.8.3

Describe the bug When clicking on F2 to search for assignee, 404 error appears

To Reproduce Clicking on F2 to search for assignee

Expected behavior Click on f2 and a user will appear to run the filter

Captura de Tela 2023-04-12 às 17 21 52

felipereisdev avatar Apr 12 '23 16:04 felipereisdev

@felipereisdev thanks for reporting! I will have a look on that

mk-5 avatar Apr 12 '23 18:04 mk-5

@felipereisdev thanks for reporting! I will have a look on that

Thank you for this amazing app. I hate Jira. This same 404 error also appears when entering a board.

felipereisdev avatar Apr 12 '23 19:04 felipereisdev

@felipereisdev mhmm interesting problem - in general Jira API retrurn 404 when you don't have access to the resource.

Could you check underlaying api directly? that's the HTTP request that's sent via app to get list of users:

Users:

curl --location '$YOUR_JIRA_URL/rest/api/2/user/assignable/search?project=$CHOSEN_PROJECT&maxResults=10000' --header 'Authorization: Basic $BASIC_AUTH_TOKEN' 

Boards:

curl --location '$YOUR_JIRA_URL/rest/agile/1.0/board?projectKeyOrId=$CHOSEN_PROJECT' --header 'Authorization: Basic $BASIC_AUTH_TOKEN' 

BASIC_AUTH_TOKEN is base64(username+":"+token)

mk-5 avatar Apr 12 '23 19:04 mk-5

@felipereisdev mhmm interesting problem - in general Jira API retrurn 404 when you don't have access to the resource.

Could you check underlaying api directly? that's the HTTP request that's sent via app to get list of users:

Users:

curl --location '$YOUR_JIRA_URL/rest/api/2/user/assignable/search?project=$CHOSEN_PROJECT&maxResults=10000' --header 'Authorization: Basic $BASIC_AUTH_TOKEN' 

Boards:

curl --location '$YOUR_JIRA_URL/rest/agile/1.0/board?projectKeyOrId=$CHOSEN_PROJECT' --header 'Authorization: Basic $BASIC_AUTH_TOKEN' 

BASIC_AUTH_TOKEN is base64(username+":"+token)

It's returning Forbidden (403)

felipereisdev avatar Apr 12 '23 20:04 felipereisdev

@felipereisdev it looks that it's more related to your user permissions, or Jira instance setup. Could you try to access any of those Jira REST API using your credentials?

I would also double-check auth token, I think that in some cases (including that one) - Jira API is returning 404 - not 403 - if there is no access to the resource.

mk-5 avatar Apr 15 '23 15:04 mk-5

I'm closing it - due to no response from the author

mk-5 avatar Aug 16 '23 18:08 mk-5

I have the same problem as reported in this issue. I could help out with trouble-shooting. Would love for this to work 😀 Same problem appears when trying to filter on a user. I click F2 to open up user list and that works but then I get the error when I click enter on a user.

I ran the above curl commands, users got 401 back and boards got 403.

antonbasic avatar Aug 25 '23 09:08 antonbasic

@antonbasic okay! if you can help with investigation I think we will manage to solve it 😄 I'm re-opening that issue - but it could be something different. The reported issue was about 404, and I think it's similar to recent comments here: https://github.com/mk-5/fjira/issues/48. It should be fixed already.

but, okay! let us hunt that issue down 😄 - soo those curls are 1:1 the same requests that are sent from the application. Maybe you can play-around using postman or something? Both request should return valid response, examples:

image

image

mk-5 avatar Aug 26 '23 12:08 mk-5

My 401 and 403 seems to was a result of me trying Basic auth first which didn't work. With Bearer token it works fine. I'm connecting to a on-premise install. Version number of Jira looks to be v9.4.5 Now using 0.11.5 of fjira. Problems are still there. In postman I get successfull response but the payload of the response seems different from yours. /rest/api/2/user/assignable/search?project=ABC&maxresults=100 image

antonbasic avatar Sep 12 '23 10:09 antonbasic

@antonbasic there is an open issue about 'on-premise' installation - https://github.com/mk-5/fjira/issues/48 I'm investigating it right now. The current topic is do-assignment API. It looks that 'on-premise' installation, and Jira Cloud have totally different apis - in that one point.

About tokens - you need to change type of access token, to "personal access token".

? Jira Token Type:

1. api token
2. personal token

Enter a number (Default is 1):

You can do it during workspace configuration, or you can edit the existing one: fjira --edit-workspace workspace. You can also go directly to the configuration file, and change it there. ~/.fjira/fjira.yaml

I've tested 'on-premise' installation using that dockerized version: https://github.com/mk-5/fjira/blob/master/scripts/docker-compose-jira-server.yml - and everything looks just fine. I need to check if there is any difference in API between jira versions. That problem, and problem described in #48 will be easily fixable I believe - but I need to reproduce it somehow.

mk-5 avatar Sep 13 '23 20:09 mk-5

@antonbasic assignment error should be fixed now. I will check boards 403

mk-5 avatar Sep 25 '23 20:09 mk-5

As you say it might be a problem of the API's being different between versions. Bad on Atlassians part to break the API within the same major version 🤦‍♂️ I have used personal token the whole time in fjira. assignment works for me as well now, nicely done 👌

Since the version of Jira we are using is an older version and it seems to be quite a few differences between versions I don't think I will bother you with bugs for this version. I just realised that not all tasks are showing in the board view as well. We are moving to Jira cloud at our company, although I'm not sure when the final move is happening, so I will revisit this tool when we do so. Really like the projekt 🙌

antonbasic avatar Sep 29 '23 07:09 antonbasic

@antonbasic I will try to reproduce that issue using dockerized version of Jira :) you know .. reproducing the error is 90% of success 😅

mk-5 avatar Sep 29 '23 20:09 mk-5