Bug 847659

Summary: Upgrading using the DVD ISO removes existing online repositories
Product: [openSUSE] openSUSE 13.1 Reporter: Robert Munteanu <rombert>
Component: YaST2Assignee: Ladislav Slezák <lslezak>
Status: VERIFIED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Critical    
Priority: P1 - Urgent CC: carlos.e.r, coolo, locilka, lslezak, suse-beta, tchvatal, thomas.e.schreiner
Version: RC 1Flags: coolo: SHIP_STOPPER+
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: YaST logs

Description Robert Munteanu 2013-10-25 14:32:20 UTC
Created attachment 565019 [details]
YaST logs

User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0

I did a test install of 12.3 using a DVD iso. I applied all available
patches for 12.3 and then upgraded using another DVD iso -
openSUSE-13.1-DVD-Build0041-x86_64.iso to be more precise.

During the installation I recall that I was asked for what to to with
the currently defined repos, and I left the default option - Remove.

After the installation, I was only left with the 'DVD' repo. That is
unexpected to me since the DVD installation properly set up the online
repos.

See also http://lists.opensuse.org/opensuse-factory/2013-10/msg00804.html .

Reproducible: Didn't try
Comment 1 Lukas Ocilka 2013-10-25 14:57:15 UTC
Found it:

clients/inst_extrasources.rb:331 Pkg Builtin called: RepositoryAdd
Source_Create.cc(RepositoryAdd):433 alias repo-update already exists
clients/inst_extrasources.rb:340 Cannot register: $["alias":"repo-update", "autorefresh":true, "base_urls":["http://download.opensuse.org/update/13.1/"], "enabled":true, "name":"openSUSE-13.1-Update", "priority":99, "prod_dir":"/"]
...
and this is the same for all repos.

For some reason, repositories with the same aliases were on the system already.
Comment 2 Lukas Ocilka 2013-10-25 15:01:43 UTC
These should have been removed during installation BEFORE adding the new ones
but...

clients/inst_upgrade_urls.rb:1139 Checking repo: $["alias":"repo-update", "autorefresh":true, "enabled":true, "id":"ID: 2", "initial_url_status":"removed", "keeppackages":false, "name":"openSUSE-12.3-Update", "new_status":"removed", "type":"rpm-md", "url":"http://download.opensuse.org/update/12.3/"]
clients/inst_upgrade_urls.rb:1159 Repository has been already removed

...something pretends repos have been already removed, which is false

Ladislav: Duplicate or something new?
Comment 3 Carlos Robinson 2013-10-29 01:22:30 UTC
Method to bypass the issue:

Repository configuration, add community repositories, tick the four (oss, non-oss, updates, updates-non-oss).

I noticed that the upgrade left me without network; can this have some influence on the repo issue?
Comment 4 Ladislav Slezák 2013-10-30 08:57:02 UTC
Looks like something new, bnc#708019 is about changing names...

The network issue seems to be unrelated to this, open a separate bug report for it. (Maybe it can be caused by changed device name, e.g. from eth0 to something like "enp0s3")
Comment 5 Christian Boltz 2013-11-03 14:25:01 UTC
Ending up without any online repo (especially without the update repo) means this can't be fixed with an online update.

Coolo, does this qualify as ship stopper?
Comment 6 Stephan Kulow 2013-11-04 09:12:49 UTC
true - and we propagate the DVD update as the safe version
Comment 7 Stephan Kulow 2013-11-05 07:38:49 UTC
fixing prios
Comment 8 Lukas Ocilka 2013-11-05 07:42:33 UTC
Ladislav, please, have a look at this bug. ASAP.
Comment 9 Ladislav Slezák 2013-11-05 08:05:02 UTC
OK, I'm looking at it...
Comment 10 Ladislav Slezák 2013-11-05 14:50:23 UTC
*** Bug 848564 has been marked as a duplicate of this bug. ***
Comment 11 Ladislav Slezák 2013-11-06 07:52:16 UTC
Status update: I have a patch for yast2-pkg-bindings, but a small patch for libzypp will be needed as well, I'm going to build patched packages and then I'll test them.
Comment 12 Stephan Kulow 2013-11-06 08:39:25 UTC
thanks for the update, I'm waiting patiently :)
Comment 13 Ladislav Slezák 2013-11-06 09:05:32 UTC
OK, my test passed, the online repos were added correctly.

