Modify

Ticket #1070 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

Packages tb and dep resolution broken in rc2

Reported by: J davis <jake.davis@…> Owned by: solj
Priority: major Milestone: Bcfg2 1.2.0 Release
Component: bcfg2-client Version: 1.0
Keywords: Cc:

Description

I'm getting a Packages trace back on the server and yum dependancy resolution problems with the latest rc.

bcfg2-server 1.2.0rc2 ubuntu 11.04 x86_64

bcfg2 1.2.0rc2 on CentOS 5.7 x86_64

On the server I see

Plugin Packages: unexpected structure validation failure
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/Bcfg2/Server/Core.py", line 189, in validate_structures
    plugin.validate_structures(metadata, data)
  File "/usr/lib/pymodules/python2.7/Bcfg2/Server/Plugins/Packages/__init__.py", line 115, in validate_structures
    collection=collection)
  File "/usr/lib/pymodules/python2.7/Bcfg2/Server/Plugins/Packages/__init__.py", line 149, in _build_packages
    packages, unknown = collection.complete(base)
  File "/usr/lib/pymodules/python2.7/Bcfg2/Server/Plugins/Packages/Yum.py", line 454, in complete
    return Collection.complete(self, packagelist)
  File "/usr/lib/pymodules/python2.7/Bcfg2/Server/Plugins/Packages/Collection.py", line 150, in complete
    self.virt_pkgs[pgrps] = self.get_vpkgs()
  File "/usr/lib/pymodules/python2.7/Bcfg2/Server/Plugins/Packages/Collection.py", line 109, in get_vpkgs
    s_vpkgs = source.get_vpkgs(self.metadata)
  File "/usr/lib/pymodules/python2.7/Bcfg2/Server/Plugins/Packages/Yum.py", line 751, in get_vpkgs
    rv = Source.get_vpkgs(self, metadata)
  File "/usr/lib/pymodules/python2.7/Bcfg2/Server/Plugins/Packages/Source.py", line 170, in get_vpkgs
    for key, value in list(self.provides[agrp].items()):
KeyError: 'x86_64'

There is no error on the client side.

sources.xml is comprised of several entries like this:

<Source type="yum" rawurl="http://repo/centos5.7-x86_64/RPMS.os">
    <Arch>x86_64</Arch>
    <Arch>i386</Arch>
</Source>

I'm seeing many more unmanaged/extra entries on the yum clients than I did with rc1. For instance, the package bcfg2 is part of the clients config.

# rpm -qR bcfg2
/bin/sh  
/usr/bin/python2.4  
config(bcfg2) = 1.2.0rc2-0.1
python(abi) = 2.4
python-lxml >= 0.9
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1

# rpm -q --whatprovides python
python-2.4.3-44.el5_7.1.x86_64

# rpm -q --whatprovides /bin/sh
bash-3.2-32.el5.x86_64

The bcfg2 package itself shows up as managed/correct, however, both python and bash show up as unmanaged/extra.

Attachments

Change History

comment:1 Changed 10 years ago by J davis <jake.davis@…>

  • Summary changed from Packages tb and dep resulution broken in rc2 to Packages tb and dep resolution broken in rc2

comment:2 Changed 10 years ago by J davis <jake.davis@…>

This appears to be related to the fact that I included <Arch>i386</Arch> in the sources.xml for a 64 bit OS. Removing that resolves the traceback and dep resolution problems.

comment:3 Changed 10 years ago by J davis <jake.davis@…>

  • Priority changed from critical to minor

comment:4 follow-up: ↓ 5 Changed 10 years ago by solj

  • Owner changed from desai to solj
  • Status changed from new to accepted

Can you try the following patch:

diff --git a/src/lib/Server/Plugins/Packages/Source.py b/src/lib/Server/Plugins/Packages/Source.py
index 1f0cd8e..e5c40ab 100644
--- a/src/lib/Server/Plugins/Packages/Source.py
+++ b/src/lib/Server/Plugins/Packages/Source.py
@@ -167,11 +167,15 @@ class Source(object):
                                 if a in metadata.groups]
         vdict = dict()
         for agrp in agroups:
-            for key, value in list(self.provides[agrp].items()):
-                if key not in vdict:
-                    vdict[key] = set(value)
-                else:
-                    vdict[key].update(value)
+            try:
+                for key, value in list(self.provides[agrp].items()):
+                    if key not in vdict:
+                        vdict[key] = set(value)
+                    else:
+                        vdict[key].update(value)
+            except KeyError:
+                print("Architecture %s not found. "
+                      "Please verify that it applies." % agrp)
         return vdict
 
     def is_virtual_package(self, metadata, package):

comment:5 in reply to: ↑ 4 Changed 10 years ago by solj

  • Priority changed from minor to major

This is wrong. I can reproduce the behavior with having _only_ an x86_64 arch group, so there's something else going on.

Example source:

<Source type="yum" rawurl="http://mrepo/rhel6server-x86_64/RPMS.optional">
        <Arch>x86_64</Arch>
</Source>

Replying to solj:

Can you try the following patch:

diff --git a/src/lib/Server/Plugins/Packages/Source.py b/src/lib/Server/Plugins/Packages/Source.py
index 1f0cd8e..e5c40ab 100644
--- a/src/lib/Server/Plugins/Packages/Source.py
+++ b/src/lib/Server/Plugins/Packages/Source.py
@@ -167,11 +167,15 @@ class Source(object):
                                 if a in metadata.groups]
         vdict = dict()
         for agrp in agroups:
-            for key, value in list(self.provides[agrp].items()):
-                if key not in vdict:
-                    vdict[key] = set(value)
-                else:
-                    vdict[key].update(value)
+            try:
+                for key, value in list(self.provides[agrp].items()):
+                    if key not in vdict:
+                        vdict[key] = set(value)
+                    else:
+                        vdict[key].update(value)
+            except KeyError:
+                print("Architecture %s not found. "
+                      "Please verify that it applies." % agrp)
         return vdict
 
     def is_virtual_package(self, metadata, package):

comment:6 Changed 10 years ago by solj

  • Status changed from accepted to closed
  • Resolution set to fixed

This appears to be fixed with an upgrade to HEAD. It should be resolved in the next release candidate.

WARNING! You need to establish a session before you can create or edit tickets. Otherwise the ticket will get treated as spam.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.