Bug 2373874 - 7z cannot find library when invoked with full path: Codec Load Error: /usr/bin/7z.so : errno=2 : No such file or directory
Summary: 7z cannot find library when invoked with full path: Codec Load Error: /usr/bi...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: 7zip
Version: rawhide
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Michel Lind
QA Contact:
URL: https://bugs.kde.org/show_bug.cgi?id=...
Whiteboard:
Depends On:
Blocks: 2363812 2366470
TreeView+ depends on / blocked
 
Reported: 2025-06-19 13:44 UTC by Michael
Modified: 2026-06-16 11:44 UTC (History)
15 users (show)

Fixed In Version: 7zip-26.01-1.el10_3 7zip-26.01-1.el10_2 7zip-26.01-1.fc44 7zip-26.01-1.fc43
Clone Of:
Environment:
Last Closed: 2026-06-16 00:26:35 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
KDE Software Compilation 505637 0 NOR RESOLVED Ark fails to create and extract .7z files -- ark.cli7z: "oad Error: /usr/bin/7z.so : errno=25 : Inappropriate ioctl for ... 2025-06-19 13:46:40 UTC

Description Michael 2025-06-19 13:44:44 UTC
See bug originally reported at KDE - https://bugs.kde.org/show_bug.cgi?id=505637

When attempting to create or extract .7z files using KDE Ark on Fedora, the operation fails with the following error:

"ark.cli7z: Load Error: /usr/bin/7z.so : errno=25 : Inappropriate ioctl for device"

This issue is caused by how Fedora packages the 7-Zip backend.

Fedora patches the 7-Zip source to expect the 7z.so module in /usr/libexec/7zip/, but it installs the 7z binary in /usr/bin and the 7z.so file in /usr/libexec/7zip/.

However, Ark (or its CLI backend wrapper) attempts to load 7z.so from the same directory as the binary (/usr/bin/7z), which causes it to fail.

Other distros like Arch Linux do not patch the 7-Zip source, instead:

1-Install 7-Zip under /usr/lib/7zip/ (where both the binary and .so are placed),
2- Place wrapper scripts in /usr/bin/ to call the correct locations.
3- As a temporary workaround, copying 7z.so into /usr/bin/ resolves the issue, indicating a path mismatch as the root cause.

Reproducible: Always

Steps to Reproduce:
1. Have Ark and 7-zip installed on Fedora.
2. Attempt to extract or create a .7z archive using Ark.
3. Observe the error in the terminal or logs.

Actual Results:
Unable to extract or create .7z files in Ark.

Expected Results:
Successfully extract or create .7z files in Ark.

Comment 1 lplt77p20omx 2025-06-21 01:33:31 UTC
CC: Fedora 7zip package maintainer

Comment 2 Than Ngo 2025-06-23 07:33:00 UTC
It looks like a regression in 7zip, as ark worked fine before switching from p7zip to 7zip. Reassigned it to 7zip

Comment 3 Sandro 2025-08-14 22:17:35 UTC
I just ran into this while working on patool and had an interesting observation.

The error only occurs when `7z` is invoked using the full path. Compare `7z i` vs. `/usr/bin/7z i`. The first will print information regarding formats and codecs, etc. It also states:

Libs:
 0 : 24.09 : /usr/libexec/7zip/7z.so

The latter bails out with:

Codec Load Error: /usr/bin/7z.so : errno=2 : No such file or directory

Apparently, when the full path is given, `7z` expects the library to be present in the same location as the executable. It looks like the applied patch [1] does not work when using the full path to the executable.

Since 7zip is replacing p7zip in F43+, this should be fixed before F43 is shipped.

[1] https://src.fedoraproject.org/rpms/7zip/blob/rawhide/f/7zip-find-so-in-libexec.diff

