Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 809041

Summary: Getting "AttributeError" while installing packages on registered system
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: katello-agentAssignee: Mike McCune <mmccune>
Status: CLOSED NOTABUG QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: gkhachik, lzap, pmoravec
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-04 14:21:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sachin Ghai 2012-04-02 10:32:59 UTC
Description of problem:
I was trying to install packages on a newly registered system. System was successfully registered and subscribed to rhel6.2 repo. Katello agent was installed. When I restarted the goferd, following logs appeared in agent.log:

----
[root@dhcp201-130 ca]# service goferd restart
Stopping goferd                                            [  OK  ]
Starting goferd                                            [  OK  ]
[root@dhcp201-130 ca]# tail -f /var/log/gofer/agent.log 
clientcert=/etc/pki/consumer/bundle.pem
2012-04-02 15:44:08,987 [INFO][katelloplugin-monitor] update() @ main.py:123 - uuid="23c46ae4-fe3b-42ec-8125-a45bf1260dd4", attached
2012-04-02 15:44:08,987 [INFO][23c46ae4-fe3b-42ec-8125-a45bf1260dd4] connect() @ broker.py:100 - connecting:
{dhcp201-142.englab.pnq.redhat.com:5674}:
transport=SSL
host=dhcp201-142.englab.pnq.redhat.com
port=5674
cacert=/etc/rhsm/ca/candlepin-ca.pem
clientcert=/etc/pki/consumer/bundle.pem
2012-04-02 15:44:09,020 [INFO][23c46ae4-fe3b-42ec-8125-a45bf1260dd4] connect() @ broker.py:103 - {dhcp201-142.englab.pnq.redhat.com:5674} connected to AMQP
--


When I triggered 'Add package' from UI, following logs appeared in 

---
2012-04-02 15:49:05,339 2911:140524350600960: gofer.rmi.policy:INFO: policy:139 sent (23c46ae4-fe3b-42ec-8125-a45bf1260dd4):
{
  "classname": "Packages", 
  "kws": {}, 
  "args": [
    [
      "zsh"
    ], 
    false
  ], 
  "method": "install", 
  "cntr": [
    [], 
    {
      "importkeys": false
    }
  ]
}
2012-04-02 15:49:05,428 2911:140524350600960: pulp.server.tasking.task:ERROR: task:468 Task failed: Task 46882854-7cad-11e1-aa92-52540003d00b: ConsumerApi.__installpackages(23c46ae4-fe3b-42ec-8125-a45bf1260dd4, ['zsh'], )
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pulp/server/tasking/task.py", line 414, in run
    result = self.callable(*self.args, **self.kwargs)
  File "/usr/lib/python2.6/site-packages/pulp/server/api/consumer.py", line 448, in __installpackages
    return packages.install(names, reboot)
  File "/usr/lib/python2.6/site-packages/gofer/rmi/stub.py", line 72, in __call__
    return self.stub._send(request, opts)
  File "/usr/lib/python2.6/site-packages/gofer/rmi/stub.py", line 133, in _send
    return self.__send(request, options)
  File "/usr/lib/python2.6/site-packages/gofer/rmi/stub.py", line 164, in __send
    any=opts.any)
  File "/usr/lib/python2.6/site-packages/gofer/rmi/policy.py", line 144, in send
    return self.__getreply(sn, reader)
  File "/usr/lib/python2.6/site-packages/gofer/rmi/policy.py", line 181, in __getreply
    return self.__onreply(envelope)
  File "/usr/lib/python2.6/site-packages/gofer/rmi/policy.py", line 197, in __onreply
    raise RemoteException.instance(reply)
AttributeError: Values instance has no attribute 'repos'
----


Version-Release number of selected component (if applicable):
katello-glue-candlepin-0.1.307-1.el6.noarch
katello-0.1.307-1.el6.noarch
pulp-1.0.2-1.el6.noarch
candlepin-0.5.26-1.el6.noarch


Packages installed on client from "http://download.lab.bos.redhat.com/rel-eng/CloudForms/1.0/2012-03-30.2/el6-tools/x86_64/":
=============================
subscription-manager-0.96.17.2-1.el6.x86_64
gofer-0.66-1.el6.noarch
python-rhsm-0.96.15-1.el6.noarch
python-gofer-0.66-1.el6.noarch
gofer-package-0.66-1.el6.noarch
katello-agent-0.17-1.el6.noarch


How reproducible:
always

Steps to Reproduce:
1. Install/configure subscription-manager on client
2. register a node via subscripion-manager
3. Assign rhel6.2 repo subscription to newly registered node
4. Install katello-agent
5. Restart goferd
  

Actual results:
AttributeError: Values instance has no attribute 'repos'

Expected results:
Package should be installed on newly registered system.

Additional info:

Comment 1 Sachin Ghai 2012-04-02 10:34:56 UTC
/var/log/gofer/agent.log says:
==================

