Bug 468240 - Ark can no longer open 7z archives ( possibly due to changes in 7zip new release )
Summary: Ark can no longer open 7z archives ( possibly due to changes in 7zip new rele...
Status: CONFIRMED
Alias: None
Product: ark
Classification: Applications
Component: plugins (show other bugs)
Version: 23.08.5
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Elvis Angelaccio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-07 11:35 UTC by blackstone
Modified: 2024-07-21 12:32 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description blackstone 2023-04-07 11:35:02 UTC
SUMMARY
Not sure if this is considered a snap store "feature" or an ark bug.....  If you install ark from the snap store (i'm using Ubuntu 23.04 beta, but I reproduced this on Ubuntu 22.10 as well), and then install p7zip using "sudo apt install," the ark 7z plugin will not recognize that the 7z binary is installed in /usr/bin.  However, if you install ark using "sudo apt install," it will recognize the 7z binary is installed in /usr/bin.  On Ubuntu 23.04, the ark version is the same in the snap store as it is in the lunar lobster repository (ark version 22.12.3).  I also tried this with the 1) 7zz binary from the official 7zip build and tried 2) renaming the 7zz binary from the official 7zip build to 7z.


STEPS TO REPRODUCE
1.  Install ark from app store
2.  Install p7zip and verify 7z binary is in /usr/bin
3.  Run ark installed from snap store.  Settings shows the 7z plugin greyed out.  If you try to create a new archive, it does not list 7z as an option.
4. Install ark from luna lobster repository using "sudo apt install ark."
5.  Run ark installed using "sudo apt install" and all things 7z work.

OBSERVED RESULT
Run ark installed from snap store.  Settings shows the 7z plugin greyed out even with 7z binary in /usr/bin.  If you try to create a new archive, it does not list 7z as an option.

EXPECTED RESULT
7z plugin recognizes 7z binary in /usr/bin and are able to work with 7z archives.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Ubuntu 23.04 and 22.10 using snap store version of ark.
Comment 1 blackstone 2023-04-07 13:53:55 UTC
seems this isn't an ark bug, but a snap "feature."  Snaps don't seem to be able to access much of the filesystem, and in this specific case that is /usr/bin.  I way around this is to include the 7z binary with the snap package for ark.  If you do so, request that you include the binary from the official 7zip source, and not the p7zip binary.  Regardless, i've moved to just using the version of ark installed from the ubuntu repoistory which does not have this limitation.  Thx again for you consideration!
Comment 2 Scarlett Moore 2023-04-14 11:10:16 UTC
I will fix the snap. Thanks for reporting!
Comment 3 blackstone 2023-04-14 13:35:37 UTC
(In reply to Scarlett Moore from comment #2)
> I will fix the snap. Thanks for reporting!

Scarlett - awesome.  thank you!  Out of curiousity, will you be adding the p7zip binary (7z), or the official 7zip binary (7zz)?  Not-withstanding, you may rename the official 7zip binary to 7z for compatability.
Comment 4 Scarlett Moore 2023-04-21 16:45:55 UTC
Well, I installed the packages into the snap and verified the binaries are there and it still doesn't work. I will try the official 7zip, but I fear this will not fix it. It seems rar and a few others have the same problem. So I guess I need to delve into the code to see how it is looking for it.
Comment 5 blackstone 2023-04-21 18:04:43 UTC
(In reply to Scarlett Moore from comment #4)
> Well, I installed the packages into the snap and verified the binaries are
> there and it still doesn't work. I will try the official 7zip, but I fear
> this will not fix it. It seems rar and a few others have the same problem.
> So I guess I need to delve into the code to see how it is looking for it.

this for the update scarlett.  much appreciate the help!
Comment 6 dofficialgman 2024-02-22 22:45:36 UTC
this issue now also affects the apt package in Ubuntu Noble https://bugs.launchpad.net/ubuntu/+source/ark/+bug/2051041
Comment 7 Scarlett Moore 2024-03-05 11:41:31 UTC
Right, this is not a snap issue. The latest 7zip transition changes the paths.

/usr/bin/7z
/usr/bin/7za
/usr/bin/7zr
/usr/bin/p7zip
/usr/lib/7zip/7z
/usr/lib/7zip/7z.so
/usr/lib/7zip/7zCon.sfx
/usr/lib/7zip/7za
/usr/lib/7zip/7zr
/usr/share/doc/7zip/7zC.txt.gz
/usr/share/doc/7zip/7zFormat.txt.gz
/usr/share/doc/7zip/Methods.txt
/usr/share/doc/7zip/changelog.Debian.gz
/usr/share/doc/7zip/copyright
/usr/share/doc/7zip/lzma.txt.gz
/usr/share/doc/7zip/readme.txt.gz
/usr/share/doc/7zip/src-history.txt.gz
/usr/share/man/man1/7z.1.gz
/usr/share/man/man1/7za.1.gz
/usr/share/man/man1/7zr.1.gz
/usr/share/man/man1/p7zip.1.gz
Comment 8 Scarlett Moore 2024-03-05 11:47:29 UTC
I think just adding a program check for 7zip program here https://invent.kde.org/utilities/ark/-/blob/release/23.08/plugins/cli7zplugin/cliplugin.cpp?ref_type=heads Will fix it?
Comment 9 Scarlett Moore 2024-03-07 10:12:13 UTC
Nope, it finds the 7z binary just fine. But it still silently fails. Running the same command as ark does is successful.
/usr/bin/7z l -slt ~/Downloads/sample-1.7z .

7-Zip 23.01 (x64) : Copyright (c) 1999-2023 Igor Pavlov : 2023-06-20
 64-bit locale=en_US.UTF-8 Threads:16 OPEN_MAX:1024

Scanning the drive for archives:
1 file, 736040 bytes (719 KiB)     

Listing archive: /home/scarlett/Downloads/sample-1.7z

--
Path = /home/scarlett/Downloads/sample-1.7z
Type = 7z
Physical Size = 736040
Headers Size = 244
Method = LZMA2:1536k
Solid = +
Blocks = 1

----------

I am at a loss. Here is my gdb log.
ark(28728)/(ark.part) \[31m\[34munknown\[0m: Attempting to open archive "/home/scarlett/Downloads/sample-1.7z"
ark(28728)/(ark.kerfuffle) \[31m\[34munknown\[0m: Going to create archive "/home/scarlett/Downloads/sample-1.7z"
ark(28728)/(kf.coreaddons) \[31m\[34munknown\[0m: Checking for plugins in ("/usr/bin/kerfuffle", "/usr/lib/x86_64-linux-gnu/qt5/plugins/kerfuffle")
ark(28728)/(ark.kerfuffle) \[31m\[34munknown\[0m: Looking for plugins that handle the mimetype:  "application/x-7z-compressed"
ark(28728)/(ark.kerfuffle) \[31m\[34munknown\[0m: Checking plugin "kerfuffle_cli7z"
ark(28728)/(ark.kerfuffle) \[31m\[34munknown\[0m: Created read-only interface for "/home/scarlett/Downloads/sample-1.7z"
ark(28728)/(ark.kerfuffle) \[31m\[34munknown\[0m: Created read-write interface for "/home/scarlett/Downloads/sample-1.7z"
ark(28728)/(ark.cli7z) \[31m\[34munknown\[0m: Loaded cli_7z plugin
ark(28728)/(ark.cli7z) \[31m\[34munknown\[0m: Setting up parameters...
ark(28728)/(ark.cli7z) \[31m\[34munknown\[0m: Checking 7z variant...
[Detaching after fork from child process 31451]
ark(28728)/(ark.cli7z) \[31m\[34munknown\[0m: Detected upstream 7-Zip variant.
ark(28728)/(ark.kerfuffle) \[31m\[34munknown\[0m: Successfully loaded plugin "kerfuffle_cli7z"
ark(28728)/(ark.kerfuffle) \[31m\[34munknown\[0m: Created archive instance
ark(28728)/(ark.kerfuffle) \[31m\[34munknown\[0m: Created job instance
ark(28728)/(kf.coreaddons) \[31m\[34munknown\[0m: Checking for plugins in ("/usr/bin/kerfuffle", "/usr/lib/x86_64-linux-gnu/qt5/plugins/kerfuffle")
ark(28728)/(ark.kerfuffle) \[31m\[34munknown\[0m: Executing "/usr/bin/7z" ("l", "-slt", "/home/scarlett/Downloads/sample-1.7z") within directory "/home/scarlett/kde/ark"
[Detaching after fork from child process 31452]
ark(28728)/(kf.kio.core.dirlister) \[31m\[34munknown\[0m: ~KCoreDirLister KCoreDirLister(0x555555fddf70)
ark(28728)/(kf.kio.core.dirlister) \[31m\[34munknown\[0m: lister: KCoreDirLister(0x555555fddf70) silent= false
ark(28728)/(kf.kio.core.dirlister) \[31m\[34munknown\[0m: KCoreDirLister(0x555555fddf70)  url= QUrl("file:///home/scarlett/Downloads")
ark(28728)/(kf.kio.core.dirlister) \[31m\[34munknown\[0m: KCoreDirLister(0x555555fddf70)
ark(28728)/(kf.kio.core.dirlister) \[31m\[34munknown\[0m: Iterating over dirs (QUrl("file:///home/scarlett/Downloads"))
ark(28728)/(kf.kio.core.dirlister) \[31m\[34munknown\[0m: KCoreDirLister(0x555555fddf70)  _url:  QUrl("file:///home/scarlett/Downloads")
ark(28728)/(kf.kio.core.dirlister) \[31m\[34munknown\[0m: KCoreDirLister(0x555555fddf70) item moved into cache: QUrl("file:///home/scarlett/Downloads")
ark(28728)/(kf.kio.core.dirlister) \[31m\[34munknown\[0m: ~KCoreDirLister KCoreDirLister(0x555555e4df70)
ark(28728)/(kf.kio.core.dirlister) \[31m\[34munknown\[0m: lister: KCoreDirLister(0x555555e4df70) silent= false
ark(28728)/(kf.kio.core.dirlister) \[31m\[34munknown\[0m: KCoreDirLister(0x555555e4df70)  url= QUrl("tags:/")
ark(28728)/(kf.kio.core.dirlister) \[31m\[34munknown\[0m: KCoreDirLister(0x555555e4df70)
ark(28728)/(kf.kio.core.dirlister) \[31m\[34munknown\[0m: Iterating over dirs (QUrl("tags:/"))
ark(28728)/(kf.kio.core.dirlister) \[31m\[34munknown\[0m: KCoreDirLister(0x555555e4df70)  _url:  QUrl("tags:/")
ark(28728)/(kf.kio.core.dirlister) \[31m\[34munknown\[0m: KCoreDirLister(0x555555e4df70) item moved into cache: QUrl("tags:/")
ark(28728)/(ark.kerfuffle) \[31m\[34munknown\[0m: Process finished, exitcode: 0 exitstatus: QProcess::NormalExit
ark(28728)/(ark.kerfuffle) \[31m\[34munknown\[0m: Job finished, result: true , time: 27 ms
ark(28728)/(ark.part) \[31m\[34munknown\[0m: Showing columns:  ()
ark(28728)/(ark.part) \[31munknown\[0m: No entry listed by the plugin
ark(28728)/(kf.coreaddons) \[31m\[34munknown\[0m: Checking for plugins in ("/usr/bin/kerfuffle", "/usr/lib/x86_64-linux-gnu/qt5/plugins/kerfuffle")
ark(28728)/(kf.coreaddons) \[31m\[34munknown\[0m: Checking for plugins in ("/usr/bin/kerfuffle", "/usr/lib/x86_64-linux-gnu/qt5/plugins/kerfuffle")
ark(28728)/(kf.coreaddons) \[31m\[34munknown\[0m: Checking for plugins in ("/usr/bin/kerfuffle", "/usr/lib/x86_64-linux-gnu/qt5/plugins/kerfuffle")
[Thread 0x7fffc34006c0 (LWP 31346) exited]
[Thread 0x7fffcd0006c0 (LWP 31345) exited]
[Thread 0x7fffc20006c0 (LWP 31347) exited]
[Thread 0x7fffcfa006c0 (LWP 31336) exited]
[Thread 0x7fffcf0006c0 (LWP 31334) exited]
[Thread 0x7fffc2a006c0 (LWP 31337) exited]
[Thread 0x7fffc3e006c0 (LWP 31335) exited]
Comment 10 Bug Janitor Service 2024-03-17 23:57:51 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/ark/-/merge_requests/238
Comment 11 Elvis Angelaccio 2024-03-17 23:59:54 UTC
(In reply to Scarlett Moore from comment #9)
> ark(28728)/(ark.kerfuffle) \[31m\[34munknown\[0m: Executing "/usr/bin/7z"
> ("l", "-slt", "/home/scarlett/Downloads/sample-1.7z") within directory
...
> ark(28728)/(ark.part) \[31munknown\[0m: No entry listed by the plugin

Looks like it fails to either run the 7z process or parse its CLI output. Does snap allow a process to spawn another process?

Anyway, I've been working to add support for 7z archives in the libarchive plugin: https://invent.kde.org/utilities/ark/-/merge_requests/238

Which means that Ark will be able to create and extract 7z archives even without any 7z binary installed. Testers are welcome :)
Comment 12 Elvis Angelaccio 2024-04-23 11:41:36 UTC
Git commit a751cf8c12c05e23280a8e60c51baa6c35e9d04a by Elvis Angelaccio.
Committed on 23/04/2024 at 10:46.
Pushed by elvisangelaccio into branch 'master'.

libarchive: add support for unencrypted 7-zip

libarchive can extract 7-zip archives and also create them, with full
support for all the expected compression methods available in the 7-zip
format.

This commit enables the 7-zip format in the libarchive plugin, which makes
Ark always able to provide basic support for 7z archives. This was
currently possible only when the 7z binary is installed on the system,
which may not be always true (some distributions don't ship a 7z binary
by default).

Unfortunately libarchive doesn't support encrypted 7z archives yet,
which means this cannot be a drop-in replacement for the 7z plugin.
Also it doesn't allow to create multi-volume files.

But it is a first step towards deprecating the 7z plugin. This plugin has not
been always reliable in the past, since it needs to parse the CLI output
of the 7z binary. And there is the additional problem of the p7zip/7-zip
upstream projects being weirdly maintained.

Note: the minimum supported compression level is 1 instead of 0 (unlike
the 7z plugin), since the bzip2 library (used by libarchive) doesn't
accept 0 as minimum value and it would be too complicated to use
different value ranges for different compression methods.

M  +1    -0    README.md
M  +16   -1    plugins/libarchive/kerfuffle_libarchive.json.cmake
M  +24   -0    plugins/libarchive/libarchiveplugin.cpp
M  +44   -9    plugins/libarchive/readwritelibarchiveplugin.cpp
M  +2    -1    plugins/libarchive/readwritelibarchiveplugin.h

https://invent.kde.org/utilities/ark/-/commit/a751cf8c12c05e23280a8e60c51baa6c35e9d04a
Comment 13 Elvis Angelaccio 2024-04-23 12:27:43 UTC
Git commit 56d9da15e9480cad879ffff1c40e6b56beaadc1f by Elvis Angelaccio.
Committed on 23/04/2024 at 12:08.
Pushed by elvisangelaccio into branch 'release/24.05'.

libarchive: add support for unencrypted 7-zip

libarchive can extract 7-zip archives and also create them, with full
support for all the expected compression methods available in the 7-zip
format.

This commit enables the 7-zip format in the libarchive plugin, which makes
Ark always able to provide basic support for 7z archives. This was
currently possible only when the 7z binary is installed on the system,
which may not be always true (some distributions don't ship a 7z binary
by default).

Unfortunately libarchive doesn't support encrypted 7z archives yet,
which means this cannot be a drop-in replacement for the 7z plugin.
Also it doesn't allow to create multi-volume files.

But it is a first step towards deprecating the 7z plugin. This plugin has not
been always reliable in the past, since it needs to parse the CLI output
of the 7z binary. And there is the additional problem of the p7zip/7-zip
upstream projects being weirdly maintained.

Note: the minimum supported compression level is 1 instead of 0 (unlike
the 7z plugin), since the bzip2 library (used by libarchive) doesn't
accept 0 as minimum value and it would be too complicated to use
different value ranges for different compression methods.

M  +1    -0    README.md
M  +16   -1    plugins/libarchive/kerfuffle_libarchive.json.cmake
M  +24   -0    plugins/libarchive/libarchiveplugin.cpp
M  +44   -9    plugins/libarchive/readwritelibarchiveplugin.cpp
M  +2    -1    plugins/libarchive/readwritelibarchiveplugin.h

https://invent.kde.org/utilities/ark/-/commit/56d9da15e9480cad879ffff1c40e6b56beaadc1f
Comment 14 dofficialgman 2024-05-11 14:59:06 UTC
(In reply to Scarlett Moore from comment #2)
> I will fix the snap. Thanks for reporting!

Can you fix the apt package in Ubuntu Noble as well? Been dealing with this issue for 3 months now.
Comment 15 Scarlett Moore 2024-06-05 13:34:28 UTC
This fix only applies to qt6 24.05 can we please get a backport for 23.08.5 in which the original bug was filed? Thanks, Scarlett
Comment 16 Scarlett Moore 2024-06-05 13:35:12 UTC
(In reply to dofficialgman from comment #14)
> (In reply to Scarlett Moore from comment #2)
> > I will fix the snap. Thanks for reporting!
> 
> Can you fix the apt package in Ubuntu Noble as well? Been dealing with this
> issue for 3 months now.

I tried. It doesn't apply.
Comment 17 kovyngnm8 2024-06-06 07:28:01 UTC
This Bug is still in Ubuntu/Kubuntu 24.04 with ark version 23.08, Installed from apt(not snap version), Even though i have enabled support for 7zip in plugin section in ark and 7zip is preinstalled. Still can't open or create the 7zip file (encrypted or not).
Comment 18 Shy Zedaka 2024-06-10 22:31:55 UTC
As mentioned, 
with both p7zip (16.02+transitional.1) and 7zip (23.01+dfsg-11) packages installed in Kubuntu 24.04
i am unable to open and view any 7z file using Ark (23.08.5)
Comment 19 Wedge009 2024-07-21 12:32:27 UTC
I started using Kubuntu 24.04 a few days ago (July 2024), was previously using Kubuntu 22.04. For the latter, with p7zip package, Ark 21.12.3 could compress, read, and extract 7-zip archives fine. For the former, with 7zip package, Ark 23.08.5 can compress 7-zip archives (eg I confirm the output file on a Windows machine), but it cannot read/extract any more. Am I right in thinking this is the same issue that's reported here?

Reading above, is it the case that a correction has only been applied to Ark 24.x, and not 23.x?