Bug 158179

Summary: rug verify fails with "Resolver failed"
Product: [openSUSE] SUSE Linux 10.1 Reporter: Andreas Jaeger <aj>
Component: ZenworksAssignee: Klaus Kämpf <kkaempf>
Status: VERIFIED FIXED QA Contact: Eric Waldow <ewaldow>
Severity: Critical    
Priority: P5 - None CC: heiko.rommel, suse-beta
Version: Beta 8   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Andreas Jaeger 2006-03-15 09:39:40 UTC
$ rug verify
ERROR: Resolver Failed

There are no logs written in this case.
Comment 1 Tambet Ingo 2006-03-15 15:45:44 UTC
That's all zmd gets from zypp. --> Klaus.
Comment 2 Klaus Kämpf 2006-03-15 22:18:09 UTC
No logs ??
There must be at least a /var/log/zmd-backend.log.
Please provide this file as an attachment.
Comment 3 Mauro Parra Miranda 2006-03-15 23:37:35 UTC
Actually, it's weird, but you don't get anythign in both logs (zmd-backend.log or zmd-messages.log). I tried this on SLES 10 beta 7 X86_64 
Comment 4 Klaus Kämpf 2006-03-16 00:47:30 UTC
Huh ? The first thing a libzypp-zmd-backend helper does after being started is writing a log line with its name and all its arguments.
If this isn't in the zmd-backend.log, the helper is not called at all.

And no entry in zmd-messages.log also looks suspicious ...

Naresh, please analyze
Comment 5 Rian Hunter 2006-03-22 16:59:30 UTC
This is the same bug as #153499.

I investigated the possibility that the resolve-depedencies helper wasn't being called. I replaced resolve-dependencies with a shell script:

----
#!/bin/sh

echo $@ > /tmp/iwascalled

/usr/lib64/zmd/resolve-dependencies2 $@
------

and renamed resolve-dependencies to resolve-dependencies 2, obviously.

Then i ran "rug verify"

$ rug verify
> blah blahb lah
> blah blahb lah
> ERROR: Resolver Failed

$ cat /tmp/iwascalled
> /var/lib/zmd/zmd.db 1

$ rpm -q libzypp libzypp-zmd-backend rug zmd
> libzypp-0.0.8-49
> libzypp-zmd-backend-7.1.1-10
> rug-7.1.1-13
> zmd-7.1.1-24

So I conclude that resolve-dependencies is in fact being called. As for why zmd-backend.log isn't being written is still a mystery to me. I would have to look at the libzypp code, and do some other tests.
Comment 6 Rian Hunter 2006-03-22 16:59:53 UTC
*** Bug 153499 has been marked as a duplicate of this bug. ***
Comment 7 Klaus Kämpf 2006-03-22 17:06:46 UTC
Please provide the zmd.db at the point resolve-dependencies is called.
Comment 8 Rian Hunter 2006-03-22 19:11:31 UTC
you can download my zmd.db (just before resolve-dependencies is called) here:
http://web.mit.edu/rian/www/zmd.db
Comment 9 Klaus Kämpf 2006-03-22 23:47:32 UTC
This zmd.db has an empty transactions table. So there is nothing to install, delete or resolve.
Comment 10 Rian Hunter 2006-03-23 05:15:28 UTC
Digging through the VerifyCommand class in PackageCommands in rug/src and RemotePackageManager.cs in zmd/modules/linux it seems that the resolve-dependencies helper is called blindly (whatever the state of the transaction  table is in). From that, I think if there is nothing to do then resolve-dependencies shouldn't fail (i.e. return zero) instead of returning 1.

Also I tried running:

$ /usr/lib/zmd/resolve-dependencies /var/lib/zmd/zmd.db 1
[Usage error]

$ /usr/lib/zmd/resolve-dependencies /var/lib/zmd/zmd.db
[ no output but, echo $? gives "1" ]

Since zmd calls resolve-dependencies with the 1 (the verify argument) it might be getting that usage error. If not, its still receiving "1" for the return value, which would cause rug to print out this "Resolver failed"
Comment 11 Klaus Kämpf 2006-03-23 15:29:46 UTC
Thanks for investigating. Fixed in rev 2636
resolve-dependencies now returns 0 if no transactions were pending.
Comment 12 Klaus Kämpf 2006-03-24 16:19:37 UTC
*** Bug 160551 has been marked as a duplicate of this bug. ***