Bug 637761

Summary: Yast2 GTK package selection does not resolve dependencies [During upgrade zypper removes packages before downloading newer versions]
Product: [openSUSE] openSUSE 11.3 Reporter: Max Breev <knuckster>
Component: GNOMEAssignee: Forgotten User h13THG8RK1 <forgotten_h13THG8RK1>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Critical    
Priority: P5 - None CC: badshah400, forgotten_h13THG8RK1
Version: Final   
Target Milestone: ---   
Hardware: All   
OS: openSUSE 11.3   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: y2logs

Description Max Breev 2010-09-08 08:38:19 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; ru; rv:1.9.2.8) Gecko/20100723 SUSE/3.6.8-1.3 Firefox/3.6.8

Sometimes during update process zypper (v1.4.5) removes some of the installed packages even before downloading a newer version. My /etc/zypper/zypp.conf is at default configuration.
Yesterday I tried to update few packages, among those were sysconfig, firefox and yast. I used yast software update module (gtk version). It does not affect zypper, right? Zypper removed those before downloading newer versions. Due to a temporary network connection loss zypper could not download packages and quit leaving me without firefox, without yast and, what's even worse, without sysconfig package which contains essential system scripts such as ifup, ifdown etc (so my network went down completely without a possibility to restore). It's a big luck there was no new package of rpm (or it would be removed by zypper too) so I could just download those packages with my second PC and reinstall them from a memory stick.
I posted this problem here http://forums.opensuse.org/english/get-help-here/applications/445841-critical-zypper-bug.html?pagenumber=
People there said there is an option in zypp.cong that makes zypper download everything before upgrading. But it must not remove packages that are to be upgraded anyway. This is not how update should be done.

Reproducible: Always

Steps to Reproduce:
1. Start yast software management module
2. Select packages to update
3. Start update
Actual Results:  
Sometimes during update process zypper (v1.4.5) removes some of the installed packages even before downloading a newer version.

Expected Results:  
Zypper must not remove packages that are to be updated at any circumstances. Ideally downloading process should run in parallel to updating.
Comment 1 Max Breev 2010-09-08 08:41:34 UTC
It's not allways reproducible. Sorry, I missed that field.
Comment 2 Michael Andres 2010-09-08 11:16:50 UTC
Please attach the zypper logfile /var/log/zypper.log (or an older /var/log/zypper.log-YYYYMMDD.bz2) that shows the reported behavior.

---
The zypp.conf option is commit.downloadMode:
 ## Commit download policy to use as default.
 ...
 ##  DownloadInHeaps,    Similar to DownloadInAdvance, but try to split
 ##                      the transaction into heaps, where at the end of
 ##                      each heap a consistent system state is reached.
 ...
 commit.downloadMode = DownloadInHeaps
