Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 2249726

Summary: osc on Fedora 39 is throws python traces on initial log in
Product: [Fedora] Fedora Reporter: Scott Williams <vwfoxguru>
Component: oscAssignee: Dan Čermák <dan.cermak>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 39CC: dan.cermak, daniel.mach, gwync, karlthered, msuchy, ngompa13, redhat-developer
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: osc-1.5.0-391.1.1.fc40 osc-1.5.0-391.1.1.fc39 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-23 07:42:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Scott Williams 2023-11-15 01:03:38 UTC
osc checkout throws python stack trace errors.  After initial login, it asks where to store the password.  Selecting Gnome Keyring or Transient generate Python stack trace errors (I did not test with Config option).

Here's an example output:
```
Your user account / password are not configured yet.
You will be asked for them below, and they will be stored in
/root/.config/osc/oscrc for future use.

Creating osc configuration file /root/.config/osc/oscrc ...
Username [api.opensuse.org]: vwbusguy
Password [vwbusguy.org]: 

NUM NAME              DESCRIPTION
1   Transient         Do not store the password and always ask for it [secure, in-memory]
2   Obfuscated config Store the password in obfuscated form in the osc config file [insecure, persistent]
3   Config            Store the password in plain text in the osc config file [insecure, persistent]
Select credentials manager [default=1]: 1
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/osc/commandline.py", line 418, in post_parse_args
    conf.get_config(
  File "/usr/lib/python3.12/site-packages/osc/conf.py", line 1823, in get_config
    raise oscerr.NoConfigfile(conffile, account_not_configured_text % conffile)
osc.oscerr.NoConfigfile: Config file cannot be found: /root/.config/osc/oscrc
   
Your user account / password are not configured yet.
You will be asked for them below, and they will be stored in
/root/.config/osc/oscrc for future use.


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/osc", line 33, in <module>
    sys.exit(load_entry_point('osc==1.4.4', 'console_scripts', 'osc')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/osc/babysitter.py", line 226, in main
    sys.exit(run(commandline.OscMainCommand()))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/osc/babysitter.py", line 69, in run
    prg.main(argv)
  File "/usr/lib/python3.12/site-packages/osc/commandline.py", line 545, in main
    cmd.run(args)
  File "/usr/lib/python3.12/site-packages/osc/commandline.py", line 240, in run
    self.post_parse_args(args)
  File "/usr/lib/python3.12/site-packages/osc/commandline.py", line 433, in post_parse_args
    conf.interactive_config_setup(e.file, args.apiurl)
  File "/usr/lib/python3.12/site-packages/osc/conf.py", line 2009, in interactive_config_setup
    write_initial_config(conffile, config, creds_mgr_descriptor=creds_mgr_descr)
  File "/usr/lib/python3.12/site-packages/osc/conf.py", line 1719, in write_initial_config
    cp.readfp(sio)
    ^^^^^^^^^
AttributeError: 'OscConfigParser' object has no attribute 'readfp'. Did you mean: 'read'?
```

It seems the osc shipped in Fedora 39 isn't fully python 3.12 compatible.

Reproducible: Always

Steps to Reproduce:
1. Install osc
2. Attempt to osc checkout
3. Authenticate
4. Pick Gnome Keyring or Transient
Actual Results:  
osc crashes with a Python stack trace

Expected Results:  
osc stores credentials properly and completes the operation

I was able to reproduce this with or without python3-keyring installed.  I replicated it in Fedora 39 workstation and in a Fedora 39 container with podman.

Comment 1 Dan Čermák 2023-11-16 12:23:49 UTC
Upstream has fixed this via https://github.com/openSUSE/osc/pull/1446. As they'll release a new version soon, I'll fix it with that update.

Comment 2 Fedora Update System 2023-11-23 07:42:13 UTC
FEDORA-2023-99ef508621 has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-99ef508621

Comment 3 Fedora Update System 2023-11-23 07:42:40 UTC
FEDORA-2023-99ef508621 has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 4 Fedora Update System 2023-11-23 08:09:13 UTC
FEDORA-2023-26a03780a7 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-26a03780a7

Comment 5 Fedora Update System 2023-11-24 01:43:40 UTC
FEDORA-2023-26a03780a7 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-26a03780a7`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-26a03780a7

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

Comment 6 Fedora Update System 2023-12-02 01:24:08 UTC
FEDORA-2023-26a03780a7 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.