Bug 2097196 - TypeError: BodhiClient.__init__() got an unexpected keyword argument 'username'
Summary: TypeError: BodhiClient.__init__() got an unexpected keyword argument 'username'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: fedora-easy-karma
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kamil Páral
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: Confidential2097174 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-15 06:17 UTC by Kamil Páral
Modified: 2022-07-08 01:36 UTC (History)
7 users (show)

Fixed In Version: fedora-easy-karma-0.51-1.fc36 fedora-easy-karma-0.51-1.fc35
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-18 00:38:14 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Pagure fedora-easy-karma issue 22 0 None None None 2022-06-15 07:56:56 UTC
Github fedora-infra bodhi issues 4581 0 None open Auth token only lasts an hour 2022-06-17 05:45:03 UTC

Description Kamil Páral 2022-06-15 06:17:18 UTC
Description of problem:
FEK fails to run with bodhi-client-6.0.0-2.fc36.noarch:

Traceback (most recent call last):
  File "/usr/bin/fedora-easy-karma", line 881, in <module>
    fek = FedoraEasyKarma()
  File "/usr/bin/fedora-easy-karma", line 505, in __init__
    bc = BodhiClient(username=self.options.fas_username,
TypeError: BodhiClient.__init__() got an unexpected keyword argument 'username'



Version-Release number of selected component (if applicable):
bodhi-client-6.0.0-2.fc36.noarch
fedora-easy-karma-0-0.49.20210526gitfa76ab7.fc36.noarch


How reproducible:
always

Comment 1 Kamil Páral 2022-06-15 06:17:41 UTC
*** ConfidentialBug 2097174 has been marked as a duplicate of this bug. ***

Comment 2 Aurelien Bompard 2022-06-15 08:07:12 UTC
I'm happy to help adjust the code to Bodhi Client 6.0 if you need any.

Comment 3 Kamil Páral 2022-06-15 09:13:03 UTC
Thanks Aurelien, but I'm on it :-)

Everyone, please test this scratch build and tell me if it works OK for you:
https://koji.fedoraproject.org/koji/taskinfo?taskID=88287231

You'll be asked to open a web browser, log in to FAS and copy-paste a code back to terminal when you run FEK (not sure how long that token lasts, this process might need repeating in some time again).

Comment 4 Kamil Páral 2022-06-15 11:56:11 UTC
Aurelien, will there be bodhi-client 6.0 for Fedora 35 as well? I re-wrote FEK to target bodhi-client 6.0 only to find out that it's not available in F35, not even updates-testing. Which means I'd have to have two different codepaths in FEK to support both bodhi-client 6.0 and 5.7.5 :-/

Comment 5 Aurelien Bompard 2022-06-15 15:20:05 UTC
Yes, I will make a package update for F35 too. I thought I had done it but apparently not, I'll do it right away (I need to request the branch first so it make take some more time).

Comment 6 Jens Falsmar Oechsler 2022-06-15 16:07:58 UTC
(In reply to Kamil Páral from comment #3)
> Thanks Aurelien, but I'm on it :-)
> 
> Everyone, please test this scratch build and tell me if it works OK for you:
> https://koji.fedoraproject.org/koji/taskinfo?taskID=88287231
> 
> You'll be asked to open a web browser, log in to FAS and copy-paste a code
> back to terminal when you run FEK (not sure how long that token lasts, this
> process might need repeating in some time again).

Tested and works using website token.

$ sudo dnf install fedora-easy-karma-0-0.50.20220615git45d9c80.1.fc36.noarch.rpm
$ fedora-easy-karma
Logging into Bodhi...
Authenticating... Please open your browser to:
https://id.fedoraproject.org/openidc/Authorization?response_type=code&client_id=bodhi-client&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=openid+email+profile+https%3A%2F%2Fid.fedoraproject.org%2Fscope%2Fgroups+https%3A%2F%2Fid.fedoraproject.org%2Fscope%2Fagreements&state=bgRafWOBuu3FlZDiqz68TiAh8ChpMB
Paste here the code that you got after logging in: code=xx
Login successful!
Getting list of installed packages...
Waiting for oraculum instance to return list of packages in updates-testing...
found 299 testing updates

Comment 7 Aurelien Bompard 2022-06-15 16:26:59 UTC
Bodhi 6.0 for F35 : https://bodhi.fedoraproject.org/updates/FEDORA-2022-6427738348

Comment 8 Bojan Smojver 2022-06-16 03:49:07 UTC
Scratch build works here too on F36.

Comment 9 jpbn 2022-06-16 07:01:53 UTC
works but one little error:

fedora-easy-karma: error: no such option: --fas-username

Comment 10 Aurelien Bompard 2022-06-16 08:28:50 UTC
Hey Kamil, if you want I can wait for your update to be ready before pushing bodhi-client to stable in F36 and F35. Would that be useful?

Comment 11 Jens Falsmar Oechsler 2022-06-16 08:46:10 UTC
(In reply to jpbn from comment #9)
> works but one little error:
> 
> fedora-easy-karma: error: no such option: --fas-username

As mentioned in comment 3, log in is now done via single sign on token in web browser. Running fedora-easy-karma without options lets you provide username and password on the website URL it shows in console.

Comment 12 Kamil Páral 2022-06-16 09:07:02 UTC
(In reply to Aurelien Bompard from comment #10)
> Hey Kamil, if you want I can wait for your update to be ready before pushing
> bodhi-client to stable in F36 and F35. Would that be useful?

Thanks, but no need. I think testers of unstable updates can handle this small inconvenience easily, and I'll submit a FEK update into Bodhi soon.

But I do have a different question. It seems to me that I need to copy the FAS login token regularly. It doesn't seem to last more than a few hours. I don't know how long exactly, it will take time to figure it out. Is it expected? How long is the token expected to last? Today morning, I verified that the token is present in ~/.config/bodhi/client.json, but when I ran FEK, it cleared it in client.json and asked for the token again. Yesterday this happened to me as well at least once or twice. Perhaps switching between bodhi-client 6.0 and 5.7.5 could cause this? Or the fact that I have both prod and stg token present, and it gets confused? FEK calls this:

from bodhi.client.bindings import BodhiClient
bc = BodhiClient()
bc.ensure_auth()

If people need to copy the token every day, that would make FEK usage a bit inconvenient :-/


(In reply to jpbn from comment #9)
> works but one little error:
> 
> fedora-easy-karma: error: no such option: --fas-username

Yes, that's expected, as Jens explained. FEK no longer cares about your FAS username, because you provide it into the web browser.

Comment 13 Aurelien Bompard 2022-06-16 11:30:13 UTC
The token should last much longer than a day, I'll investigate that. It's possible that switching between versions caused this, since the authentification system is different. Switching between staging and prod however should not cause this issue.

Comment 14 Fedora Update System 2022-06-16 14:57:23 UTC
FEDORA-2022-e6b7cc89a8 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-e6b7cc89a8

Comment 15 Fedora Update System 2022-06-16 14:58:12 UTC
FEDORA-2022-f08c613dbf has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-f08c613dbf

Comment 16 Fedora Update System 2022-06-17 01:49:15 UTC
FEDORA-2022-f08c613dbf has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-f08c613dbf`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-f08c613dbf

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 17 Fedora Update System 2022-06-17 02:02:03 UTC
FEDORA-2022-e6b7cc89a8 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-e6b7cc89a8`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-e6b7cc89a8

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 18 Kamil Páral 2022-06-17 05:45:03 UTC
(In reply to Aurelien Bompard from comment #13)
> The token should last much longer than a day, I'll investigate that.

It doesn't seem to be caused by switching versions. The token is marked to expire in an hour (!). I filed it here:
https://github.com/fedora-infra/bodhi/issues/4581

Comment 19 Fedora Update System 2022-06-18 00:38:14 UTC
FEDORA-2022-e6b7cc89a8 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 20 Fedora Update System 2022-07-08 01:36:31 UTC
FEDORA-2022-f08c613dbf has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.