Project

General

Profile

Bug #7553

katello-agent/goferd: plugin "katelloplugin" import failed - cannot import name ConsumerIdentity on EL6 / No module named bindings.server on EL7

Added by Christian Ehart almost 8 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Category:
Client/Agent
Target version:
Difficulty:
medium
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

Hello,

it seems there are some issue with the "katello-agent/goferd" on Katello 2.0 RC1, below the details:

#Issue1-EL6: "Non-fatal POSTIN scriptlet failure" during Kickstart Post-Install of katello-agent
#Issue2-EL6: "goferd" errors in messages during "service goferd start"
#Issue3-EL6: "Push Install Package" from Katello Server to EL6 Client is not performed, task is hanging on running/pending for ages (I think its related to the above issues)
#Issue4-EL7: "Push Install Package" from Katello Server to EL7 Client is performed ok, but Error in messages file is visible (not sure if it has a side effect)

*Issue1-EL6 ###
Starting goferdTraceback (most recent call last):
File "/usr/bin/goferd", line 17, in <module>
from gofer.agent.main import main
File "/usr/lib/python2.6/site-packages/gofer/agent/main.py", line 26, in <module>
LogHandler.install()
File "/usr/lib/python2.6/site-packages/gofer/agent/logutil.py", line 44, in install
handler = LogHandler(address='/dev/log', facility=SysLogHandler.LOG_DAEMON)
File "/usr/lib64/python2.6/logging/handlers.py", line 721, in init
self._connect_unixsocket(address)
File "/usr/lib64/python2.6/logging/handlers.py", line 737, in _connect_unixsocket
self.socket.connect(address)
File "<string>", line 1, in connect
socket.error: [Errno 111] Connection refused

*Issue2-EL6 ###
Sep 20 13:16:39 centos-6 goferd: [INFO][MainThread] gofer.agent.plugin:521 - plugin [builtin] loaded using: /usr/share/gofer/plugins/builtin.py
Sep 20 13:16:39 centos-6 goferd: [ERROR][MainThread] gofer.agent.plugin:535 - plugin "katelloplugin", import failed
Sep 20 13:16:39 centos-6 goferd: [ERROR][MainThread] gofer.agent.plugin:535 - Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/gofer/agent/plugin.py", line 519, in _import plugin.impl = imp.load_source(name, path) File "/usr/lib/gofer/plugins/katelloplugin.py", line 33, in <module> from subscription_manager.certlib import ConsumerIdentity ImportError: cannot import name ConsumerIdentity
Sep 20 13:16:39 centos-6 goferd: [INFO][Actions] builtin:38 - Hello: [main] enabled=1 [messaging] url= uuid=
Sep 20 13:16:39 centos-6 goferd: [INFO][MainThread] gofer.agent.main:136 - agent started.

*Issue3-EL6
"start_time"=>nil,
"state"=>"waiting"
3: Actions::Pulp::Consumer::ContentInstall (suspended) [ 1088.36s / 2.54s ]

*Issue4-EL7 ###
Sep 20 14:05:59 centos-7 goferd: [ERROR][worker-0] pulp.agent.lib.container:303 - handler "bind", import failed
Sep 20 14:05:59 centos-7 goferd: [ERROR][worker-0] pulp.agent.lib.container:303 - Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/pulp/agent/lib/container.py", line 297, in load mod = self.__import_module(path) File "/usr/lib/python2.7/site-packages/pulp/agent/lib/container.py", line 326, in __import_module mod = __import(path0, globals(), locals(), [path[-1]]) File "/usr/lib/python2.7/site-packages/pulp_rpm/handlers/bind.py", line 9, in <module> from pulp_rpm.handlers import repolib File "/usr/lib/python2.7/site-packages/pulp_rpm/handlers/repolib.py", line 12, in <module> from pulp.bindings.server import DEFAULT_CA_PATH ImportError: No module named bindings.server

best regards,
Christian


Related issues

Copied to Katello - Bug #7629: katello-agent/goferd: No module named bindings.server on package installRejected2014-09-20

Associated revisions

