Priorities for custom repositories aren't set properly on Ubuntu

Bug #1459627 reported by Artem Panchenko
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
High
Ihor Kalnytskyi

Bug Description

Fuel version info (6.1 build #476): http://paste.openstack.org/show/241958/

Priorities for custom repositories on Ubuntu don't work properly because of incorrect pinning:

root@node-1:~# cat /etc/apt/preferences.d/mos-extra.pref
Package: *
Pin: release l=trusty-fuel-6.1-stable-6740,o=obs://build.opensuse.org/trusty-fuel-6.1-stable-6740/ubuntu,n=ubuntu,a=ubuntu
Pin-Priority: 1200

root@node-1:~# apt-cache policy | grep -A 2 http.*obs
 500 http://obs-1.mirantis.com:82/trusty-fuel-6.1-stable-6740/ubuntu/ Packages
     release o=obs://build.opensuse.org/trusty-fuel-6.1-stable-6740/ubuntu,n=ubuntu,l=trusty-fuel-6.1-stable-6740,c=
     origin obs-1.mirantis.com

root@node-1:~# apt-get install cinder-api
Reading package lists... Done
Building dependency tree
Reading state information... Done
cinder-api is already the newest version.

After I modified pinning for 'mos-extra' repository, APT priorities became to work fine:

root@node-1:~# cat /etc/apt/preferences.d/mos-extra.pref
Package: *
Archive: ubuntu
Pin: release l=trusty-fuel-6.1-stable-6740,o=obs://build.opensuse.org/trusty-fuel-6.1-stable-6740/ubuntu,n=ubuntu
Pin-Priority: 1200

root@node-1:~# apt-cache policy | grep -A 2 http.*obs
1200 http://obs-1.mirantis.com:82/trusty-fuel-6.1-stable-6740/ubuntu/ Packages
     release o=obs://build.opensuse.org/trusty-fuel-6.1-stable-6740/ubuntu,n=ubuntu,l=trusty-fuel-6.1-stable-6740,c=
     origin obs-1.mirantis.com

http://paste.openstack.org/show/241997/

Steps to reproduce:

1. Create environment on Ubuntu
2. Go to 'Settings' tab and add some extra Ubuntu repository and set priority for it
3. Deploy cluster
4. Go to some cluster node and check extra repo priority using `apt-cache policy` command

Expected result:

- priority is set as defined

Actual result:

- priority is default

Diagnostic snapshot is attached.

Revision history for this message
Artem Panchenko (apanchenko-8) wrote :
Revision history for this message
Artem Panchenko (apanchenko-8) wrote :
Changed in fuel:
status: New → Confirmed
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Igor Kalnitsky (ikalnitsky)
Revision history for this message
Ihor Kalnytskyi (ikalnytskyi) wrote :

Well, it looks like apt pinning doesn't use the 'Archive' info for flat repos. For instance, we don't see the 'a=...' information in 'apt-cache policy':

  release o=obs://build.opensuse.org/trusty-fuel-6.1-stable-6740/ubuntu,n=ubuntu,l=trusty-fuel-6.1-stable-6740,c=

and we see that Archive is actually Null in 'apt-cache dump' output:

 File: /var/lib/apt/lists/obs-1.mirantis.com:82_trusty-fuel-6.1-stable-6740_ubuntu_Packages
  Type: Debian Package Index
  Size: 7187
  ID: 2
  Flags: 0
  Time: Wed, 27 May 2015 10:09:36 GMT
  Archive: (null)
  Component:
  Version: (null)
  Origin: obs://build.opensuse.org/trusty-fuel-6.1-stable-6740/ubuntu
  Site: obs-1.mirantis.com
  Label: trusty-fuel-6.1-stable-6740
  Architecture: (null)

We should either remove Archive field from Release file in flat repos or inject skip hacks into nailgun/fuel-agent/preseed.

Revision history for this message
Vitaly Parakhin (vparakhin) wrote :

Please note that for each Gerrit request, there are actually TWO test repos created:

http://obs-1.mirantis.com:82/trusty-fuel-6.1-stable-6740/ubuntu/ - created by OBS, contains Archive field in metadata
http://obs-1.mirantis.com:82/trusty-fuel-6.1-stable-6740/reprepro/ - created with reprepro, does not contain Archive field in metadata

One should use second repo for specifying as extra package source - to avoid issues with pinning.

Revision history for this message
Artem Silenkov (asilenkov) wrote :

"Archive" field is deprecated AFAIK. It should be "Suite".
https://wiki.debian.org/RepositoryFormat no mentions of "Archive:" entry.
It seems that repropro generates correct file but obs not.
We have to switch over "Suite:" as we get rid of OBS soon.

Revision history for this message
Artem Silenkov (asilenkov) wrote :

I've patched OBS to produce "Suite: " instead of "Archive: " field in "Release" file.
And you could also use workaround above.

Changed in fuel:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.