Comment 4 Sandro 2025-08-15 08:46:57 UTC
> Apparently, when the full path is given, `7z` expects the library to be
> present in the same location as the executable. It looks like the applied
> patch [1] does not work when using the full path to the executable.
> 
> Since 7zip is replacing p7zip in F43+, this should be fixed before F43 is
> shipped.
> 
> [1]
> https://src.fedoraproject.org/rpms/7zip/blob/rawhide/f/7zip-find-so-in-
> libexec.diff

I have amended the patch so the library will always be searched for in /usr/libexec/7zip:

https://src.fedoraproject.org/rpms/7zip/pull-request/5

Comment 5 Sandro 2025-09-08 20:57:04 UTC
Ping?

Could one of the maintainers please merge the PR and rebuild or state what's keeping the fix from being shipped?

Comment 6 Milan Bouchet-Valat 2025-10-20 10:00:19 UTC
I also bumped into this when trying to build the Julia package.

Comment 7 Fedora Update System 2025-10-20 12:46:38 UTC
FEDORA-2025-e3ef218150 (7zip-24.09-6.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-e3ef218150

Comment 8 Fedora Blocker Bugs Application 2025-10-20 17:10:41 UTC
Proposed as a Freeze Exception for 43-final by Fedora user ngompa using the blocker tracking app because:

 7zip (which is included on media) is broken OOTB without this.

Comment 9 Yaakov Selkowitz 2025-10-20 18:18:36 UTC
The patch is not compatible with flatpak builds (e.g. for ark) which use the /app prefix instead of /usr.

Comment 10 Lukas Ruzicka 2025-10-20 18:59:53 UTC
Discussed at the blocker review meeting on 20th Oct. 2025

AGREED AcceptedFinalBlocker 

This is upgraded and accepted as a Final BLOCKER as a violation of Final criterion "For all release-blocking desktop / arch combinations, the following applications must start successfully and withstand a basic functionality test: ... archive manager", as testing indicates this affects all standard ways of interacting with archives in KDE (ark, Dolphin) and 7zip archives are very common, especially for platform-agnostic interchange.

https://meetbot.fedoraproject.org/blocker-review_matrix_fedoraproject-org/2025-10-20/f43-blocker-review.2025-10-20-16.02.html

Comment 11 Fedora Update System 2025-10-21 01:58:59 UTC
FEDORA-2025-e3ef218150 has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-e3ef218150`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-e3ef218150

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

Comment 12 Kamil Páral 2025-10-21 11:53:49 UTC
(In reply to Fedora Update System from comment #11)
> FEDORA-2025-e3ef218150 has been pushed to the Fedora 43 testing repository.

Fixes both Ark and Dolphin

Comment 13 Milan Bouchet-Valat 2025-10-22 20:44:34 UTC
Unfortunately this isn't enough to fix my use case in the Julia package. Julia calls 7z via a symlink /usr/libexec/julia/7z which points to /usr/bin/7z. This ensures Julia uses /usr/bin/7z even if PATH has been changed by the user. But that fails because the symlink doesn't start with /usr/bin.

I can work around this in several ways, but it's annoying that symlinks don't work.

Comment 14 Michel Lind 2025-10-23 09:18:07 UTC
Ugh, yes, we definitely want that usecase to work. Let's keep this bug open for now.

Comment 15 Fedora Update System 2025-10-23 23:54:13 UTC
FEDORA-2025-e3ef218150 (7zip-24.09-6.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 16 Adam Williamson 2025-10-26 15:14:58 UTC
Maybe the Julia case should be a separate bug?

Comment 17 Adam Williamson 2025-10-27 16:37:18 UTC
anyway, f43 is out, so dropping blocker metadata.

Comment 18 Spike 2026-05-31 18:08:39 UTC
Food for thought: This is still an issue on f43 and f44 when 7z is invoked as root since /usr/sbin/ is listed  before /usr/bin in $PATH for the root user.

This causes issues for ansible modules leveraging 7z (e.g. community.general.iso_extract [1]) since these quite often run as root on the managed nodes. Ansible will resolve the full path to the binary [2] and invoke the first valid one, i.e. /usr/sbin/7z in this case. This in turn leads to

  Codec Load Error: /usr/sbin/7z.so : errno=2 : No such file or directory

as described above.

[1] https://docs.ansible.com/projects/ansible/latest/collections/community/general/iso_extract_module.html
[2] https://github.com/ansible/ansible/blob/1d398ae8af25132dc5290226517a7c8763ae295b/lib/ansible/module_utils/basic.py#L1387-L1405

Comment 19 Artem S. Tashkinov 2026-06-13 17:46:10 UTC
7z also fails to run when invoked as /usr/sbin/7z which affects the root user whose $PATH has /usr/sbin before /usr/bin.

I've already proposed a fix for mc (Midnight Commander) but it would be nice to fix it 7-zip instead. 

Does this package have a maintainer?

I see a dozen of open bug reports, and multiple CVEs.

Comment 20 Fedora Update System 2026-06-15 18:25:54 UTC
FEDORA-2026-4be7569210 (7zip-26.01-1.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-4be7569210

Comment 21 Fedora Update System 2026-06-15 18:25:56 UTC
FEDORA-2026-f36864b408 (7zip-26.01-1.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-f36864b408

Comment 22 Fedora Update System 2026-06-15 18:41:31 UTC
FEDORA-EPEL-2026-8d909527ba (7zip-26.01-1.el10_2) has been submitted as an update to Fedora EPEL 10.2.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-8d909527ba

Comment 23 Fedora Update System 2026-06-15 18:41:31 UTC
FEDORA-EPEL-2026-52d18d8d5a (7zip-26.01-1.el10_3) has been submitted as an update to Fedora EPEL 10.3.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-52d18d8d5a

Comment 24 Spike 2026-06-15 20:03:26 UTC
Unfortunately the latest update does not entirely fix this issue:

# cat /etc/fedora-release 
Fedora release 45 (Rawhide)
# /usr/sbin/7z x /var/tmp/test.iso

7-Zip 26.01 (x64) : Copyright (c) 1999-2026 Igor Pavlov : 2026-04-27
 64-bit locale=C.UTF-8 Threads:16 OPEN_MAX:524288


Codec Load Error: /usr/sbin/7z.so : errno=2 : No such file or directory

Scanning the drive for archives:
1 file, 374784 bytes (366 KiB)

Extracting archive: /var/tmp/test.iso
ERROR: /var/tmp/test.iso
Cannot open the file as archive

    
Can't open as archive: 1
Files: 0
Size:       0
Compressed: 0


Looking at https://src.fedoraproject.org/rpms/7zip/blob/0557591d53bbfa4ec3c73728b31f101158afc3c7/f/7zip-find-so-in-libexec.diff it seems /bin/7z and /usr/bin/7z are fixed, but /usr/sbin/7z is still not addressed.

Comment 25 Artem S. Tashkinov 2026-06-15 20:13:48 UTC
I've already tried to fix this in Midnight Commander but its developers are not particularly excited:

https://github.com/MidnightCommander/mc/pull/5125

Comment 26 Fedora Update System 2026-06-16 00:26:35 UTC
FEDORA-EPEL-2026-52d18d8d5a (7zip-26.01-1.el10_3) has been pushed to the Fedora EPEL 10.3 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 27 Fedora Update System 2026-06-16 00:40:45 UTC
FEDORA-EPEL-2026-8d909527ba (7zip-26.01-1.el10_2) has been pushed to the Fedora EPEL 10.2 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 28 Fedora Update System 2026-06-16 01:02:51 UTC
FEDORA-2026-4be7569210 (7zip-26.01-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 29 Fedora Update System 2026-06-16 01:11:11 UTC
FEDORA-2026-f36864b408 (7zip-26.01-1.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 30 Artem S. Tashkinov 2026-06-16 07:02:47 UTC
26.01-1.fc44 from testing does NOT fix the issue.


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