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: VERIFIED
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: 2025-10-27 16:37 UTC (History)
14 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
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.


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