Bug 802665

Summary: The install DVD is activated in the software sources. This causes an annoying error report when using online update.
Product: [openSUSE] openSUSE 12.3 Reporter: Pjotr K <pliniusminor>
Component: YaST2Assignee: Ladislav Slezák <lslezak>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P3 - Medium CC: locilka, lslezak, ma
Version: RC 1   
Target Milestone: ---   
Hardware: x86-64   
OS: All   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Yast2 log
Complete contents of /var/log/YaST2
y2log, screenshots and zypper error output
y2log from 1st stage
New and complete contents of /var/log/YaST2

Description Pjotr K 2013-02-07 18:13:50 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0

The install DVD shouldn't be activated by default in the software sources. This generates a useless and annoying error report when using online update or software manager. Because of course you don't have the install DVD in the drive anymore, at that point...

Other distro's usually solve this by *not* activating the install disc in the repo list, thus leaving it to the user to activate it if needed. This is a more user friendly approach, in my opinion... 

Now people, especially beginners, may have a bad first impression. So please deactivate the install DVD by default in the repo list.

Reproducible: Always

Steps to Reproduce:
1. Install openSUSE 12.3 by means of the install DVD;
2. Boot into your new OS without the DVD in the drive;
3. Run online update or software manager.
Actual Results:  
- Error: put the install DVD in the drive
- when clicking Skip, another warning.

Expected Results:  
I would expect online update to only access online repo's, which of course are the only ones that contain the latest updated versions of software.
Comment 1 Thomas Göttlicher 2013-03-01 11:36:28 UTC
Jiri, can installation disable the dvd repo when done with 2nd stage?
Comment 2 Jiří Suchomel 2013-03-01 12:40:34 UTC
Hm, I had a feeling we're actually doing this alredy.

But I can't find relevant piece of code, so I'm probably wrong. Lukas, don't you, by chance, remember if there's some source manipulation at the end of 2nd stage?

(I know we are disabling USB sources, in inst_extrasources, so it is easy to add DVD handling there as well, it's just strange it wasn't done already...)
Comment 3 Lukas Ocilka 2013-03-01 12:45:20 UTC
I've never seen this before, we usually add the DVD repository
(actually keep it) but add it with refresh=false so it's never refreshed
and only requested if user selects to install from that media.

Pjotr, please, attach output of:

    `zypper lr -u -p`
Comment 4 Lukas Ocilka 2013-03-01 12:47:23 UTC
Also attaching YaST logs would be great. YaST tries to add online repos
at the end of installation (Pool and Online Update) which should
make DVD (kind of) useless if it succeeds.