Comment 3 Max Breev 2010-09-08 18:46:55 UTC
(In reply to comment #2)
> Please attach the zypper logfile /var/log/zypper.log (or an older
> /var/log/zypper.log-YYYYMMDD.bz2) that shows the reported behavior.

Hmmm. The last message in /var/log/zypper.log is this:
2010-08-28 21:23:27 <1> knuckles(22467) [zypp] ZYppFactory.cc(~ZYppGlobalLock):90 Lockfile cleaned. (22467)

I don't think this is usefull. Here's a part from /var/log/zypp/history that corresponds to the described time period:
2010-09-07 23:11:57|remove |MozillaFirefox-translations-common|3.6.8-1.3|x86_64|
# 2010-09-07 23:11:59 MozillaFirefox-3.6.8-1.3.x86_64 removed ok
# Additional rpm output:
# Warning in file "/usr/share/applications/easytag.desktop": usage of MIME type "x-directory/normal" is discouraged ("x-directory" is an old media type that should be replaced with a modern equivalent)
# Warning in file "/usr/share/applications/nautilus-folder-handler.desktop": usage of MIME type "x-directory/gnome-default-handler" is discouraged ("x-directory" is an old media type that should be replaced with a modern equivalent)
# Warning in file "/usr/share/applications/nautilus-folder-handler.desktop": usage of MIME type "x-directory/normal" is discouraged ("x-directory" is an old media type that should be replaced with a modern equivalent)
# Warning in file "/usr/share/applications/pcmanfm.desktop": usage of MIME type "x-directory/normal" is discouraged ("x-directory" is an old media type that should be replaced with a modern equivalent)
# 
2010-09-07 23:11:59|remove |MozillaFirefox|3.6.8-1.3|x86_64|
2010-09-07 23:11:59|remove |MozillaFirefox-branding-upstream|3.6.8-1.3|x86_64|
2010-09-07 23:11:59|remove |MozillaThunderbird-translations-common|3.1.2-1.2|x86_64|
2010-09-07 23:12:02|remove |MozillaThunderbird|3.1.2-1.2|x86_64|
2010-09-07 23:12:02|remove |mozilla-xulrunner192-gnome|1.9.2.8-3.1|x86_64|
2010-09-07 23:12:02|remove |mozilla-xulrunner192-translations-common|1.9.2.8-3.1|x86_64|
2010-09-07 23:12:03|remove |mozilla-xulrunner192|1.9.2.8-3.1|x86_64|
2010-09-07 23:12:03|remove |mozilla-js192|1.9.2.8-3.1|x86_64|
# 2010-09-07 23:12:07 sysconfig-0.73.7-1.2.x86_64 removed ok
# Additional rpm output:
#               No configuration found for vboxnet0 
#               Nevertheless the interface will be shut down.
# warning: /etc/modprobe.d/50-ipv6.conf saved as /etc/modprobe.d/50-ipv6.conf.rpmsave
# 
2010-09-07 23:12:07|remove |sysconfig|0.73.7-1.2|x86_64|
2010-09-07 23:12:08|remove |yast2-country|2.19.17-1.4|x86_64|
2010-09-07 23:12:08|remove |yast2-core|2.19.2-3.1|x86_64|
2010-09-07 23:12:09|remove |yast2-country-data|2.19.17-1.4|x86_64|
Comment 4 Michael Andres 2010-09-09 11:06:17 UTC
The history shows removal of those packages, but no install! So if this snippet was complete, these packages were not scheduled for an update.

Anyway, I probably missread your description. Actually you did not use zypper (the commandline tool) but yast (the gui). Thus I'd need the yast logfiles (see http://en.opensuse.org/openSUSE:Bugreport_YaST).
Comment 5 Max Breev 2010-09-09 12:35:53 UTC
(In reply to comment #4)
> The history shows removal of those packages, but no install!
Yes! Because of the network error.
>So if this snippet was complete, these packages were not scheduled for an update.
It's after that there are some messages corresponding to my next update attemp after I restored removed packages manually. 

> Anyway, I probably missread your description. Actually you did not use zypper
> (the commandline tool) but yast (the gui). Thus I'd need the yast logfiles (see
> http://en.opensuse.org/openSUSE:Bugreport_YaST).
Will provide a bit later.
Comment 6 Max Breev 2010-09-11 11:47:46 UTC
Created attachment 388963 [details]
y2logs

Here's the archive file with logs. The interesting parts begins approximately at:
2010-09-07 23:11:55 <1> knuckles(12194) [YCP] PackageInstallation.ycp:142 Calling PkgCommit (0)
2010-09-07 23:11:55 <1> knuckles(12194) [Pkg] PackageInstallation.ycp:143 Pkg Builtin called: PkgCommit
2010-09-07 23:11:55 <1> knuckles(12194) [zypp] ZYppImpl.cc(commit):130 Attempt to commit (CommitPolicy( DownloadAsNeeded syncPoolAfterCommit ))
2010-09-07 23:11:55 <1> knuckles(12194) [zypp] TargetImpl.cc(commit):926 TargetImpl::commit(<pool>, CommitPolicy( DownloadAsNeeded syncPoolAfterCommit ))
2010-09-07 23:11:55 <1> knuckles(12194) [zypp::GetResolvablesToInsDel] GetResolvablesToInsDel.cc(GetResolvablesToInsDel):104 ResolvablesToInsDel: delete 13, install 13, srcinstall 0
2010-09-07 23:11:55 <1> knuckles(12194) [zypp::GetResolvablesToInsDel] GetResolvablesToInsDel.cc(strip_obsoleted_to_delete):62 Undelayed deletes: {
2010-09-07 23:11:55 <1> knuckles(12194) [zypp::GetResolvablesToInsDel] GetResolvablesToInsDel.cc(strip_obsoleted_to_delete):62   I_Ts_(16)MozillaFirefox-3.6.8-1.3.x86_64(@System)
2010-09-07 23:11:55 <1> knuckles(12194) [zypp::GetResolvablesToInsDel] GetResolvablesToInsDel.cc(strip_obsoleted_to_delete):62   I_Ts_(17)MozillaFirefox-branding-upstream-3.6.8-1.3.x86_64(@System)
2010-09-07 23:11:55 <1> knuckles(12194) [zypp::GetResolvablesToInsDel] GetResolvablesToInsDel.cc(strip_obsoleted_to_delete):62   I_Ts_r(18)MozillaFirefox-translations-common-3.6.8-1.3.x86_64(@System)
2010-09-07 23:11:55 <1> knuckles(12194) [zypp::GetResolvablesToInsDel] GetResolvablesToInsDel.cc(strip_obsoleted_to_delete):62   I_Ts_(19)MozillaThunderbird-3.1.2-1.2.x86_64(@System)
2010-09-07 23:11:55 <1> knuckles(12194) [zypp::GetResolvablesToInsDel] GetResolvablesToInsDel.cc(strip_obsoleted_to_delete):62   I_Ts_r(20)MozillaThunderbird-translations-common-3.1.2-1.2.x86_64(@System)
2010-09-07 23:11:55 <1> knuckles(12194) [zypp::GetResolvablesToInsDel] GetResolvablesToInsDel.cc(strip_obsoleted_to_delete):62   I_Ts_(1232)mozilla-js192-1.9.2.8-3.1.x86_64(@System)
2010-09-07 23:11:55 <1> knuckles(12194) [zypp::GetResolvablesToInsDel] GetResolvablesToInsDel.cc(strip_obsoleted_to_delete):62   I_Ts_(1242)mozilla-xulrunner192-1.9.2.8-3.1.x86_64(@System)
2010-09-07 23:11:55 <1> knuckles(12194) [zypp::GetResolvablesToInsDel] GetResolvablesToInsDel.cc(strip_obsoleted_to_delete):62   I_Ts_r(1243)mozilla-xulrunner192-gnome-1.9.2.8-3.1.x86_64(@System)
2010-09-07 23:11:55 <1> knuckles(12194) [zypp::GetResolvablesToInsDel] GetResolvablesToInsDel.cc(strip_obsoleted_to_delete):62   I_Ts_r(1244)mozilla-xulrunner192-translations-common-1.9.2.8-3.1.x86_64(@System
)
2010-09-07 23:11:55 <1> knuckles(12194) [zypp::GetResolvablesToInsDel] GetResolvablesToInsDel.cc(strip_obsoleted_to_delete):62   I_Ts_(1578)sysconfig-0.73.7-1.2.x86_64(@System)
2010-09-07 23:11:55 <1> knuckles(12194) [zypp::GetResolvablesToInsDel] GetResolvablesToInsDel.cc(strip_obsoleted_to_delete):62   I_Ts_(1778)yast2-core-2.19.2-3.1.x86_64(@System)
2010-09-07 23:11:55 <1> knuckles(12194) [zypp::GetResolvablesToInsDel] GetResolvablesToInsDel.cc(strip_obsoleted_to_delete):62   I_Ts_(1779)yast2-country-2.19.17-1.4.x86_64(@System)
2010-09-07 23:11:55 <1> knuckles(12194) [zypp::GetResolvablesToInsDel] GetResolvablesToInsDel.cc(strip_obsoleted_to_delete):62   I_Ts_(1780)yast2-country-data-2.19.17-1.4.x86_64(@System)
2010-09-07 23:11:55 <1> knuckles(12194) [zypp::GetResolvablesToInsDel] GetResolvablesToInsDel.cc(strip_obsoleted_to_delete):62 }
Comment 7 Michael Andres 2010-09-13 11:28:38 UTC
To me it looks like the GTK UI does not resolve any dependencies when running the package selection. In the log for PID 12194 is just a single (taskless!?) solver run before the package selection is started :(

 $ grep 'runPkgSelection\|Calling SAT Solver' xx

 2010-09-07 23:11:16 <1> knuckles(12194) [zypp] Resolver.cc(solverInit):271 
   -------------- Calling SAT Solver -------------------

 2010-09-07 23:11:17 <1> knuckles(12194) [gtk] YGUI.cc(runPkgSelection):276 
   Running package selection...


The information whether a package is cleaned when installing some package or whether this must be done manually is derived from the solver. As GTK does not call the solver the info is missing and it appears like there's an explicit delete request (which is handled before any install).

It's IMO a bug in the GTK UI to allow running unsolved transactions.
Comment 8 Michael Schröder 2010-09-13 12:38:15 UTC
Did you turn autosolving off? The GTK code doesn't seem to do a "final" solver run if autosolving is disabled.
Comment 9 Forgotten User h13THG8RK1 2010-09-13 17:42:32 UTC
Yeah, a quick check in the qt plugin shows it does a final solver call, which the gtk plugin doesn't. This is a problem if the user has disabled "Dependencies > Autocheck", and didn't apply "Dependencies > Check Now".
Comment 10 Max Breev 2010-09-14 10:28:32 UTC
(In reply to comment #8)
> Did you turn autosolving off? The GTK code doesn't seem to do a "final" solver
> run if autosolving is disabled.
Right now autosolving is on and I don't remember to turn it off when all that happened. Though I'm not quite sure.
Anyway, does Yast itself manages packages? Isn't there some backend that must have prevent this situation?
Comment 11 Forgotten User h13THG8RK1 2010-09-14 11:13:24 UTC
(In reply to comment #10)
> Anyway, does Yast itself manages packages? Isn't there some backend that must
> have prevent this situation?

Yast (or the cmd-line zypper) tells libzypp to install this or remove that, and then is supposed to ask libzypp to check for any dependency problems. It does that after you modify the status of a package (when autosolving is on), otherwise on accept -- which the gtk plugin isn't doing, and it's possible this is what is causing your problem.

The qt, gtk and ncurses plugins generally perform very small tasks (e.g. create a button for me here), but, in the case of the software manager, a good portion of it is implemented at the UI plugin level.
Comment 12 Forgotten User h13THG8RK1 2010-10-03 22:21:11 UTC
Hi Max,

When autosolving = false, the gtk plugin should now make sure to always run the solver one last time on apply, just like the qt plugin.

It's not clear this was your problem however, so please make sure to install the latest yast2-gtk from the following website, and re-open this bug report if the software manager "pranks" you again.

https://build.opensuse.org/package/show?package=yast2-gtk&project=YaST%3AHead

(Choose openSUSE_11.3 or openSUSE_Factory, depending on your opensuse version. Then download either the *.i586.rpm  or *.x86_64.rpm, depending on your pc architecture.)
Comment 13 Max Breev 2010-10-04 20:54:09 UTC
(In reply to comment #12)
> make sure to install
> the latest yast2-gtk from the following website, and re-open this bug report if
> the software manager "pranks" you again.
> 
> https://build.opensuse.org/package/show?package=yast2-gtk&project=YaST%3AHead
> 

Hi, Ricardo.
Are you sure about the repository? It contains yast2-gtk-2.21.68. While there is yast2-gtk-2.21.70 in Updates repo (http://download.opensuse.org/update/11.3) already.
Comment 14 Forgotten User h13THG8RK1 2010-10-04 21:31:25 UTC
Well, yes. The thing is that in svn we have two branches: "trunk" and "SuSE-Linux-11_3-Branch". The build-service package I pointed you to is built from "trunk", while 11.3 Updates are built from the "11_3" branch. So, divergence of the version number is natural.

But I guess that the update applet will keep insisting you "upgrade" the package... Hold on a couple of days that I will synchronize the version numbers, and then will get back to you.
Comment 15 Forgotten User h13THG8RK1 2010-10-07 12:47:04 UTC
Alright, there you go:

https://build.opensuse.org/package/show?package=yast2-gtk&project=YaST%3AHead

--

If you do not use opensuse in English, please perform the following in order to fix the software manager translation:

cd /usr/share/YaST2/locale/de/LC_MESSAGES/
sudo mv yast2-gtk.mo gtk.mo

(notice locale/de is for German. locale/fr for French. etc)

Still, some strings will show up in English.