Bug 314256

Summary: accepting EULA in apper causes strange behaviour
Product: [Applications] apper Reporter: Raymond Wooninck <tittiatcoke>
Component: generalAssignee: Daniel Nicoletti <dantti12>
Severity: critical    
Priority: NOR    
Version: 0.8.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: pkmon log

Description Raymond Wooninck 2013-02-01 16:42:50 UTC
When apper has to accept an EULA, it calls into the packagekit backend to
accept the EULA, but afterwards goes back checking updates - which will be
blocked by installing updates in the backend. This causes Apper to hang for a long time.

At this moment this might be a ship_stopper for openSUSE 12.3. I assume the fix might be quite easy. 

Reproducible: Always
Comment 1 Daniel Nicoletti 2013-02-01 17:26:08 UTC
Would you mind sending a pkmon log and/or packagekitd --verbose
Comment 2 Raymond Wooninck 2013-02-01 18:46:41 UTC
Hi Dantti, 

As soon as I have the opportunity I will add the required logfiles to it. At this moment I do not have an update that requires accepting the EULA, but I am expecting one this weekend. 

However if I look in the KDE notification area, then I see that two Apper jobs are running. The first one is the one that triggered the request to accept the EULA and there is second one that is trying to check for new updates. Of course based on the locks that the zypp backend is placing, the second one is blocked and the first one is waiting for a signal to continue. If I know stop the second job in the notification area, then the first one continues to run and the packages are installed successfully. 

So it seems indeed as if the requeue  is adding a second job in the queue and starts waiting for this second one to finish, instead of continueing with the first one.
Comment 3 Raymond Wooninck 2013-02-10 10:27:17 UTC
Created attachment 77086 [details]
pkmon log
Comment 4 Raymond Wooninck 2013-02-10 10:29:19 UTC
Hi Dantti,

I managed to get the EULA stuff again and have attached the pkmon logfile.  Hope that this one helps to detect what is going on. Based on the logfile it seems as if after the acceptance of the EULA the whole PackageKit DB is being rebuild.
Comment 5 Daniel Nicoletti 2013-02-15 18:32:10 UTC
sorry for the late reply, from your log there is no bug in apper,
actually everything seems fine.
last time I used zypper it refreshed the cache before each operation, maybe accepting an EULA makes it to force a refresh cache before you update.

Also from your description the only problem is that it takes long, but works right?
Comment 6 Daniel Nicoletti 2013-02-15 18:34:27 UTC
We also need to check if accepting EULA doesn't emit an updates changed (either PackageKit or backend can emit it, which would trigger a refresh-cache)...
Comment 7 Raymond Wooninck 2013-02-19 13:30:57 UTC
Hi Daniel,

I got the following reported in https://bugzilla.novell.com/show_bug.cgi?id=801703

apper(1154) PackageDetails::description:
apper(1154) PackageDetails::finished:
apper(1154) PackageDetails::finished: 3 3
apper(1154)/kio (KIOJob) KIO::SlaveInterface::dispatch: error  111  
apper(1154)/kio (KIOJob) KIO::TransferJob::slotFinished:
apper(1154)/kio (Scheduler) KIO::SchedulerPrivate::jobFinished:
KIO::TransferJob(0xabf3f0) KIO::Slave(0xb3f380)
apper(1154)/kio (Scheduler) KIO::SchedulerPrivate::cancelJob:
KIO::TransferJob(0xb19c10) KIO::Slave(0xb06900)
apper(1154)/kio (Scheduler) KIO::SchedulerPrivate::cancelJob: Scheduler:
killing slave  1370
apper(1154)/kio (Slave) KIO::Slave::kill: killing slave pid 1370 ( "file://" )
apper(1154)/kio (Scheduler) KIO::SchedulerPrivate::jobFinished:
KIO::TransferJob(0xb19c10) KIO::Slave(0xb06900)
apper(1154)/kutils (KCMultiDialog) KCMultiDialogPrivate::_k_clientChanged:
apper(1154)/kutils (KCMultiDialog) KCMultiDialogPrivate::_k_clientChanged:
Error, cannot create transaction proxy
QDBusError("org.freedesktop.DBus.Error.NameHasNoOwner", "Could not get owner of
name 'org.freedesktop.PackageKit': no such name") 
apper(1154) PkTransaction::isFinished: 2 11
apper(1154) PkTransaction::slotFinished: 1 11
apper(1154) PkTransaction::slotErrorCode: errorCode:  34 "You've to
agree/decline a license"
apper(1154) PkTransaction::slotFinished: 5 11
apper(1154) PkTransaction::slotFinished: finished KeyRequired or EulaRequired: 
apper(1154) PkTransaction::acceptEula: Accepting EULA "flash-player"
Error, cannot create transaction proxy
QDBusError("org.freedesktop.DBus.Error.NameHasNoOwner", "Could not get owner of
name 'org.freedesktop.PackageKit': no such name") 
apper(1154) PkTransaction::slotFinished: 1 24
apper(1154) PkTransaction::setExitStatus: 0
apper(1154)/kio (Slave) KIO::Slave::kill: killing slave pid 1371 (
"http://screenshots.debian.net" )

coolo@xanthippe#apper>Error, cannot create transaction proxy
QDBusError("org.freedesktop.DBus.Error.NameHasNoOwner", "Could not get owner of
name 'org.freedesktop.PackageKit': no such name") 
apper(1154) PackageDetails::setPackage:
QModelIndex(0,0,0x0,PackageModel(0x7c3b30) )
apper(1154) PackageDetails::setPackage: appId "" m_package
apper(1154) PackageDetails::setPackage: current screenshot
apper(1154) PackageDetails::actionActivated:
apper(1154) PackageDetails::actionActivated: New transaction
apper(1154) PackageDetails::actionActivated: transaction running

At this moment this would be SHIP_STOPPER for openSUSE 12.3
Comment 8 Daniel Nicoletti 2013-02-19 14:44:25 UTC
Git commit 3783c2d23214e078ce9188eea5b56a1d0d0f1fe4 by Daniel Nicoletti.
Committed on 19/02/2013 at 15:43.
Pushed by dantti into branch 'master'.

Make sure we don't exit the transaction after accepting the EULA

M  +4    -2    libapper/PkTransaction.cpp