Revision fa9ed21e (diff)
Added by Eric Helms almost 8 years ago

Fixes #7553: Update ConsumerIdentity location.

Subscription manager library moved the location of ConsumerIdentity
that katello-agent relies on. Instead of being at:

subscription_manager.certlib

The ConsumerIdentity class looks like it is located at:

subscription_manager.identity

This fix should work for all versions of subscription-manager, not just
the latest.

Revision fa9ed21e (diff)
Added by Eric Helms almost 8 years ago

Fixes #7553: Update ConsumerIdentity location.

Subscription manager library moved the location of ConsumerIdentity
that katello-agent relies on. Instead of being at:

subscription_manager.certlib

The ConsumerIdentity class looks like it is located at:

subscription_manager.identity

This fix should work for all versions of subscription-manager, not just
the latest.

Revision ec028086
Added by Eric D Helms almost 8 years ago

Merge pull request #12 from ehelms/fixes-7553

Fixes #7553: Update ConsumerIdentity location.

Revision ec028086
Added by Eric D Helms almost 8 years ago

Merge pull request #12 from ehelms/fixes-7553

Fixes #7553: Update ConsumerIdentity location.

History

#1 Updated by Eric Helms almost 8 years ago

  • Target version set to 56
  • Difficulty set to medium
  • Triaged changed from No to Yes

#2 Updated by Justin Sherrill almost 8 years ago

  • Assignee set to Justin Sherrill

#3 Updated by Justin Sherrill almost 8 years ago

  • Status changed from New to Need more information

Hey Christian,

I am not able to reproduce issue #1, #2 or issue #4. (I think issue #3 is caused by #1 and #2).

Would you be able to send me (either by attaching in the issue or emailing), a sosreport from both the el6 and el7 clients as well as a foreman-debug from your foreman server?

Thanks

-Justin (jsherril < at > redhat.com)

#4 Updated by Xak Ru almost 8 years ago

some from /var/log/yum.log

Sep 23 18:16:33 Installed: PyPAM-0.5.0-12.el6.x86_64
Sep 23 18:16:34 Installed: python-gofer-1.3.0-1.el6.noarch
Sep 23 18:16:35 Installed: gofer-1.3.0-1.el6.noarch
Sep 23 18:16:36 Installed: python-qpid-common-0.26-2.el6.noarch
Sep 23 18:16:38 Installed: python-qpid-0.26-2.el6.noarch
Sep 23 18:16:38 Installed: python-gofer-qpid-1.3.0-1.el6.noarch
Sep 23 18:16:39 Installed: python-isodate-0.5.0-4.pulp.el6.noarch
Sep 23 18:16:40 Installed: python-pulp-common-2.4.0-1.el6.noarch
Sep 23 18:16:41 Installed: python-pulp-agent-lib-2.4.0-1.el6.noarch
Sep 23 18:16:42 Installed: python-pulp-rpm-common-2.4.0-1.el6.noarch
Sep 23 18:16:43 Installed: pulp-rpm-handlers-2.4.0-1.el6.noarch
Sep 23 18:16:46 Installed: katello-agent-2.0.0-1.el6.noarch

