Bug 395130

Summary: not having a DVD in tray breaks zypper
Product: [openSUSE] openSUSE 11.0 Reporter: Stephan Kulow <coolo>
Component: libzyppAssignee: Matthias Koenig <mkoenig>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Critical    
Priority: P5 - None CC: vuntz
Version: RC 1Flags: coolo: SHIP_STOPPER-
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Stephan Kulow 2008-05-28 16:14:51 UTC
If you eject the DVD, you get a fatal error that there is no medium in cd:///?devices=/dev/sr0

It used to (and should do) disable the repo due to errors and get the packages from another repo.
Comment 1 Jan Kupec 2008-05-28 18:09:28 UTC
When did you eject the DVD? before invoking zypper?

I remember a similar bug, when zypper asked for another CD, you inserted it and hit enter to continue, and zypper immediately complained. That seemed to be a problem of mount.
Comment 2 Stephan Kulow 2008-05-28 18:40:29 UTC
before invoking zypper, yes.  I thought it's possibly because it's registered as autorefresh=no, but that's not the problem. With autorefresh=yes it will fail with a/i/c already during refreshing repos.
Comment 3 Stephan Kulow 2008-05-29 05:35:02 UTC
this is pretty ugly as people will have to enable and disable the DVD repo all the time on their own, but it might not be _that_ critical.
Comment 4 Stephan Kulow 2008-05-29 08:12:42 UTC
*** Bug 395327 has been marked as a duplicate of this bug. ***
Comment 5 Stephan Kulow 2008-05-29 08:13:18 UTC
395327 shows that it's a generic problem.
Comment 6 Jan Kupec 2008-05-29 08:48:06 UTC
Isn't it completely unrelated? bug 395327 suggested that zypper should not even try to refresh if there's no network.
Comment 7 Stephan Kulow 2008-05-29 09:37:36 UTC
it should disable every repo that can't be refreshed. And it should check for cd/dvd if the repo is there at all. If you want to track these two issues in one bug, reopen 395327
Comment 8 Vincent Untz 2008-05-29 10:01:30 UTC
(In reply to comment #7 from Stephan Kulow)
> it should disable every repo that can't be refreshed.

Actually, in my case, I'd still like to do "zypper search"... But maybe I should open another bug for this?
Comment 9 Jan Kupec 2008-05-29 10:06:48 UTC
What do you mean? If the search fails because of a failed autorefresh, then it is the same issue as here.

BTW, try to disable the autorefresh for a specific run with --no-refresh global option, should help in your case.
Comment 10 Vincent Untz 2008-05-29 10:21:35 UTC
(In reply to comment #9 from Ján Kupec)
> What do you mean? If the search fails because of a failed autorefresh, then it
> is the same issue as here.

coolo was suggesting that the repo should be disabled. I might be mistaken, but I'd guess that a disabled repo will not be used for searches. If I'm mistaken, then just ignore me :-)

> BTW, try to disable the autorefresh for a specific run with --no-refresh global
> option, should help in your case.

Yes, I know about --no-refresh. But when I do "zypper search", I do not think "am I offline? If yes, I should use --no-refresh". I just do "zypper search". Each time I do that offline, I hope zypper could see I'm offline and automatically use --no-refresh.
Comment 11 Jan Kupec 2008-05-30 11:58:42 UTC
(In reply to comment #0 from Stephan Kulow)
> If you eject the DVD, you get a fatal error that there is no medium in
> cd:///?devices=/dev/sr0
> 
> It used to (and should do) disable the repo due to errors 

It still does, but not in the commit phase, only while refreshing.

> and get the packages from another repo.

This is a feature request and a non-trivial thing to do. Put it into FATE please.

------------------

I can reproduce this with plain 'mount':

$ '/bin/mount' '-t' 'iso9660' '-o' 'ro' '/dev/sr0' /mnt/tmp/
mount: No medium found

The medium is there of course, and repeating the command succeeds immediately (as well as hitting 'r' in zypper's prompt). However, mount used to (and should) wait for the medium to be read by the drive.

Matthias?
Comment 12 Jan Kupec 2008-05-30 12:02:36 UTC
(In reply to comment #10 from Vincent Untz)
> (In reply to comment #9 from Ján Kupec)
> > What do you mean? If the search fails because of a failed autorefresh, then it
> > is the same issue as here.
> 
> coolo was suggesting that the repo should be disabled. I might be mistaken, but
> I'd guess that a disabled repo will not be used for searches. If I'm mistaken,
> then just ignore me :-)

Yes, you're absolutely right. Your suggestion to ignore the refresh error and NOT disable the repository (as long as there is a previous solv cache available) make sense for query commands (at least some, which don't necessarily need the latest metadata). Please, open an enhancement request for this.
Comment 13 Matthias Koenig 2008-05-30 15:43:42 UTC

*** This bug has been marked as a duplicate of bug 390204 ***