Open lukaszgryglicki opened 4 years ago
This is probably due to the fact, that Jira has deprecated authentication with Username/Password for some instances, see here: https://confluence.atlassian.com/cloud/deprecation-of-basic-authentication-with-passwords-for-jira-and-confluence-apis-972355348.html
Unfortunately it seems that using an API token is not implemented yet?
Edit: It works creating a new API token and just using that token as password. So username is the mail address of the account, and password is the API token :)
Command:
p2o.py --enrich --index sds-o-ran-documentation-jira-raw --index-enrich sds-o-ran-documentation-jira -e (redacted) --db-host mariadb.mariadb --db-sortinghat sortinghat --db-user sortinghat --db-password (redacted) jira https://jira.o-ran-sc.org --project DOC -u (redacted) -p (redacted) --no-archive --verify False
:I was debugging this a lot and those credentails are 100% sure OK. I've taken two Jira instances, one is for
Hyperledger
and another one is forO-RAN
. In both Jiras I have the same username sayuser1
and passowrd saypassword1
.Both Jiras authenticating correctly from UI using those credentials.
I've tracked this down to
self.session.get(url,...)
- it doesn't work forO-RAN
and works forHyperledger
. But if I replace code withrequests.Session().get(url, ...)
it works for both (this is the first query that just gets a list of fields from the REST API endpoint:/rest/api/2/field
) Now the difference is that theself.session
object hasself.session.auth
containinguser1, password1
pair whilerequests.Session()
executes call without auth headers. My clue is that Jira forO-RAN
is not supporting auth header while Jira forHyperledger
does.This is the case indeed, checked by
curl
:For
hyperledger
credentials work:curl --user user1:password1 https://jira.hyperledger.org/rest/api/2/field
. ForO-RAN
they’re not working:curl --user user1:password1 https://jira.o-ran-sc.org/rest/api/2/field
Both those credentials work OK from the Jira UI. Seems like O-RAN Jira is passing those credentials in some other way than auth headers, and this is not supported by Grimoire backend...
The only difference I can see from the UI is that
Hyperledger
is not using SSO/LFID andO-RAN
is using SSO/LFID.How can I process Jira data by Perceval backend when jira uses SSO/LFID?
One more thing, error message is very very cryptic in this case and required python debugging using
pdb
and modifying sources, adding just a single line makes the problem obvious, this is also the case in many more grimoire backend - they return crypting 40X Client or Server errors and nothing more - no one will have any idea why they fail...If you just edit
grimoirelab-perceval/perceval/client.py
file,def _fetch_from_remote(self, url, payload, headers, method, stream, verify, auth):
function and just add+
this codeprint(response.text)
:You will get the exact cause of failure: