Bug 679650

Summary: PackageKit taking too long to refresh repos and generate packagelist
Product: [openSUSE] openSUSE 11.4 Reporter: Forgotten User 10buyl7JnO <forgotten_10buyl7JnO>
Component: Update ProblemsAssignee: Duncan Mac-Vicar <dmacvicar>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P2 - High CC: ctrippe, dmacvicar, dmartinjr, henning.schnoor, iceman, jnelson-suse, kolAflash, ma, meissner, shiverma, suse-beta, thomaslguthrie, wstephenson
Version: Factory   
Target Milestone: ---   
Hardware: x86-64   
OS: Linux   
Whiteboard: maint:released:11.4:44473
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Deadline: 2011-11-18   
Attachments: pk_backend_zypp
requested file
pk_backend_zypp log.
pk_backend_zypp-1 PackageKit-0.6.14-0.3.1.x86_64
shap shot of system load of 'Generating package lists' process
Software update shows weird listing.
screenshot of packagekit as shown in yast2 online update or software management

Description Forgotten User 10buyl7JnO 2011-03-15 07:23:58 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16

opensuse 11.4 x86_64
dell inspiron 1464

I noticed that kupdate applet is replaced with kpackagekit. Looks nice but it takes too long to refresh repos and generate package list. Some times more than hour. Yast doesn't take this longer.

Reproducible: Always
Comment 1 kolA flash 2011-03-19 20:46:57 UTC
Same problem.

In German the KPackagekit tells "Paketliste wird erzeugt" for a lot of time (maybe 20 minutes). The progress-bar is constantly moving forward and the process packagekitd is using about 10 percent cpu power of my QuadCore cpu, while no other processes are working hard. The CPU is mostly at 800MHz (governor conservative).
A "zypper clean -a" didn't help.

The speed feels a little like the old Software-Management in 10.3 :-/
BUT: If I'm using YaST or zypper (from bash) everything is fine!

I'm having 18 active repositories and additional 10 inactive repositories. The system is x86_64 and it's upgraded from openSUSE 11.3.


P.S. Had this bug too:
https://bugzilla.novell.com/show_bug.cgi?id=678993
To solv it, I opened the KDE systemsettings (german Systemeinstellungen), choose "Networksettings" (german Netzwerkeinstellungen) -> "Proxy" and activated "Directly connected to the Internet" (german "Direkt mit dem Internet verbunden").
That solved it! But maybe maybe maybe it has something to do with this, so I'm telling it!
Comment 2 kolA flash 2011-03-19 23:38:45 UTC
Looks like it's not caused by that proxy setting. I didn't do that setting on my notebook but it shows the same very slow KPackagekit.
Comment 3 kolA flash 2011-03-19 23:39:06 UTC
Maybe related?
https://bugzilla.novell.com/show_bug.cgi?id=664739
Comment 4 Forgotten User 10buyl7JnO 2011-03-20 05:08:46 UTC
I have disabled proxy and enabled direct connection but still its slow.
However it is not endless loop as mentioned in #664739 as it does complete at one time, it just takes too long to refresh repos and generate package list.
Comment 5 Jon Nelson 2011-03-20 16:40:59 UTC
I can confirm this.
zypper: under 30 seconds
kpackagekit: still going after 10's of minutes
Comment 6 Jon Nelson 2011-03-20 16:45:06 UTC
What's more, I can tell you it is *not* kpackagekit but packagekit itself. I know this because I used "pkcon refresh" from a console and got exactly the same behavior.
Comment 7 Christian Trippe 2011-03-20 18:05:40 UTC
Assigning to the PackageKit maintainer because of above comment.
Comment 8 Will Stephenson 2011-03-24 13:47:30 UTC
Reproduced here too.
Comment 9 Thomas Guthrie 2011-04-02 00:21:49 UTC
Same symptoms here, with a possible cause.

Ran between 30-60 minutes, which gave me time to find if anyone was chewing up disk space.  Someone was:

SR1650NX:/var/log # wc -l pk_backend_zypp
512658 pk_backend_zypp

The above wc was taken when the updating bar was at 98%.

As soon as it completed, the file was truncated back down to zero:
SR1650NX:/var/log # ll pk_backend_zypp
-rw-r----- 1 root root 0 Apr  1 16:37 pk_backend_zypp

So I don't have the final file size, but I did "tail" the file at one point.  It is full of detailed debugging info:
2011-04-01 16:16:19 <1> SR1650NX(5956) [zypp++] MediaManager.cc(checkDesired):109 checkDesired(965): desired (report by zypp::media::NoVerifier)
2011-04-01 16:16:19 <1> SR1650NX(5956) [zypp++] MediaManager.cc(checkDesired):112 checkDesired(965): desired (cached)
2011-04-01 16:16:19 <1> SR1650NX(5956) [zypp++] MediaManager.cc(checkDesired):112 checkDesired(965): desired (cached)
2011-04-01 16:16:19 <1> SR1650NX(5956) [zypp++] MediaMultiCurl.cc(doGetFileCopy):1230 dest: /var/adm/mount/AP_0x00000001/content
2011-04-01 16:16:19 <1> SR1650NX(5956) [zypp++] MediaMultiCurl.cc(doGetFileCopy):1231 temp: /var/adm/mount/AP_0x00000001/content.new.zypp.6KQJTl

My cpu usage never went above 25%, so it may be that the slowdown is entirely due to writing one-half million lines of log file during an update.

I installed 11.4 just yesterday and this was my first update run, with only the 6 default openSUSE 11.4 repositories.  So this is typical behavior, not due to an unusual or large set of repositories.  Every openSUSE 11.4 packagekit user will see this behavior.

Hopefully, this is a debugging option that got left on by mistake and will easily turned off.

Like Moritz, I too was reminded of the bad old days of 10.2, because of the slowness and also for another reason: I had to stare at a grayed-out, disabled Cancel button the whole time!  Which, for something that runs up to an hour, I think is also a bug.
Comment 10 kolA flash 2011-05-21 13:47:04 UTC
On my PC it's also like Thomas told. Looks like packagekitd puts a lot of stuff into /var/log/pk_backend_zypp

Could this be fixed? It's really annoying me!
Comment 11 Tim Edwards 2011-06-13 15:17:01 UTC
Me too, this is a real pain. I've seen it happening on 3 different systems (a laptop, a netbook and a Virtualbox VM).
Comment 12 Duncan Mac-Vicar 2011-07-05 13:02:53 UTC
Output of
rpm -q --changelog PackageKit | head -n 25 

??
Comment 13 Forgotten User 10buyl7JnO 2011-07-05 13:12:47 UTC
ruchir@linux-2g0k:~> rpm -q --changelog PackageKit | head -n 25 
* Wed Jun 08 2011 fcrozat@suse.com
- Add Only-include-glib-unix.h-if-the-GLib-version-is-2.29.patch:
  fix build with recent glib.

* Fri May 20 2011 meissner@suse.de
- fixed build with older gtk2.