2012-04-02 16:04:13,611 [INFO][worker-0] dispatch() @ dispatcher.py:530 - dispatching:{
  "args": [
    [
      "zsh"
    ], 
    false
  ], 
  "auth": {
    "secret": "34259164a98e78816ff69c803fe7f293d876357bd903c3475f456e773274d93c", 
    "pam": null, 
    "uuid": "23c46ae4-fe3b-42ec-8125-a45bf1260dd4"
  }, 
  "classname": "Packages", 
  "kws": {}, 
  "cntr": [
    [], 
    {
      "importkeys": false
    }
  ], 
  "method": "install"
}
2012-04-02 16:04:13,635 [ERROR][worker-0] __call__() @ dispatcher.py:488 - Values instance has no attribute 'repos'
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/gofer/rmi/dispatcher.py", line 485, in __call__
    retval = method(*args, **keywords)
  File "/usr/lib64/gofer/plugins/katelloplugin.py", line 175, in install
    installed = p.install(names)
  File "/usr/lib64/gofer/plugins/package.py", line 176, in install
    yb.install(pattern=info)
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 3338, in install
    mypkgs = self.pkgSack.returnPackages(patterns=pats,
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 882, in <lambda>
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 668, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.6/site-packages/yum/repos.py", line 260, in populateSack
    self.doSetup()
  File "/usr/lib/python2.6/site-packages/yum/repos.py", line 72, in doSetup
    self.ayum.plugins.run('prereposetup')
  File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 184, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/share/yum-plugins/rhnplugin.py", line 197, in prereposetup_hook
    for opt, repoexp in opts.repos:
AttributeError: Values instance has no attribute 'repos'
2012-04-02 16:04:13,636 [INFO][worker-0] sendreply() @ rmi.py:158 - b97ed0b4-dabb-4839-bfa6-a4cce627a8a9 processed in: 88 (ms)

Comment 2 Sachin Ghai 2012-04-04 13:37:06 UTC
I tried to install packages via yum on registered client node. I can pull the packages via yum.

[root@dhcp201-130 ~]# yum install zsh
Loaded plugins: product-id, rhnplugin, subscription-manager
Updating certificate-based repositories.
rhel-6-server-rpms                                       | 3.7 kB     00:00     
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package zsh.x86_64 0:4.3.10-4.1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package    Arch          Version               Repository                 Size
================================================================================
Installing:
 zsh        x86_64        4.3.10-4.1.el6        rhel-6-server-rpms        2.1 M

Transaction Summary
================================================================================
Install       1 Package(s)

Total download size: 2.1 M
Installed size: 2.1 M
Is this ok [y/N]: y
Downloading Packages:
zsh-4.3.10-4.1.el6.x86_64.rpm                            | 2.1 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : zsh-4.3.10-4.1.el6.x86_64                                    1/1 
Installed products updated.

Installed:
  zsh.x86_64 0:4.3.10-4.1.el6                                                   

Complete!
[root@dhcp201-130 ~]# cat /etc/yum.repos.d/redhat.repo 
#
# Certificate-Based Repositories
# Managed by (rhsm) subscription-manager
#

[rhel-6-server-rpms]
name = Red Hat Enterprise Linux 6 Server (RPMs)
baseurl = https://dhcp201-142.englab.pnq.redhat.com/pulp/repos/ACME_Corporation/stage/content/dist/rhel/server/6/$releasever/$basearch/os
enabled = 1
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify = 1
sslcacert = /etc/rhsm/ca/candlepin-ca.pem
sslclientkey = /etc/pki/entitlement/7238643478145594779-key.pem
sslclientcert = /etc/pki/entitlement/7238643478145594779.pem
[root@dhcp201-130 ~]#

Comment 4 Garik Khachikyan 2012-04-04 14:19:17 UTC
# COMMENT

some note that may be helpful (maybe not) ;)
---
katello-0.2.24-1.git.7.0b241dc.el6.noarch
katello-agent-1.0.3-1.git.0.cccd0b4.el6.noarch
yum-3.2.29-22.el6_2.2.noarch
subscription-manager-0.99.8-1.el6.x86_64
gofer-0.67-1.el6.noarch
python-rhsm-0.99.6-1.el6.noarch
python-gofer-0.67-1.el6.noarch
gofer-package-0.67-1.el6.noarch

I did prepared a scenario (with having GPG signed repo) and the CLI-way of `system packages --install lion` just got fine.

Comment 6 Sachin Ghai 2012-04-04 14:21:41 UTC
My Bad.. The client machine was registered with rhn..By disbaling the rhn plugin (/etc/yum/pluginconf.d/rhnplugin.conf) resolved this issue..

--


[root@dhcp201-130 ~]# tail -f /var/log/gofer/agent.log 
  "classname": "Packages", 
  "kws": {}, 
  "cntr": [
    [], 
    {
      "importkeys": false
    }
  ], 
  "method": "install"
}
2012-04-04 19:41:17,434 [INFO][worker-0] install() @ katelloplugin.py:176 - Packages installed: {'resolved': [{'epoch': '0', 'version': '4.3.10', 'name': 'zsh', 'release': '4.1.el6', 'arch': 'x86_64', 'qname': 'zsh-4.3.10-4.1.el6.x86_64', 'repoid': 'rhel-6-server-rpms'}], 'deps': []}
2012-04-04 19:41:17,435 [INFO][worker-0] sendreply() @ rmi.py:158 - d036330e-2412-4ae0-b750-19e04b77a038 processed in: 26.123 (seconds)