http://en.opensuse.org/openSUSE:Report_a_YaST_bug
Comment 5 Jiří Suchomel 2013-03-01 13:23:30 UTC
(In reply to comment #3)
> I've never seen this before, we usually add the DVD repository
> (actually keep it) but add it with refresh=false so it's never refreshed
> and only requested if user selects to install from that media.

Hm, so the bug would be not in a way how the repository is added, but that it was requested during online update.
Comment 6 Jiří Suchomel 2013-03-01 13:27:43 UTC
.. which reminds me:

when did you actually seen the request for DVD? Was it at the start of Online Update or at the end (after the patches selection)?

In the second case, that could be perfectly valid, as maybe some patch required to install package which was available on DVD
Comment 7 Lukas Ocilka 2013-03-01 14:03:30 UTC
(In reply to comment #6)
> In the second case, that could be perfectly valid, as maybe some patch required
> to install package which was available on DVD

And that's exactly the reason why I'm asking for

1.) list of repositories (comment #3)
2.) YaST logs (comment #4)
Comment 8 Lukas Ocilka 2013-03-01 14:05:42 UTC
(In reply to comment #5)
> Hm, so the bug would be not in a way how the repository is added, but that it
> was requested during online update.

Packages from DVD should be also in Pool (OSS/NON-OSS) repository.
If these were added in a correct way, DVD should not be requested.
Of course, if the repository is well generated.
Comment 9 Pjotr K 2013-03-01 15:07:19 UTC
@Lukas Ocilka: The problem may be caused by the fact that I installed without internet connection on my laptop. 

As you said in this thread: "YaST tries to add online repos at the end of installation (Pool and Online Update) which should make DVD (kind of) useless if it succeeds." Well, maybe this happens because it *doesn't* succeed, as there's no internet connection at that time....

I have already disabled the DVD repo manually, so the system is no longer "vanilla". So it doesn't show when I issue the command "zypper lr -u -p".

I will attach the requested Y2log file.

@Jiří Suchomel: the error shows at the *start* of Online Update (or at the start of Install/Remove Software. Rightaway.
Comment 10 Pjotr K 2013-03-01 15:08:09 UTC
Created attachment 527733 [details]
Yast2 log
Comment 11 Pjotr K 2013-03-01 15:11:58 UTC
Maybe a bit silly and superfluous to say this, but just to be complete: of course I *do* have established internet connection (wireless) before I run Online Update. :P
Comment 12 Jiří Suchomel 2013-03-01 15:27:39 UTC
Hm, dvd repository seems to have correctly set

autorefresh : 0
url : cd:///?devices=/dev/disk/by-id/usb-HL-DT-ST_DVDRAM_GSA-H42L_DEF10BC085D1-0:0


Michael, can you see from the  logs why was it requested on the start of online update?
Comment 13 Michael Andres 2013-03-04 10:00:35 UTC
If I do 

  grep -A 1 'Going to try to check whether refresh is needed' y2log 

and look for the cd device, I get:

  2013-02-07 17:17:03 <1> linux-pqmk.site(1428) [zypp]
    RepoManager.cc(checkIfToRefreshMetadata):766 
    Going to try to check whether refresh is needed for cd:///?devices=/dev/...
  2013-02-07 17:17:03 <1> linux-pqmk.site(1428) [zypp] 
    RepoManager.cc(checkIfToRefreshMetadata):775 

    No cached metadata, going to refresh


Even if autorefresh is off: If a repo is enabled it's metadata need to be read at least once and be placed in /var/cache/zypp/raw/<repoalias> so we can use it. 

So you need one initial refresh (also after the cache was cleared by e.g. a 'zypper clean' command).
Comment 14 Jiří Suchomel 2013-03-04 11:32:36 UTC
Pjotr, please attach full /var/log/YaST2/y2log directory.

(note to myself - looking for Pkg::SourceCacheCopyTo call)
Comment 15 Pjotr K 2013-03-04 13:36:05 UTC
Created attachment 527964 [details]
Complete contents of /var/log/YaST2

Ji?í Suchomel: I've attached the complete contents of /var/log/YaST2, as requested by you.

Hopefully in time for 12.3 final release...
Comment 16 Jiří Suchomel 2013-03-04 14:19:14 UTC
Sorry, but the log from the first stage of installation is missing, so I can't see if (and what) went wrong.

Just to summarize: your original report is not true in a way that YaST does not do anything to the sources: normally, it saves DVD source with autorefresh set off, and copies the source cache to the installed system. Than the DVD is not requested next time you run software configuration (or online update). 

In your case, it seems like the DVD source cache wasn't copied to the system. Unfortunately we cannot see why, because the log file covering this operation apparently wasn't copied as well - maybe for the same reason.

Didn't you experience any problems with disk size during the installation or after?

Are you able to reproduce the bug with new installation?
Comment 17 Pjotr K 2013-03-04 15:33:44 UTC
I experienced no problems at all during installation. Not with disk size nor with anything else.

I tried to do a fresh install with RC2, but the iso is too big for a DVD, as is mentioned in this bug report:
https://bugzilla.novell.com/show_bug.cgi?id=807204
I hope I can still find an iso of RC1...

Perhaps it's a safe approach to simply disable the DVD by default in the repo list, as many other distro's do?
Comment 18 Pjotr K 2013-03-05 10:02:44 UTC
Jiří Suchomel: can you provide me with a link to the Goldmaster DVD iso (64 bit)?

The Goldmaster will be released today; with that, I can test this issue with the latest edition.
Comment 19 Jiří Suchomel 2013-03-05 10:12:19 UTC
(In reply to comment #17)

> Perhaps it's a safe approach to simply disable the DVD by default in the repo
> list, as many other distro's do?

Our approach works, it just didn't for you for some reason we don't know (yet). Disabling DVD may fail for the same reason.

Sorry, I do not know any other (external) links than provided at http://software.opensuse.org
Comment 20 Ladislav Slezák 2013-03-05 14:01:34 UTC
(In reply to comment #17)
> Perhaps it's a safe approach to simply disable the DVD by default in the repo
> list, as many other distro's do?

Um, that's an interesting idea. Actually libzypp (or the default value in  /etc/zypp/zypp.conf) sets download.media_preference = download, which means if the same package is available on DVD medium and in a remote repository the remote repository (download) will be preferred.

That means we could disable the DVD installation repository and the packages will be available from openSUSE-12.3-Oss/Non-Oss with the same effect.

Unfortunately it's too late to change it, but seems to be a good idea for 13.1...
Comment 21 Pjotr K 2013-03-13 19:32:10 UTC
Created attachment 529594 [details]
y2log, screenshots and zypper error output

Ji?í Suchomel: the problem is still there, in a fresh install of the final edition of 12.3. See the archive file that I've submitted, which also contains screenshots.
Comment 22 Jiří Suchomel 2013-03-15 09:17:16 UTC
(In reply to comment #21)
> Created an attachment (id=529594) [details]
> y2log, screenshots and zypper error output

Sorry. but again you need to attach full logs (whole /var/log/YaST2)
Comment 23 Jiří Suchomel 2013-03-15 09:32:12 UTC
Created attachment 529879 [details]
y2log from 1st stage

Actually, now I was able to reproduce the problem, here's the relevant log.

SourceCacheCopyTo function was called, without errors (well the credentials were not copied, but that should not harm).

Ladislav, judging from the log file do you think something wrong could happen when copying the cache?

Or the copied files were not enough for later libzypp use?
Comment 24 Pjotr K 2013-03-15 15:17:18 UTC
Created attachment 529963 [details]
New and complete contents of /var/log/YaST2

Ji?í Suchomel: here's the complete set, as requested by you. 

Hopefully this bug can be fixed by a patch for 12.3, or does a fix have to wait for the next release?
Comment 25 Ladislav Slezák 2013-03-15 17:14:16 UTC
(In reply to comment #24)
> Hopefully this bug can be fixed by a patch for 12.3, or does a fix have to wait
> for the next release?

Well, it depends where exactly the problem is. Patching can be done only when the affected code is executed _after_ installing online updates (and even that not in all cases, the patched file might be already read by the installer so the change may not have any effect).

The workaround in this case is pretty easy: don't remove the medium before rebooting.

Anyway, I'll check the logs to find out where is the problem...
Comment 26 Pjotr K 2013-03-15 18:40:40 UTC
> The workaround in this case is pretty easy: don't remove the medium before
> rebooting.

If I do that, my computer wants to boot from the DVD again, instead of the hard drive with the fresh openSUSE install...
Comment 27 Michael Andres 2013-03-18 10:27:41 UTC
(In reply to comment #25)
> Anyway, I'll check the logs to find out where is the problem...

Cache cleanup:

== Yast is creating repos whose .repo files are not stored on disk:
   2013-03-13 20:31:10 
     [Pkg] Source_Create.cc(createManagedSource):282 
     Adding source 'openSUSE-12.3-1.7'

== Later on /var/cache/zypp/ is populated:
   2013-03-13 20:31:20
     [Pkg] Source_Create.cc(createManagedSource):294 
     Caching repository 'openSUSE-12.3-1.7'...

This would basically be no problem, 
     if yast would use a _single_ RepoManager instance (created _before_
     the cache is populated)
_or_ would pass the repo to the RepoManager (call RepoManager::addRepository)
     so the .repo file is written to disk (indicating the cache is in use)
_or_ would use a private temp cachedir together with each RepoManager 
     instance it uses

But this way yast manages the RepoInfos on it's own without telling RepoManager, while it also uses the global cache and multiple RepoManager instances operating on the global cache. 

Repomanager upon construction cleans orphaned entries from the cache (those without corresponding .repo file):
    2013-03-13 20:31:20
      [zypp] RepoManager.cc(init_knownRepositories):636 
      start construct known repos
    ... readdir /var/cache/zypp/raw
    ... recursive_rmdir /var/cache/zypp/raw/openSUSE-12.3-1.7
    ... end construct known repos

This is where you lose the raw metadata.

(Note that the log says '19:52:08 .. SourceCacheCopyTo' but system time was in between adjusted by -1h)
Comment 28 Ladislav Slezák 2013-03-18 11:56:34 UTC
Michael, thanks a lot for analyzing the log and finding the problem!
Comment 29 Ladislav Slezák 2013-09-10 07:29:25 UTC
Fixed in yast2-pkg-bindings-3.0.1 (Factory/13.1).