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

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

Open
felipereisdev opened this issue Apr 12, 2023 · 13 comments
Open

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

felipereisdev opened this issue Apr 12, 2023 · 13 comments

Comments

@felipereisdev
Copy link

felipereisdev commented Apr 12, 2023

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

@mk-5
Copy link
Owner

mk-5 commented Apr 12, 2023

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

@felipereisdev
Copy link
Author

felipereisdev commented Apr 12, 2023

@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.

@mk-5
Copy link
Owner

mk-5 commented Apr 12, 2023

@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)

@felipereisdev
Copy link
Author

@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)

@mk-5
Copy link
Owner

mk-5 commented Apr 15, 2023

@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
Copy link
Owner

mk-5 commented Aug 16, 2023

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

@mk-5 mk-5 closed this as completed Aug 16, 2023
@antonbasic
Copy link

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.

@mk-5 mk-5 reopened this Aug 26, 2023
@mk-5
Copy link
Owner

mk-5 commented Aug 26, 2023

@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: #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

@antonbasic
Copy link

antonbasic commented Sep 12, 2023

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

@mk-5
Copy link
Owner

mk-5 commented Sep 13, 2023

@antonbasic there is an open issue about 'on-premise' installation - #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
Copy link
Owner

mk-5 commented Sep 25, 2023

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

@antonbasic
Copy link

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 🙌

@mk-5
Copy link
Owner

mk-5 commented Sep 29, 2023

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

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

3 participants