* Mon May 09 2011 dmacvicar@suse.de
- Add patches:
  + Add PackageKit backend function name in logging
    (pk_backend_log):
    0001-zypp-log-to-ZYpp-s-log-the-start-of-a-PK-backend-fun.patch
  + Fix for lost package locks (bnc#690038):
    0002-zypp-fix-deletion-of-package-locks-bnc-690038.patch

* Fri May 06 2011 vuntz@opensuse.org
- Update to version 0.6.14:
  + Lots of nice bugfixes in this release, along with slight
    changes to the SetProxy() and DownloadPackages() D-Bus API. If
    you're using either packagekit-glib or packagekit-qt then
    there's no change required as the libraries have symbol
    fallbacks.
  + The packageKit-qt2 library has been committed. It is eventually
    aiming to replace packagekit-qt.
  + New Features:
Comment 14 Tim Edwards 2011-07-05 13:17:08 UTC
rpm -q --changelog PackageKit | head -n 25 
* Fri May 20 2011 meissner@suse.de
- fixed build with older gtk2.

* Mon May 09 2011 dmacvicar@suse.de
- Add patches:
  + Add PackageKit backend function name in logging
    (pk_backend_log):
    0001-zypp-log-to-ZYpp-s-log-the-start-of-a-PK-backend-fun.patch
  + Fix for lost package locks (bnc#690038):
    0002-zypp-fix-deletion-of-package-locks-bnc-690038.patch

* Fri May 06 2011 vuntz@opensuse.org
- Update to version 0.6.14:
  + Lots of nice bugfixes in this release, along with slight
    changes to the SetProxy() and DownloadPackages() D-Bus API. If
    you're using either packagekit-glib or packagekit-qt then
    there's no change required as the libraries have symbol
    fallbacks.
  + The packageKit-qt2 library has been committed. It is eventually
    aiming to replace packagekit-qt.
  + New Features:
  - Add a 'store_in_cache' attribute to the DownloadPackages
    method
  - Automatically cancel running background transactions if a
    foreground transaction is committed
Comment 15 Duncan Mac-Vicar 2011-07-23 01:40:45 UTC
Can you guys test with the package in home:dmacvicar:branches:openSUSE:11.4:Update/PackageKit ?
Comment 17 Duncan Mac-Vicar 2011-07-23 01:57:33 UTC
*** Bug 699441 has been marked as a duplicate of this bug. ***
Comment 18 Duncan Mac-Vicar 2011-07-23 01:58:13 UTC
*** Bug 664739 has been marked as a duplicate of this bug. ***
Comment 19 Duncan Mac-Vicar 2011-07-23 02:00:51 UTC
home:dmacvicar:branches:GNOME:Factory/PackageKit for GNOME3 users. But you need to build manually against GNOME:STABLE:3.0 as GNOME:Factory has 11.3 and Factory but no 11.4
Comment 20 Forgotten User 10buyl7JnO 2011-07-23 07:44:03 UTC
I couldn't locate packages in repo.
Comment 21 shishir verma 2011-07-23 07:53:15 UTC
I couldn't see the packages either. I presume that this is the place where I am supposed to look. 
http://download.opensuse.org/repositories/home:/dmacvicar

On a different note, I don't know if I should raise a bug for this but I find it interesting that when the update notifier in system tray turns green to show that there are updates available, clicking it pops up the kpackagekit window which does a refresh of package list. This takes time and does not serve any purpose given that the backend must have refreshed all repos and package lists.
Comment 22 Duncan Mac-Vicar 2011-07-23 09:36:45 UTC
I enabled publishing now. They should appear under

http://download.opensuse.org/repositories/home:/dmacvicar:/

Still you can get the rpms with osc

osc getbinaries home:dmacvicar:branches:openSUSE:11.4:Update PackageKit standard 
x86_64

For GNOME 3.0 you need to build them manually

osc co home:dmacvicar:branches:GNOME:Factory PackageKit
osc build --alternative-project GNOME:STABLE:3.0 openSUSE_11.4
Comment 23 Forgotten User 10buyl7JnO 2011-07-23 11:27:35 UTC
I just installed packages from repo but don't see improvement in speed. I noticed scanning installed apps step taking too long. Let me know if I can provide detailed debug information and how.
Comment 24 Duncan Mac-Vicar 2011-07-25 09:08:32 UTC
make sure packagekit gets restarted (or killall packagekitd as root)
Comment 25 Forgotten User 10buyl7JnO 2011-07-25 09:14:18 UTC
I rebooted system after updating packages.
Comment 26 Duncan Mac-Vicar 2011-07-26 08:56:33 UTC
Ok, I found another instance of the same problem. I will update the patch.
Comment 27 Duncan Mac-Vicar 2011-07-26 10:02:13 UTC
Can you please try again when the packages with this changelog entry (note the second part) gets built?

-------------------------------------------------------------------
Sat Jul 23 01:10:56 UTC 2011 - dmacvicar@suse.de

- Do not rebuild the pool on every call to find package by name
  causing slowness when getting the update list (bnc#679650)
- move patches to git, so they may appear differently in the spec
  file now

However, I don't see why getting the installed packages list should take more time, except for operations like getting the dependencies.

What get faster is the updates list, and then applying the updates. I stopped counting at 5 minutes without the patch. But it takes 20 seconds now.
Comment 28 Forgotten User 10buyl7JnO 2011-07-27 06:30:16 UTC
I'ts much faster now. First time takes ~20 seconds to render package list. Immediately clicking Check for updates again takes 1.5 mins max. Shouldn't that as well be faster considering there're no updates on repos?
Comment 29 Forgotten User 10buyl7JnO 2011-07-27 08:57:18 UTC
It is not consistent. I clicked update icon in systray after resuming laptop from suspend and it gets stuck in refreshing software list ( 18 seconds remaining).
Comment 30 Duncan Mac-Vicar 2011-07-27 10:29:50 UTC
Please attach your /var/log/pk_backend_zypp
Comment 31 Forgotten User 10buyl7JnO 2011-07-30 14:23:00 UTC
Created attachment 443322 [details]
pk_backend_zypp

This is a log from one run which took ~20 mins and then I had to kill process. I kept eye on log file by tail -f and it seems it is stuck in some kind of loop and doing operations repeatedly causing delays and not letting it to finish.
Comment 32 Duncan Mac-Vicar 2011-08-01 14:39:31 UTC
Ok, but that is exactly the loop that this patch fixes.

Now, I can't find the loop in your log, and your log starts at 19:50:29 and finishes at 19:50:36 which is in total 7 seconds
Comment 33 Forgotten User 10buyl7JnO 2011-08-01 16:24:24 UTC
I didn't notice time in log file but definitely I could see that crazy loop in tail -f. I think log file may be overwritten in each iteration so the log you see may be of that last iteration before I killed it. If you can disable log file rotation/rewrite, I can test again and provided updated file as I think I'll be able to reproduce.
Comment 34 David Martin 2011-10-07 05:33:20 UTC
Today I ran a pkcon refresh to completion from konsole. It took 44 minutes to run and created pk_backend_zypp 125.7 MB. By the way when pkcon ends pk_backend_zypp becomes 0 bytes as noted and pk_backend_zypp-1 becomes 125.7 MB. Does this program do a lot of searching? I have a copy of the pk_backend_zypp-1.
Comment 35 Duncan Mac-Vicar 2011-10-07 07:23:08 UTC
#comment 34 : David, I am interested in:

output of: rpm -q --changelog PackageKit | head -n 25 

Not sure if it is a good idea to post the full log. Is it too big compressed?

May be you can as well look for patterns in the log (ie: some block that is running in a loop)
Comment 36 David Martin 2011-10-07 08:16:14 UTC
Duncan, It compressed to 7.3 MB. I'll upload that if you want.

There is a lot of repetition for example a grep -i -n -c 'Novell Provo Build (Contact security@novell.com) <novell-provo-build@novell.com>) is already in rpm database' Documents/pk_backend_zypp-1        is 1128.

> rpm -q --changelog PackageKit | head -n 25
* Fri May 20 2011 meissner@suse.de
- fixed build with older gtk2.

* Mon May 09 2011 dmacvicar@suse.de
- Add patches:
  + Add PackageKit backend function name in logging
    (pk_backend_log):
    0001-zypp-log-to-ZYpp-s-log-the-start-of-a-PK-backend-fun.patch
  + Fix for lost package locks (bnc#690038):
    0002-zypp-fix-deletion-of-package-locks-bnc-690038.patch

* Fri May 06 2011 vuntz@opensuse.org
- Update to version 0.6.14:
  + Lots of nice bugfixes in this release, along with slight
    changes to the SetProxy() and DownloadPackages() D-Bus API. If
    you're using either packagekit-glib or packagekit-qt then
    there's no change required as the libraries have symbol
    fallbacks.
  + The packageKit-qt2 library has been committed. It is eventually
    aiming to replace packagekit-qt.
  + New Features:
  - Add a 'store_in_cache' attribute to the DownloadPackages
    method
  - Automatically cancel running background transactions if a
    foreground transaction is committed
Comment 37 Duncan Mac-Vicar 2011-10-07 10:54:10 UTC
Please updload it (compressed)
Comment 38 David Martin 2011-10-07 12:52:23 UTC
Created attachment 455066 [details]
requested file
Comment 39 David Martin 2011-10-07 13:21:37 UTC

Duncan,
When I issued a: grep 'Lockfile cleaned' pk_backend_zypp-1,  it returned 15
lines indicating 15 runs from March to the present. The first line: 2011-10-03
21:20:11 <1> vstr72npteq1m(8860) [zypp] ZYppFactory.cc(~ZYppGlobalLock):90
Lockfile cleaned. (8860) 

The last 2: 
2011-10-06 06:24:13 <1> vstr72npteq1m(8585) [zypp]
ZYppFactory.cc(~ZYppGlobalLock):90 Lockfile cleaned. (8585)
2011-10-06 23:12:19 <1> vstr72npteq1m(21499) [zypp]
ZYppFactory.cc(~ZYppGlobalLock):90 Lockfile cleaned. (21499)

Looks like pk_backend_zypp-1 is concatenated to pk_backend_zypp on each run. 

When I renamed pk_backend_zypp and pk_backend_zypp-1 the system on it's own
initiative created a new 0 byte pk_backend_zypp. I then ran pkcon refresh. It
took 12 minutes and produced a 46.1 MB file of 323724 lines and pk_backend_zypp
becomes pk_backend_zypp-1. 

I repeated the process an hour later with very similar results and no
concatenation. I failed to mention that the first 4 steps only take a second or
two.
Refreshing cache              [=========================]         
Waiting for authentication    [=========================]         
Starting                      [=========================]         
Refreshing software list      [=========================] 
Generating package lists      [========                 ] (35%)

This third run gives same results. What may be different is that back in March
I killed the packagekit apps and removed them from the startup because it would
take 30+ minutes to run. The packagekit window remains up with the green start
icon still enabled. Well I would click it and start the process over. So I
squashed it.
Comment 40 David Martin 2011-10-08 07:21:14 UTC
I realize now that pk_backend_zypp is a trace file.
Comment 41 Duncan Mac-Vicar 2011-10-10 13:08:00 UTC
Now I remember this bug. I remember fixing it and posting a call for testing in the openSUSE forums. I did not get much feedback.

Can you please try PackageKit package from http://download.opensuse.org/repositories/home:/dmacvicar:/branches:/openSUSE:/11.4:/Update/standard/

Make sure the last changelog entry is:

-------------------------------------------------------------------
Mon Oct 10 12:31:24 UTC 2011 - dmacvicar@suse.de

- backport fix for bnc#679650
  PackageKit looping initializing repos taking long time

And tell me how it works for you?
Comment 42 David Martin 2011-10-11 18:49:53 UTC
There are no packages in:http://download.opensuse.org/repositories/home:/dmacvicar:/branches:/openSUSE:/11.4:/Update/standard/. I have been trying out 12.1 milestone and a KDE live install of 12.1 beta1 and the pk_backend_zypp is only in 10s KB size when using the yast. Refresh times are a few seconds.
I created a test install of 11.4 to available partitions and after a few updates via the yast GUI the pk_backend_zypp is 2.8 MB. Then I did a pkcon refresh which took 59 minutes to complete and pk_backend_zypp became 91 MB.
Last change log is: 
PackageKit - Simple software installation management software

Fri 20 May 2011 08:00:00 AM EDT
meissner@suse.de
- fixed build with older gtk2.

I normally let the yast software repository decide when to refresh or I might do Zypper refresh which only takes a second or two. pkcon refresh seems to be a very different app.
Comment 43 Christian Boltz 2011-10-11 19:10:50 UTC
(In reply to comment #42)
> There are no packages in
>http://download.opensuse.org/repositories/home:/dmacvicar:/branches:/openSUSE:/11.4:/Update/standard/.

The usual problem: branches are not published by default.

Try
    osc getbinaries home:dmacvicar:branches:openSUSE:11.4:Update \
        PackageKit standard x86_64
(or i586 instead of x86_64 for 32bit packages)
Comment 44 David Martin 2011-10-12 12:05:04 UTC
reply to comments 42 and 43. Thank you Christian and Duncan.  This packagekit is the same as the one that yast updated to previously. A pkcon refresh done minutes ago took 9 minutes to run and the file is "33475992 Oct 12 06:31 pk_backend_zypp-1". The first run took 59 minutes to complete and pk_backend_zypp became 91 MB. This is consistent.
I would rather not speculate that anything is amiss except that when pkcon refresh is run for the first time, it seems a bit long. 
What I recall, and just did moments ago, is that a kpackagekit icon would appear on task bar indicating updates. After performing the updates the "Review and Update Software" box remains up. There is a "Check for new Updates" icon  just above an empty list box which if clicked invokes a gui version of pkcon refresh which runs for 10 to 60 minutes. Rule # 1234 if there is an icon people will click it and this "Check for new Updates" icon looks like it was meant to be clicked so that people would file bug reports. I have created rule # 1235: Do Not click the "Check for new Updates" icon.


> Try
>     osc getbinaries home:dmacvicar:branches:openSUSE:11.4:Update \
>         PackageKit standard x86_64
> (or i586 instead of x86_64 for 32bit packages)

# osc getbinaries home:dmacvicar:branches:openSUSE:11.4:Update/PackageKit standard x86_64
Creating binaries
PackageKit-0.6.14-0.3.1.x86_64.rpm                               100% |================================| 523 kB    00:01     
PackageKit-branding-upstream-0.6.14-0.3.1.noarch.rpm             100% |================================|  54 kB    00:00     
PackageKit-browser-plugin-0.6.14-0.3.1.x86_64.rpm                100% |================================|  67 kB    00:00     
PackageKit-devel-0.6.14-0.3.1.noarch.rpm                         100% |================================| 362 kB    00:01     
PackageKit-doc-0.6.14-0.3.1.noarch.rpm                           100% |================================| 5.4 MB    00:10     
PackageKit-gstreamer-plugin-0.6.14-0.3.1.x86_64.rpm              100% |================================|  56 kB    00:00     
PackageKit-gtk-module-0.6.14-0.3.1.x86_64.rpm                    100% |================================|  55 kB    00:00     
PackageKit-gtk3-module-0.6.14-0.3.1.x86_64.rpm                   100% |================================|  55 kB    00:00     
PackageKit-lang-0.6.14-0.3.1.noarch.rpm                          100% |================================| 250 kB    00:00     
libpackagekit-glib2-14-0.6.14-0.3.1.x86_64.rpm                   100% |================================| 159 kB    00:00     
libpackagekit-glib2-devel-0.6.14-0.3.1.x86_64.rpm                100% |================================|  95 kB    00:00     
libpackagekit-qt-devel-0.6.14-0.3.1.x86_64.rpm                   100% |================================|  63 kB    00:00     
libpackagekit-qt14-0.6.14-0.3.1.x86_64.rpm                       100% |================================| 132 kB    00:00     
libpackagekit-qt2-2-0.6.14-0.3.1.x86_64.rpm                      100% |================================| 125 kB    00:00     
libpackagekit-qt2-devel-0.6.14-0.3.1.x86_64.rpm                  100% |================================|  62 kB    00:00     
:/home/xenius # rpm -q --changelog PackageKit | head -n 25
* Fri May 20 2011 meissner@suse.de
- fixed build with older gtk2.

* Mon May 09 2011 dmacvicar@suse.de
- Add patches:
  + Add PackageKit backend function name in logging
    (pk_backend_log):
    0001-zypp-log-to-ZYpp-s-log-the-start-of-a-PK-backend-fun.patch
  + Fix for lost package locks (bnc#690038):                                                                                                                     
    0002-zypp-fix-deletion-of-package-locks-bnc-690038.patch
Comment 45 Duncan Mac-Vicar 2011-10-12 13:11:13 UTC
David, after you did the osc getbinaries, did you actually install the Packages?

I do get the package with the changes. So please install the package you will download into binaries/ :

zypper in -f binaries/PackageKit-0.6.14-0.3.1.x86_64.rpm

then killall packagekitd 

to make sure it is reloaded.

What do I get:

dmacvicar@piscola:/tmp/bug> osc getbinaries home:dmacvicar:branches:openSUSE:11.4:Update/PackageKit standard x86_64
Creating binaries
PackageKit-0.6.14-0.3.1.x86_64.rpm                   100% |==========================| 523 kB    00:00     
PackageKit-branding-upstream-0.6.14-0.3.1.noarch.rpm 100% |==========================|  54 kB    00:00     
PackageKit-browser-plugin-0.6.14-0.3.1.x86_64.rpm    100% |==========================|  67 kB    00:00     
PackageKit-devel-0.6.14-0.3.1.noarch.rpm             100% |==========================| 362 kB    00:00     
PackageKit-doc-0.6.14-0.3.1.noarch.rpm               100% |==========================| 5.4 MB    00:00     
PackageKit-gstreamer-plugin-0.6.14-0.3.1.x86_64.rpm  100% |==========================|  56 kB    00:00     
PackageKit-gtk-module-0.6.14-0.3.1.x86_64.rpm        100% |==========================|  55 kB    00:00     
PackageKit-gtk3-module-0.6.14-0.3.1.x86_64.rpm       100% |==========================|  55 kB    00:00     
PackageKit-lang-0.6.14-0.3.1.noarch.rpm              100% |==========================| 250 kB    00:00     
libpackagekit-glib2-14-0.6.14-0.3.1.x86_64.rpm       100% |==========================| 159 kB    00:00     
libpackagekit-glib2-devel-0.6.14-0.3.1.x86_64.rpm    100% |==========================|  95 kB    00:00     
libpackagekit-qt-devel-0.6.14-0.3.1.x86_64.rpm       100% |==========================|  63 kB    00:00     
libpackagekit-qt14-0.6.14-0.3.1.x86_64.rpm           100% |==========================| 132 kB    00:00     
libpackagekit-qt2-2-0.6.14-0.3.1.x86_64.rpm          100% |==========================| 125 kB    00:00     
libpackagekit-qt2-devel-0.6.14-0.3.1.x86_64.rpm      100% |==========================|  62 kB    00:00     
dmacvicar@piscola:/tmp/bug> rpm -qp --changelog PackageKit-0.6.14-0.3.1.x86_64.rpm | head
error: open of PackageKit-0.6.14-0.3.1.x86_64.rpm failed: No such file or directory
dmacvicar@piscola:/tmp/bug> rpm -qp --changelog binaries/PackageKit-0.6.14-0.3.1.x86_64.rpm | head
* Mon Oct 10 2011 dmacvicar@suse.de
- backport fix for bnc#679650
  PackageKit looping initializing repos taking long time

* Wed Jun 01 2011 dmacvicar@suse.de
- Patch for
  https://bugs.meego.com/show_bug.cgi?id=17596
- Fixes crash when dealing with local rpms with simple names
  (name.rpm instead of name-x.y.arch.rpm)
Comment 46 David Martin 2011-10-13 16:42:27 UTC
reply to comment 45:
Duncan, I get the same.
:/tmp # osc getbinaries home:dmacvicar:branches:openSUSE:11.4:Update/PackageKit standard x86_64
Creating binaries
PackageKit-0.6.14-0.3.1.x86_64.rpm                               100% |================================| 523 kB    00:01     
PackageKit-branding-upstream-0.6.14-0.3.1.noarch.rpm             100% |================================|  54 kB    00:00     
PackageKit-browser-plugin-0.6.14-0.3.1.x86_64.rpm                100% |================================|  67 kB    00:00     
PackageKit-devel-0.6.14-0.3.1.noarch.rpm                         100% |================================| 362 kB    00:01     
PackageKit-doc-0.6.14-0.3.1.noarch.rpm                           100% |================================| 5.4 MB    00:08     
PackageKit-gstreamer-plugin-0.6.14-0.3.1.x86_64.rpm              100% |================================|  56 kB    00:00     
PackageKit-gtk-module-0.6.14-0.3.1.x86_64.rpm                    100% |================================|  55 kB    00:00     
PackageKit-gtk3-module-0.6.14-0.3.1.x86_64.rpm                   100% |================================|  55 kB    00:00     
PackageKit-lang-0.6.14-0.3.1.noarch.rpm                          100% |================================| 250 kB    00:00     
libpackagekit-glib2-14-0.6.14-0.3.1.x86_64.rpm                   100% |================================| 159 kB    00:00     
libpackagekit-glib2-devel-0.6.14-0.3.1.x86_64.rpm                100% |================================|  95 kB    00:00     
libpackagekit-qt-devel-0.6.14-0.3.1.x86_64.rpm                   100% |================================|  63 kB    00:00     
libpackagekit-qt14-0.6.14-0.3.1.x86_64.rpm                       100% |================================| 132 kB    00:00     
libpackagekit-qt2-2-0.6.14-0.3.1.x86_64.rpm                      100% |================================| 125 kB    00:00     
libpackagekit-qt2-devel-0.6.14-0.3.1.x86_64.rpm                  100% |================================|  62 kB    00:00

This time I 
zypper in -f binaries/PackageKit-0.6.14-0.3.1.x86_64.rpm and verified in Yast -> Software management then killall packagekitd.


  # rpm -q --changelog PackageKit | head -n 25
* Mon Oct 10 2011 dmacvicar@suse.de
- backport fix for bnc#679650
  PackageKit looping initializing repos taking long time

* Wed Jun 01 2011 dmacvicar@suse.de
- Patch for
  https://bugs.meego.com/show_bug.cgi?id=17596
- Fixes crash when dealing with local rpms with simple names
  (name.rpm instead of name-x.y.arch.rpm)  ...


pkcon refresh took 9 minutes and pk_backend_zypp becomes 27.4 MB.
Comment 47 Duncan Mac-Vicar 2011-10-14 09:25:03 UTC
Ok David. I would be interested in this new pk_backend_zypp log
Comment 48 Forgotten User 10buyl7JnO 2011-10-14 10:21:27 UTC
Created attachment 456594 [details]
pk_backend_zypp log.

For me also it took too long and file became 37M.
Comment 49 David Martin 2011-10-14 13:10:21 UTC
Created attachment 456652 [details]
pk_backend_zypp-1  PackageKit-0.6.14-0.3.1.x86_64
Comment 50 David Martin 2011-10-14 13:18:36 UTC
Created attachment 456654 [details]
shap shot of system load of 'Generating package lists' process

Graphs on default 0.5 second refresh.
Comment 51 Duncan Mac-Vicar 2011-10-19 11:19:49 UTC
Ok, I found the reason.

PackageKit builds an application index after refresh. This uses the search function of the backend, which does a check for refresh.

I added a workaround. I would be interested in feedback not only with the speed but also with the behavior. This reduces the log from 17M to 400k here.

I need to investigate how to fix it properly in Factory.

For 11.4. Same repo, use osc getbinaries. Last entry:

-------------------------------------------------------------------
Wed Oct 19 11:15:18 UTC 2011 - dmacvicar@suse.de

- backport fix for bnc#679649
  added workaround for package search functions
  PackageKit looping initializing repos taking long time
Comment 52 Forgotten User 10buyl7JnO 2011-10-20 06:58:43 UTC
Created attachment 457719 [details]
Software update shows weird listing.

I installed just PackageKit-0.6.14-0.4.1.x86_64.rpm (not other pkgs received in get binaries). Let me know if that's fine or have to install all rpms.

ruchir@linux-2g0k:~> rpm -q PackageKit --changelog|head
* Wed Oct 19 2011 dmacvicar@suse.de
- backport fix for bnc#679649
  added workaround for package search functions
  PackageKit looping initializing repos taking long time


ruchir@linux-2g0k:~> sudo pkcon refresh
Refreshing cache              [=========================]         
Waiting for authentication    [=========================]         
Starting                      [=========================]         
Refreshing software list      [=========================]         
Downloading packages          [=========================]         
Generating package lists      [=========================]         
Scanning applications         [                   ==    ]         The daemon crashed mid-transaction!

Then tried to check in software update output of which is attached.
Comment 53 David Martin 2011-10-20 19:44:56 UTC
Duncan, Sorry I took so long. My results seem OK. Pkcon refresh took a minute and: -rw-r----- 1 root root 570266 Oct 20 14:58 /var/log/pk_backend_zypp

the system monitor showed only 4 I/O blips and a more concentrated CPU usage.

/home/xenius # killall packagekitd
/home/xenius # rpm -q --changelog PackageKit | head -n 25
* Wed Oct 19 2011 dmacvicar@suse.de
- backport fix for bnc#679649
  added workaround for package search functions
  PackageKit looping initializing repos taking long time

* Wed Jun 01 2011 dmacvicar@suse.de
- Patch for
  https://bugs.meego.com/show_bug.cgi?id=17596
- Fixes crash when dealing with local rpms with simple names
  (name.rpm instead of name-x.y.arch.rpm)

* Fri May 20 2011 meissner@suse.de  ...

/home/xenius # pkcon refresh
Refreshing cache              [=========================]         
Waiting for authentication    [=========================]         
Starting                      [=========================]         
Refreshing software list      [=========================]         
Downloading packages          [=========================]         
Generating package lists      [=========================]         
/home/xenius # 
/home/xenius # ls -l /var/log/pk_backend_*
-rw-r----- 1 root root 570266 Oct 20 14:58 /var/log/pk_backend_zypp

/home/xenius # zypper info PackageKit
Loading repository data...
Reading installed packages...


Information for package PackageKit:

Repository: @System
Name: PackageKit
Version: 0.6.14-0.4.1
Arch: x86_64
Vendor: obs://build.opensuse.org/home:dmacvicar
Installed: Yes
Status: up-to-date
Installed Size: 2.1 MiB
Summary: Simple software installation management software
Description: 
PackageKit is a system designed to make installing and updating ...
Comment 54 Duncan Mac-Vicar 2011-10-25 13:44:45 UTC
Thanks for the feedback. I am now only worried about comment #52 where there is a crash in the middle of building the application list.
Comment 55 Marcus Meissner 2011-10-30 14:56:29 UTC
i tried, the building package list is much farther.

no crash on pkcon refresh for me
Comment 56 Duncan Mac-Vicar 2011-11-03 01:14:31 UTC
Ok, lets then include with the rest of the packagemanagement update for 11.4.

I hope I can include this fix in Factory.
Comment 57 Swamp Workflow Management 2011-11-04 11:10:52 UTC
The SWAMPID for this issue is 43987.
This issue was rated as moderate.
Please submit fixed packages until 2011-11-18.
Also create a patchinfo file using this link:
https://swamp.suse.de/webswamp/wf/43987
Comment 58 Benjamin Brunner 2011-11-04 11:11:20 UTC
After Marcus already tested the patch, I will start an update for 11.4. Duncan could you submit the fixes and a patchinfo to openSUSE:11.4:Update:Test please.
Comment 59 David Martin 2011-11-07 10:33:12 UTC
Hello all, performed zypper up on 12.1 with factory/repo/oss. After reboot the upgraded packagekit ran on it's own accord in less than a minute.
-rw-r----- 1 root root   2366469 Nov  7 05:13 pk_backend_zypp
-rw-r----- 1 root root  26704551 Nov  7 02:50 pk_backend_zypp-1

 A pkcon refresh issued 8 minutes later took 10-15 seconds.
-rw-r----- 1 root root   3049911 Nov  7 05:21 pk_backend_zypp
-rw-r----- 1 root root  26704551 Nov  7 02:50 pk_backend_zypp-1
Comment 60 Duncan Mac-Vicar 2011-11-07 10:37:55 UTC
created request id 90226
Comment 61 Will Stephenson 2011-11-16 11:42:33 UTC
This is published for 12.1 as patch openSUSE-2011-3, right?  The patchinfo doesn't show the bug numbers.
Comment 62 Marcus Meissner 2011-11-23 16:34:19 UTC
Yes it seems to be in the update repo.
Comment 63 Will Stephenson 2011-11-24 09:11:14 UTC
*** Bug 728612 has been marked as a duplicate of this bug. ***
Comment 64 David Martin 2011-12-03 01:04:29 UTC
Created attachment 465731 [details]
screenshot of packagekit as shown in yast2 online update or software management
Comment 65 David Martin 2011-12-03 01:17:42 UTC
Hello,
I see that package kit is updated for 12.1 but not for 11.4 via the usual methods.
change log from yast2 software management:


PackageKit - Simple software installation management software

Fri 20 May 2011 08:00:00 AM EDT
meissner@suse.de
- fixed build with older gtk2.
Mon 09 May 2011 08:00:00 AM EDT
dmacvicar@suse.de
- Add patches:
  + Add PackageKit backend function name in logging
    (pk_backend_log):
    0001-zypp-log-to-ZYpp-s-log-the-start-of-a-PK-backend-fun.patch
  + Fix for lost package locks (bnc#690038):
    0002-zypp-fix-deletion-of-package-locks-bnc-690038.patch
Fri 06 May 2011 08:00:00 AM EDT
vuntz@opensuse.org
- Update to version 0.6.14:
  + Lots of nice bugfixes in this release, along with slight ...

I have included an attachment of a screenshot showing all packagekits.
Comment 66 Bernhard Wiedemann 2011-12-06 16:00:09 UTC
This is an autogenerated message for OBS integration:
This bug (679650) was mentioned in
https://build.opensuse.org/request/show/95589 11.4 / PackageKit
Comment 67 Duncan Mac-Vicar 2011-12-06 17:15:30 UTC
My request 90226 was rejected. Dirk resubmitted as https://build.opensuse.org/request/show/95589 for 11.4
Comment 68 Swamp Workflow Management 2011-12-08 16:36:47 UTC
Update released for: PackageKit, PackageKit-branding-upstream, PackageKit-browser-plugin, PackageKit-browser-plugin-debuginfo, PackageKit-debuginfo, PackageKit-debugsource, PackageKit-devel, PackageKit-doc, PackageKit-gstreamer-plugin, PackageKit-gstreamer-plugin-debuginfo, PackageKit-gtk-module, PackageKit-gtk-module-debuginfo, PackageKit-gtk3-module, PackageKit-gtk3-module-debuginfo, PackageKit-lang, libpackagekit-glib2-14, libpackagekit-glib2-14-debuginfo, libpackagekit-glib2-devel, libpackagekit-qt-devel, libpackagekit-qt14, libpackagekit-qt14-debuginfo, libpackagekit-qt2-2, libpackagekit-qt2-2-debuginfo, libpackagekit-qt2-devel, libzypp, libzypp-debuginfo, libzypp-debugsource, libzypp-devel
Products:
openSUSE 11.4 (debug, i586, x86_64)
Comment 69 Duncan Mac-Vicar 2011-12-20 14:57:57 UTC
Closing as update is out