Bug 68347

Summary: rhn_check is broken [AttributeError: 'module' object has no attribute 'getServer']
Product: [Retired] Red Hat Public Beta Reporter: Markku Kolkka <markku.kolkka>
Component: up2dateAssignee: Adrian Likins <alikins>
Status: CLOSED RAWHIDE QA Contact: Jay Turner <jturner>
Severity: medium Docs Contact:
Priority: medium    
Version: limboCC: aleksey, gafton, mihai.ibanescu, nwsmith, srevivo
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-08-19 18:58:27 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:
Bug Depends On:    
Bug Blocks: 67217    

Description Markku Kolkka 2002-07-09 13:40:05 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020625

Description of problem:
I managed to register my Limbo system to Red Hat Network, but the system status
page showed that the system isn't checking in. Rhnsd is running, so I tried
rhn_check manually and got the error:
# rhn_check -v
/usr/sbin/rhn_check:0: SyntaxWarning: name 'ACTION_VERSION' is assigned to
before global declaration
/usr/sbin/rhn_check:0: SyntaxWarning: name 'Status' is assigned to before global
declaration
Traceback (most recent call last):
  File "/usr/sbin/rhn_check", line 229, in ?
    server = up2date.getServer()
AttributeError: 'module' object has no attribute 'getServer'


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.run rhn_check
2.
3.
	

Actual Results:  Program fails immediately, doesn't check in with server.

Additional info:

Comment 1 Aleksey Nogin 2002-07-18 23:06:14 UTC
*** Bug 68301 has been marked as a duplicate of this bug. ***

Comment 2 Adrian Likins 2002-07-18 23:09:12 UTC
fixed in cvs

Comment 3 Markku Kolkka 2002-07-23 09:22:27 UTC
I upgraded to up2date-2.9.17-7.x.9 from ftp://people.redhat.com/misa/fixes, and
rhn_check is still broken, but with different error messages:

# rhn_check -v
/usr/sbin/rhn_check:0: SyntaxWarning: name 'ACTION_VERSION' is assigned to
before global declaration
/usr/sbin/rhn_check:0: SyntaxWarning: name 'Status' is assigned to before global
declaration
Adding cert <X509Name object '/C=US/ST=North Carolina/L=Research Triangle
Park/O=Red Hat, Inc./OU=Red Hat Network Services/CN=RHNS Certificate
Authority/Email=rhns'>
Adding cert <X509Name object '/C=US/ST=North Carolina/L=Research Triangle
Park/O=Red Hat, Inc./OU=Red Hat Network Services/CN=RHNS Certificate
Authority/Email=rhns'>
Traceback (most recent call last):
  File "/usr/sbin/rhn_check", line 262, in ?
    action = server.queue.get(up2dateAuth.getSystemId(), ACTION_VERSION, Status)
  File "/usr/lib/python2.2/xmlrpclib.py", line 821, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.2/site-packages/rhn/rpclib.py", line 122, in _request
    verbose=self._verbose
  File "/usr/lib/python2.2/site-packages/rhn/transports.py", line 117, in request
    headers, fd = req.send_http(host, handler)
  File "/usr/lib/python2.2/site-packages/rhn/transports.py", line 563, in send_http
    self._connection.connect()
  File "/usr/lib/python2.2/site-packages/rhn/connections.py", line 172, in connect
    self.sock.init_ssl()
  File "/usr/lib/python2.2/site-packages/rhn/SSL.py", line 90, in init_ssl
    store.add_cert(cert)
crypto.Error: [('x509 certificate routines', 'X509_STORE_add_cert', 'cert
already in hash table')]


Comment 4 Michael Young 2002-07-23 11:12:17 UTC
Check what version of rhnlib you are using. I think I have seen an rhnlib bug
elsewhere on bugzilla/limbo mailling list somewhat similar to that.

Comment 5 Markku Kolkka 2002-07-23 11:30:47 UTC
rhnlib-0.8-8

Comment 6 Nigel Smith 2002-07-23 21:02:22 UTC
Just tried rhn_check -v 
with up2date-2.9.20 and rhnlib-0.8.10
from ftp://people.redhat.com/misa/fixes/
and it is still broken as per markku.kolkka's comment.
(But up2date -p seems fixed ok)

Comment 7 Adrian Likins 2002-07-24 08:10:26 UTC
just tracked this down, apparently adding the same cert to
a server twice breaks things. 

Just fixed this in rhn_check, though I might consider
this a bug against rhnlib. But closing this one out,
since it's getting away from $SUMMARY

should be fixed in 2.9.26 or higher

Comment 8 Nigel Smith 2002-07-25 20:25:44 UTC
I have now installed up2date-2.9.28 and rhnlib-0.8.11 
If I try: 
#rhn_check -v
I now just get:

/usr/sbin/rhn_check:0: SyntaxWarning: name 'ACTION_VERSION' is assigned to 
before global declaration
/usr/sbin/rhn_check:0: SyntaxWarning: name 'Status' is assigned to before 
global declaration

with no Python traceback.


Comment 9 Aleksey Nogin 2002-07-30 20:03:00 UTC
Yes, it does work (although it still prints the warnings). With rhnlib-0.8-11
and up2date-2.9.30-7.x.9, I get (after scheduling a package refresh):

# rhn_check -v
/usr/sbin/rhn_check:0: SyntaxWarning: name 'ACTION_VERSION' is assigned to
before global declaration
/usr/sbin/rhn_check:0: SyntaxWarning: name 'Status' is assigned to before global
declaration
Adding cert <X509Name object '/C=US/ST=North Carolina/L=Research Triangle
Park/O=Red Hat, Inc./OU=Red Hat Network Services/CN=RHNS Certificate
Authority/Email=rhns'>
Adding cert <X509Name object '/C=US/ST=North Carolina/L=Research Triangle
Park/O=Red Hat, Inc./OU=Red Hat Network Services/CN=RHNS Certificate
Authority/Email=rhns'>
handle_action actionid = 5245508, version = 2
Adding cert <X509Name object '/C=US/ST=North Carolina/L=Research Triangle
Park/O=Red Hat, Inc./OU=Red Hat Network Services/CN=RHNS Certificate
Authority/Email=rhns'>
Sending back response: (0, 'rpmlist refreshed', {})
Adding cert <X509Name object '/C=US/ST=North Carolina/L=Research Triangle
Park/O=Red Hat, Inc./OU=Red Hat Network Services/CN=RHNS Certificate
Authority/Email=rhns'>
Adding cert <X509Name object '/C=US/ST=North Carolina/L=Research Triangle
Park/O=Red Hat, Inc./OU=Red Hat Network Services/CN=RHNS Certificate
Authority/Email=rhns'>


Comment 10 Jay Turner 2002-08-19 18:58:21 UTC
Reopening as I'm getting the following when running 'rhn_check -v' with
up2date-2.9.46-1:

[haring (root):~]# rhn_check -v
/usr/sbin/rhn_check:0: SyntaxWarning: name 'ACTION_VERSION' is assigned to
before global declaration
/usr/sbin/rhn_check:0: SyntaxWarning: name 'Status' is assigned to before global
declaration


Comment 11 Adrian Likins 2002-08-21 23:22:07 UTC
fixed in 2.9.52 or so