The fixed packages (yast2-pkg-bindings and libzypp) are in https://build.opensuse.org/project/monitor/home:lslezak:branches:openSUSE:13.1

You can try them using "insecure=1 dud=http://download.opensuse.org/repositories/home:/lslezak:/branches:/openSUSE:/13.1/standard/x86_64/libzypp-13.8.1-3.1.x86_64.rpm dud=http://download.opensuse.org/repositories/home:/lslezak:/branches:/openSUSE:/13.1/standard/x86_64/yast2-pkg-bindings-3.0.4-9.1.x86_64.rpm" boot parameter in the RC2 boot prompt (yeah, I know, too long for typing, make sure there's no typo...)

Michael Andres: there is a small patch for libzypp, for some unknown reason (ENOTIME, would need more debugging...) the .repo files got truncated to zero size during update. And at the end when Yast wants to update the files libzypp keeps the files empty without writing anything. The patch fixes updating an empty repofile.

Please, check my patch in https://build.opensuse.org/package/view_file/home:lslezak:branches:openSUSE:13.1/libzypp/repo_update.diff?expand=1

Coolo: how can we proceed with the fix? Where should I submit the packages?
Comment 14 Stephan Kulow 2013-11-06 10:54:20 UTC
I copy them out of your branch if ma is fine with the fix
Comment 15 Michael Andres 2013-11-06 12:02:33 UTC
I'm sorry, but 'No'.

This is a 'modifyRepository' request; it changes an already existing repos data. If the old repo is not where we expect it to be, we can's simply create a new one.

This would of course work, if the old repo is actually gone. But if the (next) bug simply renames a repo file behind our back, we'd mess it up even more (by creating a second repo with the same alias).

If the repo files were modified behind YaSTs back, you should go and create a new RepoManager instance, which will reflect the true situation on disk.
Comment 16 Michael Andres 2013-11-06 12:26:05 UTC
And according to the 1 y2log provided, it appears to me like the repos are removed in pkg_finish.rb by simply removing the .repo files...

  2013-10-25 15:45:21 <1> linux(2727) [Ruby] clients/pkg_finish.rb:179 
  Removing target repository /etc/zypp/repos.d/repo-debug.repo
  Removing target ...

...immediately (~50 loglines) before the re-creation fails...

  2013-10-25 15:45:21 <3> linux(2727) [Pkg] Source_Create.cc(RepositoryAdd):433
  alias repo-update already exists

Somewhere in between your RepoManager should be updated to see the changed situation on disk.
Comment 17 Ladislav Slezák 2013-11-06 12:52:05 UTC
Yeah, thanks for analyzing it, I'll look for a better fix...
Comment 18 Ladislav Slezák 2013-11-06 14:03:29 UTC
Yes, this patch looks much better: https://github.com/yast/yast-packager/pull/31

ma: thanks for the hint!

coolo: the fix is in https://build.opensuse.org/package/show/home:lslezak:branches:openSUSE:13.1/yast2-packager (plus there is a small another fix for bnc#847153)
Comment 19 Michael Andres 2013-11-06 14:18:48 UTC
Is the yast2-pkg-bindings fix from c#13 still needed?
Comment 20 Ladislav Slezák 2013-11-06 14:40:35 UTC
No, it works without that fix.
Comment 21 Ladislav Slezák 2013-11-06 15:19:34 UTC
Fixed in yast2-packager-3.0.8.
Comment 22 Greg Freemyer 2013-11-08 17:11:38 UTC
yast2-packager-3.0.8 is in openSUSE_13.1 so it should be on the GA DVD

https://build.opensuse.org/package/show/openSUSE:13.1/yast2-packager