Bug 2196512

Summary: RuntimeError: RLock objects should only be shared between processes through inheritance
Product: [Fedora] Fedora Reporter: Jiri Popelka <jpopelka>
Component: python-PyGithubAssignee: Carl George 🤠 <carl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 38CC: carl, cstratak, flachman, hcsomort, jkyjovsk, jperrin, jpopelka, lbarczio, mhroncok, mmassari, nforro, python-maint, python-packagers-sig, thrnciar, torsava, ttomecek, vstinner
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: python-PyGithub-1.58.2-1.fc38 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-11 01:56:52 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 Jiri Popelka 2023-05-09 11:15:09 UTC
When I put 'authentication' into ~/.config/.packit.yaml and run 'packit status' I get a traceback.

Reproducible: Always

Steps to Reproduce:
$ podman run -ti --rm fedora:38 bash
[root@2a6f0c13fc8a /]# cd
[root@2a6f0c13fc8a ~]# dnf install packit
[root@2a6f0c13fc8a ~]# cat ~/.config/.packit.yaml 
authentication:
  github.com:
    token: ghp_foobarbaz
[root@2a6f0c13fc8a ~]# git clone https://github.com/packit/ogr; cd ogr
[root@2a6f0c13fc8a ogr]# packit -d status

Actual Results:  
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/packit/cli/utils.py", line 50, in covered_func
    func(config=config, *args, **kwargs)
  File "/usr/lib/python3.11/site-packages/packit/cli/utils.py", line 145, in covered_func
    decorated_func_kwargs["config"] = copy.deepcopy(
                                      ^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 271, in _reconstruct
    state = deepcopy(state, memo)
            ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 146, in deepcopy
    y = copier(x, memo)
        ^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 231, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
                             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 265, in _reconstruct
    y = func(*args)
        ^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 264, in <genexpr>
    args = (deepcopy(arg, memo) for arg in args)
            ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 146, in deepcopy
    y = copier(x, memo)
        ^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 206, in _deepcopy_list
    append(deepcopy(a, memo))
           ^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 271, in _reconstruct
    state = deepcopy(state, memo)
            ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 146, in deepcopy
    y = copier(x, memo)
        ^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 231, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
                             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 271, in _reconstruct
    state = deepcopy(state, memo)
            ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 146, in deepcopy
    y = copier(x, memo)
        ^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 231, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
                             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 271, in _reconstruct
    state = deepcopy(state, memo)
            ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 146, in deepcopy
    y = copier(x, memo)
        ^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 231, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
                             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 271, in _reconstruct
    state = deepcopy(state, memo)
            ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 146, in deepcopy
    y = copier(x, memo)
        ^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 231, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
                             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/copy.py", line 161, in deepcopy
    rv = reductor(4)
         ^^^^^^^^^^^
  File "/usr/lib64/python3.11/multiprocessing/synchronize.py", line 101, in __getstate__
    context.assert_spawning(self)
  File "/usr/lib64/python3.11/multiprocessing/context.py", line 373, in assert_spawning
    raise RuntimeError(
RuntimeError: RLock objects should only be shared between processes through inheritance

Expected Results:  
no traceback

Comment 1 Jiri Popelka 2023-05-09 15:31:33 UTC
The same (packit) code has worked OK in Fedora 37.

To Python maintainers: Do you have any idea what's changed in Fedora 38 to possibly cause this? The Python versions (in F37 and F38) look the same to me.

Comment 2 Nikola Forró 2023-05-09 15:57:20 UTC
This has nothing to do with Python, it's caused by RLock in PyGithub Requester, and it seems to be already fixed: https://github.com/PyGithub/PyGithub/pull/2446

Comment 3 Nikola Forró 2023-05-09 15:59:21 UTC
The fix is in 1.58.2, so it should be fixed by https://bodhi.fedoraproject.org/updates/FEDORA-2023-09bd2ec549

Comment 4 Fedora Update System 2023-05-10 08:01:27 UTC
FEDORA-2023-09bd2ec549 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-09bd2ec549

Comment 5 Fedora Update System 2023-05-11 01:56:52 UTC
FEDORA-2023-09bd2ec549 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.