Bug 249980 - Can't install plasmoid scripts
Summary: Can't install plasmoid scripts
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Plasma
Component: widget explorer (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
: 251304 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-09-03 10:09 UTC by Anders Lund
Modified: 2010-09-29 13:26 UTC (History)
14 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Lund 2010-09-03 10:09:01 UTC
Version:           unspecified (using KDE 4.5.0) 
OS:                Linux

I can't install plasmoids using the download feature built into plasma. When trying, it looks like a success, but the plasmoids does not become available.

I tried to install manually a few times, with this result:

[anders@katja ~]$ plasmapkg -i 125922-tasktimer.plasmoid 
"KConfigIni: In file /tmp/kde-anders/plasmapkgmrWpHj/metadata.desktop, line 1: " Invalid entry (missing '=') 
"KConfigIni: In file /tmp/kde-anders/plasmapkgmrWpHj/metadata.desktop, line 3: " Invalid entry (missing '=') 
"KConfigIni: In file /tmp/kde-anders/plasmapkgmrWpHj/metadata.desktop, line 5: " Invalid entry (missing '=') 
"KConfigIni: In file /tmp/kde-anders/plasmapkgmrWpHj/metadata.desktop, line 6: " Invalid entry (missing '=') 
"KConfigIni: In file /tmp/kde-anders/plasmapkgmrWpHj/metadata.desktop, line 7: " Invalid entry (missing '=') 
"KConfigIni: In file /tmp/kde-anders/plasmapkgmrWpHj/metadata.desktop, line 8: " Invalid entry (missing '=') 
"KConfigIni: In file /tmp/kde-anders/plasmapkgciSbBj/metadata.desktop, line 1: " Invalid entry (missing '=') 
"KConfigIni: In file /tmp/kde-anders/plasmapkgciSbBj/metadata.desktop, line 3: " Invalid entry (missing '=') 
"KConfigIni: In file /tmp/kde-anders/plasmapkgciSbBj/metadata.desktop, line 5: " Invalid entry (missing '=') 
"KConfigIni: In file /tmp/kde-anders/plasmapkgciSbBj/metadata.desktop, line 6: " Invalid entry (missing '=') 
"KConfigIni: In file /tmp/kde-anders/plasmapkgciSbBj/metadata.desktop, line 7: " Invalid entry (missing '=') 
"KConfigIni: In file /tmp/kde-anders/plasmapkgciSbBj/metadata.desktop, line 8: " Invalid entry (missing '=') 
plasmapkg(2794)/libplasma Plasma::Package::installPackage: Package plugin name not specified 
Installation af /home/anders/125922-tasktimer.plasmoid fejlede.
[anders@katja ~]$

The file metadata.desktop looks like this:

[Desktop Entry]
Name=Task Timer
Comment=Keeps track of time for several tasks
Icon=chronometer
Encoding=UTF-8
Keywords=time work job track
Type=Service
X-KDE-ParentApp=
X-KDE-PluginInfo-Author=Shafqat Bhuiyan
X-KDE-PluginInfo-EnabledByDefault=true
X-KDE-PluginInfo-Category=
X-KDE-PluginInfo-Email=priomsrb@gmail.com
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-Name=tasktimer
X-KDE-PluginInfo-Version=0.1
X-KDE-PluginInfo-Website=
X-KDE-ServiceTypes=Plasma/Applet
X-Plasma-API=python
X-Plasma-DefaultSize=250,200
X-Plasma-MainScript=code/tasktimer.py
X-Plasma-RemoteLocation=

I had a similar experience with a few other scripts, and then gave up.

I assume that the built installer internally use plasmapkg, and I do not understand that it does not experience an error, and tell me about it.

Reproducible: Always

Steps to Reproduce:
install a plasmoid script.
Manual installation: Errors like shown above
Built in installation: Appearant success, but plasmoid is not installed.



OS: Linux (i686) release 2.6.35-ARCH
Compiler: gcc
Comment 1 Alan Moore 2010-09-04 05:19:12 UTC
I can confirm the same problem on Kubuntu Lucid with KDE 4.5.1.  It's happened with every script I've tried.
Comment 2 Alan Moore 2010-09-04 05:23:55 UTC
I should add, as a workaround, if the plasma package is manually downloaded and manually unzipped to some directory, "plasmapkg -i directory/" works correctly, so I suspect something is going wrong with the decompression.
Comment 3 Aaron J. Seigo 2010-09-05 01:47:37 UTC
this works here, but it sounds like you may have kdelibs built without zip support?

(i tried the exact plasmoid package the original report used, btw :)
Comment 4 Anders Lund 2010-09-05 07:50:56 UTC
Ok, I will file this with arch linux then, and see if we can get it fixed. Is there a way to know if kdelibs have zip support?

Is there anything required for adding zip support (dependenciý on zup/unzip or such)?

I still believe that plasma should report the failure, instead of pretending that the install went well.
Comment 5 Beat Wolf 2010-09-05 09:16:33 UTC
There are other bugreports about install failures that are not reported to the user, so this can stay closed. (at least i'm almost sure that there are other bugs open like that).
Comment 6 Heimen Stoffels 2010-09-05 12:19:33 UTC
Oh yeah, it's a Kubuntu packaging problem. I agree that it happens here on Kubuntu with KDE 4.5.1, but:
I've tried and the same is reproducable on OpenSUSE and PCLinuxOS with KDE 4.5.1

So please reopen this bug.
Comment 7 Heimen Stoffels 2010-09-05 12:21:37 UTC
Whoops, I meant "packaging problem", not "Kubuntu packaging problem".
Comment 8 Kevin Kofler 2010-09-05 23:37:08 UTC
This has been seen by users on Fedora packages, I checked our kdelibs build logs and there's nothing reported missing by CMake (other than ASpell and HSpell which we don't build against because we use Enchant with Hunspell, but this is not related to ZIP support in any way).
Comment 9 Colin J Thomson 2010-09-07 00:13:39 UTC
Yep, I run Fedora13/4.5.1 and can only install plasmoids using the workaround in Comment #2
Comment 10 Aaron J. Seigo 2010-09-07 05:40:32 UTC
"This has been seen by users on Fedora packages"

great, so describe a method to reproduce the issue using specific, detailed, reproducable steps.

i grabbed the tasktimer.plasmoid file from kde-look.org and ran: plasmapkg -i <number->tasktimer.plasmoid and it installed. after a few moments (the time it takes kbuilsycoca4 to run) it showed up in ksycoca.

so i can't reproduce it from trunk doing the normal steps one would expect. so its one of: there are differences between what i'm doing and what others are doing, there's a difference in how the software is built, there's a difference in system configuration.

without being able to reproduce, there's nothing i can do.

it could be KTempDir returning an unwritable directory (though that would lead to "No metadata file in package" being output. perhaps the call to KArchive::copyTo results in unreadable files (similar to doing a `chdmod u-r`), so it gets written, can be stated (avoiding "No metadata file in package") but can't be read.

do some digging, but i know this at least works on a reasonable system.
Comment 11 Joel Schaerer 2010-09-07 09:44:15 UTC
I'm having the same problem, and several people at arch are reporting it as well: https://bbs.archlinux.org/viewtopic.php?id=104060
Comment 12 Anders Lund 2010-09-07 09:57:47 UTC
Dear Aaron, what makes a system qualify as "reasonable"?

And what exactly is required to build kdelibs with zip support? Is there a library or package requirement, or a cmake switch, or is it autodetected? and if so, is there a warning if it is not found? With this information, I could make a request to the kdelibs packager in my potentially not reasonable system.
Comment 13 Aaron J. Seigo 2010-09-07 17:19:03 UTC
@Joel Schaerer: unfortunately there is no useful information there in terms of clues that can help identify where the problem is. we really need people looking into what is causing the failure for people.

@Anders Lund: 'what makes a system qualify as "reasonable"?'

in this case: one with a working KZip, one where KTempDir results in a writable directory, one where KArchive::copyTo results in files that are readable by the same user the application is running as.

"what exactly is required to build kdelibs with zip support?"

according to kdelibs/CMakeLists.txt:

find_package(ZLIB)
macro_log_feature(ZLIB_FOUND "ZLib" "The Zlib compression library" "http://www.zlib.net" TRUE "" "Required by the core KDE libraries and some critical kioslaves.")

"is there a warning if it is not found?"

yes, as can be seen above.
Comment 14 Kevin Kofler 2010-09-07 17:22:32 UTC
The Fedora packages definitely have zlib support enabled, as evidenced by the build logs.
Comment 15 Aaron J. Seigo 2010-09-07 17:55:16 UTC
"The Fedora packages definitely have zlib support enabled, as evidenced by the
build logs."

great; can you check the other possible causes i listed?

(why does this feel like pulling hen's teeth? as a fair warning: unless someone puts some real effort into tracking this down, i will eventual de-prioritize the report in my queue.)
Comment 16 Anders Lund 2010-09-07 18:27:00 UTC
libkdecore as well as kio_archieve links against zlib here, and all files in /tmp/kde-anders/ as well as the directory itself are owned and read/writable by me, including for example while browsing zip archieves using kio.
Comment 17 Alan Moore 2010-09-08 06:24:48 UTC
I tried to figure this out tonight with gdb, I'm sorry I'm not so great at debugging but here's what I observed:

 - The errors are being thrown out during the call to Plasma::PackageStructurePrivate::createPackageMetadata
 - I set a breakpoint there and watched my temporary directory
 - The temporary folder is created, and the contents of the .plasmoid zip file are copied there.
 - Interestingly, the directory structure of the plasmoid file is correctly extracted, but the files themselves are full of binary garbage which the "file" command cannot identify.
 - Thus, the PackageMetadata constructor cannot make sense of the files and throws the errors.

I'll keep poking at this, but I figured more experienced minds might be able to make better sense of my observations.  Looks to me like KZip might be the problem?  My Ark works fine on zip packages, dunno if that means anything though.
Comment 18 Aaron J. Seigo 2010-09-09 03:21:09 UTC
"but the files themselves are full of binary garbage"

that would certainly explain it.

"Looks to me like KZip might be the problem?"

yes, or the library beneath it (zlib) thought that's unlikely or the class "above" it (KArchive; a couple of bug fixes just went into KArchive, but afaik that was only to fix regressions in trunk and the problems addressed never made it into a release?)

"My Ark works fine on zip packages"

there are a couple of Ark plugins that provide zip support, and it seems that the clizip one (which doesn't use KZip) is the one with the highest priority.
Comment 19 Aaron J. Seigo 2010-09-09 22:19:52 UTC
just checked and ark isn't even building the karchive based plugin these days. so it's not using the same code path at all.

if you have a source checkout, then you can turn this on by editting kdeutils/ark/plugins/karchiveplugin/CMakeLists.txt to have "add_subdirectory(karchiveplugin)" instead of "add_subdirectory( clizipplugin )"

you will also need to remove `kde4-config --prefix`/share/kde4/services/kerfuffle_clizip.desktop manually and run kbuildsycoca4.
Comment 20 Alan Moore 2010-09-10 03:50:48 UTC
Instead of messing with Ark, I wrote short script in Python / PyKDE to extract archives the same way PackageStructure::metadata() does it, namely:
 - Create a KZip object from a plasmoid or arbitrary zip file
 - Create a KArchiveDirectory using KZip.directory()
 - Use KArchiveDirectory::copyTo to extract the contents to a folder

The results on my system exhibited the same problem: directory structure was right, but the files were all full of garbage.  It was the same whether I extracted an archive with one file or a complex directory structure, and whether or not I used a temporary directory created by KTempDir or just a regular directory in my ~. 

I looked over KZip and KArchive sources, but I don't understand enough about file decompression to know what I'm looking for.  Do we need to refile this bug against KDElibs?
Comment 21 Alex Sarmiento 2010-09-13 17:27:51 UTC
This is not a plasma bug, this is a bug in the extraction routine of the  KZip library. I've tried to extract some files form a zipped file and all i can get is garbage:

const KArchiveFile* epsFile=static_cast<const KArchiveFile*>(epsEntry);
            QString dir=KGlobal::dirs()->saveLocation("tmp", "eps-tmp/");
            epsFile->copyTo(dir);

 Im using kde 4.5.1 shipped from kubuntu 10.04 32 bits.
Comment 22 Marcin Gryszkalis 2010-09-16 11:22:35 UTC
Same problem on gentoo, built from source via portage.

Additionally I noticed following message in logs

plasma-desktop(2052)/knewstuff (api) KNS3::Cache::readRegistry: The file  "/home/mg/.kde4/share/apps/knewstuff3/plasmoids.knsregistry"  could not be opened.

but I think it's because no plasmoid was successfully installed before.
Comment 23 Matthias Fuchs 2010-09-18 22:32:36 UTC
*** Bug 251304 has been marked as a duplicate of this bug. ***
Comment 24 Matthias Fuchs 2010-09-18 23:13:26 UTC
Ok, I did a small test with three different clean devel accounts. I am using Arch Linux 64 bit with kdemod.

In two cases I checked out kdelibs and kdeplasma-addons from 4.5 branch and then compiled it with release and in the other with debug mode. In both cases installing comics -- also uses plasmapkg -- did work.

In the last case I installed kdelibs 4.5.1 tag and then kdeplasma-addons from 4.5 branch and compiled it in release mode. This time it did _not_ work.

So I suppose this problem is fixed now, whatever it was initially.
Comment 25 Aaron J. Seigo 2010-09-18 23:14:49 UTC
seems that the bug dfaure fixed in libkio trunk also did affect branch. at least it's resolved. good news.
Comment 26 Matthias Fuchs 2010-09-18 23:17:04 UTC
It would be great if someone could reproduce what I did i.e. trying with 4.5 branch. Or even better track the commit down that fixed it, that way what caused the problem would be clear, at least in retrospect.
Comment 27 Matthias Fuchs 2010-09-18 23:28:26 UTC
Reopended it by accident.
Comment 28 Beat Wolf 2010-09-29 13:26:24 UTC
*** Bug 252612 has been marked as a duplicate of this bug. ***