# /etc/init.d/goferd restart
Stopping goferd                                            [  OK  ]
Starting goferd                                            [  OK  ]
#cat /var/log/messages
Sep 23 19:33:02 client rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="1246" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
Sep 24 10:50:57 client goferd: [INFO][MainThread] gofer.agent.plugin:521 - plugin [builtin] loaded using: /usr/share/gofer/plugins/builtin.py
Sep 24 10:50:57 client goferd: [ERROR][MainThread] gofer.agent.plugin:535 - plugin "katelloplugin", import failed
Sep 24 10:50:57 client goferd: [ERROR][MainThread] gofer.agent.plugin:535 - Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/gofer/agent/plugin.py", line 519, in _import plugin.impl = imp.load_source(name, path) File "/usr/lib/gofer/plugins/katelloplugin.py", line 33, in <module> from subscription_manager.certlib import ConsumerIdentity ImportError: cannot import name ConsumerIdentity
Sep 24 10:50:57 client goferd: [INFO][Actions] builtin:38 - Hello:  [main] enabled=1  [messaging] url= uuid=admin@client.com
Sep 24 10:50:57 client goferd: [INFO][MainThread] gofer.agent.main:136 - agent started.
Sep 24 10:55:14 client goferd: [INFO][MainThread] gofer.agent.plugin:521 - plugin [builtin] loaded using: /usr/share/gofer/plugins/builtin.py
Sep 24 10:55:14 client goferd: [ERROR][MainThread] gofer.agent.plugin:535 - plugin "katelloplugin", import failed
Sep 24 10:55:14 client goferd: [ERROR][MainThread] gofer.agent.plugin:535 - Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/gofer/agent/plugin.py", line 519, in _import plugin.impl = imp.load_source(name, path) File "/usr/lib/gofer/plugins/katelloplugin.py", line 33, in <module> from subscription_manager.certlib import ConsumerIdentity ImportError: cannot import name ConsumerIdentity
Sep 24 10:55:14 client goferd: [INFO][Actions] builtin:38 - Hello:  [main] enabled=1  [messaging] url= uuid=admin@client.com
Sep 24 10:55:14 client goferd: [INFO][MainThread] gofer.agent.main:136 - agent started.
#ls /usr/share/gofer/plugins/
builtin.py  builtin.pyc  builtin.pyo
ll -a /usr/lib/gofer/plugins/
итого 44
drwxr-xr-x. 2 root root  4096 Сен 23 18:17 .
drwxr-xr-x. 3 root root  4096 Сен 23 18:16 ..
-rw-r--r--. 1 root root  9765 Сен 13 00:45 katelloplugin.py
-rw-r--r--. 2 root root 11739 Сен 13 00:45 katelloplugin.pyc
-rw-r--r--. 2 root root 11739 Сен 13 00:45 katelloplugin.pyo
cat /usr/lib/gofer/plugins/katelloplugin.py | head -n 35
#
# Copyright 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the implied warranties of MERCHANTABILITY,
# NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
# have received a copy of GPLv2 along with this software; if not, see
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
#

""" 
The katello agent plugin.
Provides content management APIs for pulp within the RHSM environment.
""" 

import os
import sys

sys.path.append('/usr/share/rhsm')

from yum import YumBase
from logging import getLogger, Logger

from gofer.decorators import *
from gofer.agent.plugin import Plugin
from gofer.pmon import PathMonitor
from gofer.agent.rmi import Context
from gofer.config import Config

from subscription_manager.certlib import ConsumerIdentity
from rhsm.connection import UEPConnection

#5 Updated by Xak Ru almost 8 years ago

I found this module in https://github.com/alikins/subscription-manager-docs/blob/master/subscription_manager.certlib
how to fix this error? In katello-agent 1.4 i don't see same errors. Only in katello-agent 2.0

#6 Updated by Christian Ehart almost 8 years ago

Logfile Information send via email to Justin

Justin Sherrill wrote:

Hey Christian,

I am not able to reproduce issue #1, #2 or issue #4. (I think issue #3 is caused by #1 and #2).

Would you be able to send me (either by attaching in the issue or emailing), a sosreport from both the el6 and el7 clients as well as a foreman-debug from your foreman server?

Thanks

-Justin (jsherril < at > redhat.com)

#7 Updated by Eric Helms almost 8 years ago

