ImportError: /lib64/libdnf.so.2: undefined symbol: g_once_init_enter_pointer

I obtained the rawhide image of Fedora from Docker using ‘fedora:rawhide’ and proceeded with the following steps:

  1. Updated the DNF package manager using ‘yum update -y dnf’.
  2. Attempted to install the curl packages using ‘yum install -y curl’.

However, I encountered the following error:

[root@020f0f5fdc35 /]# yum install -y curl info
Traceback (most recent call last):
  File "/usr/bin/yum", line 61, in <module>
    from dnf.cli import main
  File "/usr/lib/python3.12/site-packages/dnf/__init__.py", line 30, in <module>
    import dnf.base
  File "/usr/lib/python3.12/site-packages/dnf/base.py", line 29, in <module>
    import libdnf.transaction
  File "/usr/lib64/python3.12/site-packages/libdnf/__init__.py", line 14, in <module>
    from . import conf
  File "/usr/lib64/python3.12/site-packages/libdnf/conf.py", line 10, in <module>
    from . import _conf
ImportError: /lib64/libdnf.so.2: undefined symbol: g_once_init_enter_pointer

This issue began occurring today; it was functioning correctly yesterday. This is the full log from the starting the container

krishnastk@krishnastk-mac ~ % docker run -it fedora:rawhide /bin/bash
[root@020f0f5fdc35 /]# yum update -y dnf
Fedora rawhide openh264 (From Cisco) - x86_64                                                                                                                                                                                                   679  B/s | 2.6 kB     00:03
Fedora - Rawhide - Developmental packages for the next Fedora release                                                                                                                                                                           2.8 MB/s |  75 MB     00:27
Dependencies resolved.
================================================================================================================================================================================================================================================================================
 Package                                                              Architecture                                                 Version                                                                  Repository                                                     Size
================================================================================================================================================================================================================================================================================
Upgrading:
 dnf                                                                  noarch                                                       4.19.0-1.fc40                                                            rawhide                                                       509 k
 dnf-data                                                             noarch                                                       4.19.0-1.fc40                                                            rawhide                                                        40 k
 libdnf                                                               x86_64                                                       0.73.0-1.fc40                                                            rawhide                                                       697 k
 libstdc++                                                            x86_64                                                       14.0.1-0.6.fc40                                                          rawhide                                                       872 k
 python3-dnf                                                          noarch                                                       4.19.0-1.fc40                                                            rawhide                                                       591 k
 python3-hawkey                                                       x86_64                                                       0.73.0-1.fc40                                                            rawhide                                                       105 k
 python3-libdnf                                                       x86_64                                                       0.73.0-1.fc40                                                            rawhide                                                       847 k
 yum                                                                  noarch                                                       4.19.0-1.fc40                                                            rawhide                                                        38 k

Transaction Summary
================================================================================================================================================================================================================================================================================
Upgrade  8 Packages

Total download size: 3.6 M
Downloading Packages:
(1/8): dnf-data-4.19.0-1.fc40.noarch.rpm                                                                                                                                                                                                         31 kB/s |  40 kB     00:01
(2/8): dnf-4.19.0-1.fc40.noarch.rpm                                                                                                                                                                                                             173 kB/s | 509 kB     00:02
(3/8): libdnf-0.73.0-1.fc40.x86_64.rpm                                                                                                                                                                                                          195 kB/s | 697 kB     00:03
(4/8): libstdc++-14.0.1-0.6.fc40.x86_64.rpm                                                                                                                                                                                                     279 kB/s | 872 kB     00:03
(5/8): python3-dnf-4.19.0-1.fc40.noarch.rpm                                                                                                                                                                                                     320 kB/s | 591 kB     00:01
(6/8): python3-hawkey-0.73.0-1.fc40.x86_64.rpm                                                                                                                                                                                                   75 kB/s | 105 kB     00:01
(7/8): python3-libdnf-0.73.0-1.fc40.x86_64.rpm                                                                                                                                                                                                  442 kB/s | 847 kB     00:01
(8/8): yum-4.19.0-1.fc40.noarch.rpm                                                                                                                                                                                                              24 kB/s |  38 kB     00:01
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                                                           455 kB/s | 3.6 MB     00:08
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                                                                        1/1
  Upgrading        : libstdc++-14.0.1-0.6.fc40.x86_64                                                                                                                                                                                                                      1/16
  Upgrading        : libdnf-0.73.0-1.fc40.x86_64                                                                                                                                                                                                                           2/16
  Upgrading        : python3-libdnf-0.73.0-1.fc40.x86_64                                                                                                                                                                                                                   3/16
  Upgrading        : python3-hawkey-0.73.0-1.fc40.x86_64                                                                                                                                                                                                                   4/16
  Upgrading        : dnf-data-4.19.0-1.fc40.noarch                                                                                                                                                                                                                         5/16
  Upgrading        : python3-dnf-4.19.0-1.fc40.noarch                                                                                                                                                                                                                      6/16
  Upgrading        : dnf-4.19.0-1.fc40.noarch                                                                                                                                                                                                                              7/16
  Running scriptlet: dnf-4.19.0-1.fc40.noarch                                                                                                                                                                                                                              7/16
  Upgrading        : yum-4.19.0-1.fc40.noarch                                                                                                                                                                                                                              8/16
  Cleanup          : yum-4.18.1-2.fc40.noarch                                                                                                                                                                                                                              9/16
  Running scriptlet: dnf-4.18.1-2.fc40.noarch                                                                                                                                                                                                                             10/16
  Cleanup          : dnf-4.18.1-2.fc40.noarch                                                                                                                                                                                                                             10/16
  Running scriptlet: dnf-4.18.1-2.fc40.noarch                                                                                                                                                                                                                             10/16
  Cleanup          : python3-dnf-4.18.1-2.fc40.noarch                                                                                                                                                                                                                     11/16
  Cleanup          : python3-hawkey-0.72.0-1.fc40.x86_64                                                                                                                                                                                                                  12/16
  Cleanup          : dnf-data-4.18.1-2.fc40.noarch                                                                                                                                                                                                                        13/16
  Cleanup          : python3-libdnf-0.72.0-1.fc40.x86_64                                                                                                                                                                                                                  14/16
  Cleanup          : libdnf-0.72.0-1.fc40.x86_64                                                                                                                                                                                                                          15/16
  Cleanup          : libstdc++-13.2.1-5.fc40.x86_64                                                                                                                                                                                                                       16/16
  Running scriptlet: libstdc++-13.2.1-5.fc40.x86_64                                                                                                                                                                                                                       16/16

Upgraded:
  dnf-4.19.0-1.fc40.noarch    dnf-data-4.19.0-1.fc40.noarch    libdnf-0.73.0-1.fc40.x86_64    libstdc++-14.0.1-0.6.fc40.x86_64    python3-dnf-4.19.0-1.fc40.noarch    python3-hawkey-0.73.0-1.fc40.x86_64    python3-libdnf-0.73.0-1.fc40.x86_64    yum-4.19.0-1.fc40.noarch

Complete!
[root@020f0f5fdc35 /]# yum install -y curl info
Traceback (most recent call last):
  File "/usr/bin/yum", line 61, in <module>
    from dnf.cli import main
  File "/usr/lib/python3.12/site-packages/dnf/__init__.py", line 30, in <module>
    import dnf.base
  File "/usr/lib/python3.12/site-packages/dnf/base.py", line 29, in <module>
    import libdnf.transaction
  File "/usr/lib64/python3.12/site-packages/libdnf/__init__.py", line 14, in <module>
    from . import conf
  File "/usr/lib64/python3.12/site-packages/libdnf/conf.py", line 10, in <module>
    from . import _conf
ImportError: /lib64/libdnf.so.2: undefined symbol: g_once_init_enter_pointer
[root@020f0f5fdc35 /]# yum install -y curl
Traceback (most recent call last):
  File "/usr/bin/yum", line 61, in <module>
    from dnf.cli import main
  File "/usr/lib/python3.12/site-packages/dnf/__init__.py", line 30, in <module>
    import dnf.base
  File "/usr/lib/python3.12/site-packages/dnf/base.py", line 29, in <module>
    import libdnf.transaction
  File "/usr/lib64/python3.12/site-packages/libdnf/__init__.py", line 14, in <module>
    from . import conf
  File "/usr/lib64/python3.12/site-packages/libdnf/conf.py", line 10, in <module>
    from . import _conf
ImportError: /lib64/libdnf.so.2: undefined symbol: g_once_init_enter_pointer
[root@020f0f5fdc35 /]# yum update -y
Traceback (most recent call last):
  File "/usr/bin/yum", line 61, in <module>
    from dnf.cli import main
  File "/usr/lib/python3.12/site-packages/dnf/__init__.py", line 30, in <module>
    import dnf.base
  File "/usr/lib/python3.12/site-packages/dnf/base.py", line 29, in <module>
    import libdnf.transaction
  File "/usr/lib64/python3.12/site-packages/libdnf/__init__.py", line 14, in <module>
    from . import conf
  File "/usr/lib64/python3.12/site-packages/libdnf/conf.py", line 10, in <module>
    from . import _conf
ImportError: /lib64/libdnf.so.2: undefined symbol: g_once_init_enter_pointer

Added dnf, fedora-rawhide

It looks like something is broken with the latest dnf update.

Can we ask why you are using rawhide please? It is only meant to be used for testing by the community and is not considered “stable”:

If you’re helping with testing, you should contact the Fedora QA team who will probably know what is going on here:

(Ask Fedora is meant for stable releases of Fedora only, since we cannot continuously test rawhide to keep up with its status)

(Edit: we could move this to the Project Discussion category which is more appropriate for rawhide?)

1 Like

Hello Ankur,

I represent the Artifactory team. We’re currently testing the compatibility of rawhide with Artifactory to identify any potential issues in advance. Rest assured, I’ll follow up with the fedora-qa team regarding this matter.

Best regards,
Krishna

1 Like

From Ask Fedora to Project Discussion

Added quality-team and removed dnf, fedora-rawhide

Added Site Help & Feedback, package-maintainers, problem

It’s not generally safe to do selective updates, especially in Rawhide; you should really update the entire system or container. Strictly speaking there’s probably a missing or insufficiently strict dependency here, but it’s not an uncommon thing to happen. The new libdnf is likely built against something else you did not update; from a quick google it looks like that is a relatively new function in glib.

edit: oh, looking at your post carefully, you may well have a rather outdated base image. the Fedora images in the docker registry are updated only infrequently, because we cannot update them fully automatically (docker require some manual steps). We strongly recommend getting Fedora images from quay.io or registry.fedoraproject.org instead, e.g.:

FROM quay.io/fedora/fedora:rawhide
1 Like

It could help if glib would use versioned symbols like glibc and some other libraries do. That way rpm can generate dependencies which would have pulled in the new version of the glib libraries.

Note I am facing a similar issue with the reported one on this thread. I filed it to the Fedora Bugzilla ticket: 2265336 – ImportError: /lib64/libdnf.so.2: undefined symbol: g_once_init_enter_pointer.