After talking to Xak, this appears to be an issue with the newest subscription manager. They moved the location of ConsumerIdentity that katello-agent relies on (https://github.com/candlepin/subscription-manager/commit/c641b59240e46274087f90ed2e85514fe18b9176). Instead of being at:

subscription_manager.certlib

The ConsumerIdentity class looks like it is located at:

subscription_manager.identity (https://github.com/candlepin/subscription-manager/blob/master/src/subscription_manager/identity.py#L28)

#8 Updated by Eric Helms almost 8 years ago

  • Status changed from Need more information to Ready For Testing
  • Pull request https://github.com/Katello/katello-agent/pull/12 added
  • Pull request deleted ()

#9 Updated by Xak Ru almost 8 years ago

Thnx!
Fixed!
In /usr/lib/gofer/plugins/katelloplugin.py
Change:

from subscription_manager.certlib import ConsumerIdentity

to

from subscription_manager.identity import ConsumerIdentity

thnx to Eric Helms and Oleg K.

#10 Updated by Christian Ehart almost 8 years ago

Hi Guys,

Issue 1-3: fixed, can be closed (thanks for the support)
Issue 4: open (see below)- not sure if it has a side effect

I´m getting now the same error in messages on EL6 as on EL7 (see Issue4-EL7)
...not sure if it has a side effect (Error in messages only happening after successfull Package Push):

Sep 24 19:26:56 centos-6 goferd: [INFO][worker-0] gofer.transport.qpid.broker:69 - connecting: {katello.cesystems.at:5671}:|transport=SSL|host=katello.cesystems.at|port=5671|cacert=/etc/rhsm/ca/candlepin-local.pem|clientcert=/etc/pki/consumer/bundle.pem|userid=None|password=None|vhost=None
Sep 24 19:26:56 centos-6 goferd: [INFO][worker-0] gofer.transport.qpid.broker:83 - {katello.cesystems.at:5671} connected to AMQP
Sep 24 19:26:56 centos-6 goferd: [INFO][worker-0] gofer.rmi.dispatcher:612 - call: Content.install() sn=a6a4d166-a233-40f1-823c-24681e213fb4 info={u'task_id': u'd1680a97-0d05-43b2-a1d1-1874760480aa', u'consumer_id': u'b7bbd660-7d06-4a27-b282-2bc73141b299'}
*Sep 24 19:26:56 centos-6 goferd: [ERROR][worker-0] pulp.agent.lib.container:303 - handler "bind", import failed
*Sep 24 19:26:56 centos-6 goferd: [ERROR][worker-0] pulp.agent.lib.container:303 - Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/pulp/agent/lib/container.py", line 297, in __load mod = self.__import_module(path) File "/usr/lib/python2.6/site-packages/pulp/agent/lib/container.py", line 326, in __import_module mod = __import__(path[0], globals(), locals(), [path[-1]]) File "/usr/lib/python2.6/site-packages/pulp_rpm/handlers/bind.py", line 9, in <module> from pulp_rpm.handlers import repolib File "/usr/lib/python2.6/site-packages/pulp_rpm/handlers/repolib.py", line 12, in <module> from pulp.bindings.server import DEFAULT_CA_PATH ImportError: No module named bindings.server
Sep 24 19:27:02 centos-6 goferd: [INFO][worker-0] gofer.agent.rmi:149 - sn=a6a4d166-a233-40f1-823c-24681e213fb4 processed in: 6.362 (seconds)

best regards,
Christian

#11 Updated by Justin Sherrill almost 8 years ago

Christian, see the comments above, there is a PR open to fix that issue (#4) https://github.com/Katello/katello-agent/pull/12

It should fix it for el6 and 7. It was introduced by a change to subscription-manager upstream.

#12 Updated by Christian Ehart almost 8 years ago

Hi Justin,

I implemented the PR on my system, this Workaround fixed Issue1-3, but not Issue4 !!!
Anyway, in the meantime I found the following for Issue4, see https://bugzilla.redhat.com/show_bug.cgi?id=1142376

In that case we can agree to close the ticket because we have an Bug Report for Pulp open which is targeted for Pulp Release 2.5.x

Thanks,
Christian

#13 Updated by Justin Sherrill almost 8 years ago

Ahh apologies, too many things floating around in my head. I still need to look at that issue, doing that now.

-Justin

#14 Updated by Eric Helms almost 8 years ago

  • Status changed from Ready For Testing to Closed

#15 Updated by Justin Sherrill almost 8 years ago

  • Copied to Bug #7629: katello-agent/goferd: No module named bindings.server on package install added

#16 Updated by Justin Sherrill almost 8 years ago

cloned to http://projects.theforeman.org/issues/7629 to handle the bindings error.

#17 Updated by Justin Sherrill almost 8 years ago

  • Bugzilla link set to 1146292

Also available in: Atom PDF