[Spacewalk-list] mrepo / gensystemid errors

fnwsa at yahoo.com fnwsa at yahoo.com
Mon Aug 6 21:42:10 UTC 2012


Robert,
"so I’m not entirely sure but it looks like something got updated in the rhn libraries and mrepo needs to catch up.".

I believe so. Last Friday I tried to upgrade python to 2.7 from 2.6 and upgraded many packages. After that this issue occurs today. The gensystemid was working fine before that.
 

Nick



________________________________
 From: Alan Pittman <Alan.Pittman at publix.com>
To: "'Boyd, Robert'" <Robert.Boyd at peoplefluent.com>; "'fnwsa at yahoo.com'" <fnwsa at yahoo.com>; "'spacewalk-list at redhat.com'" <spacewalk-list at redhat.com> 
Sent: Monday, August 6, 2012 4:39:13 PM
Subject: RE: [Spacewalk-list] mrepo / gensystemid errors
 

 
Robert/Nick,
   Unfortunately, I’m not a Python expert, so when things like this crop up, I have to rely on Google searches. I did get a hit that implies that if you use an RHN userid and password that’s not set up, messages like what you are getting will occur. Can you verify that you are using the correct RHN information?
 
Alan
 
From:Boyd, Robert [mailto:Robert.Boyd at peoplefluent.com] 
Sent: Monday, August 06, 2012 4:26 PM
To: fnwsa at yahoo.com; spacewalk-list at redhat.com; Alan Pittman
Subject: RE: [Spacewalk-list] mrepo / gensystemid errors
 
Alan,
 
Here is some more information.   I inserted a print statement 
 
print "rpclib attributes: ", dir(rpclib)
 
just before where this error occurs and I get this:
 
rpclib attributes:  ['DictType', 'DictionaryType', 'GETServer', 'InvalidRedirectionError', 'ListType', 'MAX_REDIRECTIONS', 'MalformedURIError', 'RangeError', 'Server', 'SlicingMethod', 'StringType', 'TupleType', 'UnicodeType', 'UserDictCase', '_Method', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__version__', 'check_ipv6', 'getHeaderValues', 'get_proxy_info', 're', 'reportError', 'socket', 'split_host', 'sys', 'transports', 'urllib', 'xmlrpclib']
 
There is obviously no Fault attribute.   I wonder if somehow the wrong rpclib is being imported in the beginning of the code:
 
if os.path.exists('/usr/share/mrepo/up2date_client/'):
    sys.path.insert(-1, '/usr/share/mrepo/')
    sys.path.insert(-1, '/usr/share/mrepo/up2date_client/')
elif os.path.exists('/usr/share/rhn/up2date_client/'):
    sys.path.insert(-1, '/usr/share/rhn/')
    sys.path.insert(-1, '/usr/share/rhn/up2date_client/')
else:
    print >>sys.stderr, 'rhnget: up2date libraries are not installed. Aborting execution'
    sys.exit(1)
 
from up2date_client import config, rpcServer, up2dateErrors
from rhn import rpclib
 
Is it possible that somehow there are different rpclib modules in the Red Hat provided and the spacewalk kit?
 
I tried this:  grep rpclib /usr/share/rhn/*/*
 
What I notice is that the ONLY use of the .Fault attribute is in connection with xmlrpclib, not rpclib.   I also see that in one file there is a statement where they set rpclib = xmlrpclib.    
 
I’m a complete newbie with Python – so I’m not entirely sure but it looks like something got updated in the rhn libraries and mrepo needs to catch up.
 
Robert
 
 
From:spacewalk-list-bounces at redhat.com [mailto:spacewalk-list-bounces at redhat.com] On Behalf Of fnwsa at yahoo.com
Sent: Monday, August 06, 2012 1:18 PM
To: Alan Pittman; 'spacewalk-list at redhat.com'
Subject: Re: [Spacewalk-list] Repository URL?
 
Hi Alan,
 
Your answer is the the right one. ' mrepo -uvvv' started working. It's so great1 Thank you very much again!
 
Now I've got a new issue that really drove me crazy: gensystemid was working fine last Friday, but stop working this morning. It's probably because I messed up some python stuff when doing the mrepo issue troubleshooting. Here is the error:
 
# gensystemid -r 5Server -a i386 /var/mrepo/rhel5Server-i386
/usr/share/mrepo/up2date_client/up2dateUtils.py:16: DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import md5 ((this error seems ok))
RHN Username:
RHN Password:
Traceback (most recent call last):
  File "/usr/bin/gensystemid", line 270, in <module>
    main()
  File "/usr/bin/gensystemid", line 244, in main
    except rpclib.Fault, f:
AttributeError: 'module' object has no attribute 'Fault'
 
From this error, I can't decide which packages should be uninstalled/reinstalled to fix the new problem. Please help! Thanks!
 
nz

________________________________
 
From:Alan Pittman <Alan.Pittman at publix.com>
To: "'fnwsa at yahoo.com'" <fnwsa at yahoo.com>; "'spacewalk-list at redhat.com'" <spacewalk-list at redhat.com> 
Sent: Monday, August 6, 2012 7:48:51 AM
Subject: RE: [Spacewalk-list] Repository URL?
 
Nick,
   I did a search on _use_datetime and mrepo. I found a website called github that had some information related to mrepo and a python module called transports.py. It appears a update was made by adding the following (highlighted in red below):
 
class Transport(xmlrpclib.Transport):
    user_agent = "rhn.rpclib.py/%s" % __version__
    _use_datetime = False
 
    def __init__(self, transfer=0, encoding=0, refreshCallback=None,
            progressCallback=None):
        self._transport_flags = {'transfer' : 0, 'encoding' : 0}
        self.set_transport_flags(transfer=transfer, encoding=encoding)
        self._headers = UserDictCase()
        self.verbose = 0
        self.connection = None
        self.method = "POST"
        self._lang = None
        self.refreshCallback = refreshCallback
        self.progressCallback = progressCallback
        self.bufferSize = 16384
        self.headers_in = None
        self.response_status = None
        self.response_reason = None
        self._redirected = None
 
I am running mrepo-0.8.7-4.el6 and haven’t seen this problem, but I added the line to my transports.py file anyhow and ran a test download. It seems to work okay. You might want to give this a try. I can’t say that this is the answer, but it’s worth a shot.
 
Alan
 
 
From:fnwsa at yahoo.com [mailto:fnwsa at yahoo.com] 
Sent: Friday, August 03, 2012 5:03 PM
To: fnwsa at yahoo.com; Alan Pittman; 'spacewalk-list at redhat.com'; spacewalk-list at redhat.com
Subject: Re: [Spacewalk-list] Repository URL?
 
I've made a small mrepo.conf, but got the same errors.
 
AttributeError: SafeTransport instance has no attribute '_use_datetime'
mrepo: Mirroring failed for rhns:///rhel-i386-server-5 with message:
Failed with return code: 256
 
The error '_use_datetime' needs to be fixed. 
 
-----------------------------------------
# cat /etc/mrepo.conf
[main]
srcdir = /var/mrepo.new
wwwdir = /var/www/mrepo
confdir = /etc/mrepo.conf.d
arch = i386

mailto = root at localhost
smtp-server = localhost

rhnlogin = xxxxxxxx:xxxxxxxx
lftp-commands = set hftp:use-head 0

[rhel-server-5-i386]
name = Red Hat Advanced Server $release ($arch)
release = 5
arch = i386

updates = rhns:///rhel-$arch-server-5
supplementary = rhns:///rhel-$arch-server-$repo-5
rhn-tools = rhns:///$repo-rhel-$arch-server-5

rpmforge = http://apt.sw.be/redhat/el$release/en/$arch/RPMS.dag/
elrepo = http://elrepo.org/linux/elrepo/el5/$arch/
spacewalk = http://spacewalk.redhat.com/yum/1.7/RHEL/5/i386/
------------------------------------------------

Thank you & have a good weekend! 
 
nz

________________________________
 
From:"fnwsa at yahoo.com" <fnwsa at yahoo.com>
To: Alan Pittman <Alan.Pittman at publix.com>; "'spacewalk-list at redhat.com'" <spacewalk-list at redhat.com> 
Sent: Friday, August 3, 2012 4:17:42 PM
Subject: Re: [Spacewalk-list] Repository URL?
 
Alan,
Here is the info:
 
# ls -l /var/mrepo/
total 24
drwxr-xr-x  2 root root 4096 Aug  4  2010 all
drwxr-xr-x 10 root root 4096 Aug  3 16:04 rhel5c-i386
drwxr-xr-x  2 root root 4096 Aug  3 14:08 rhel5Server-i386
drwxr-xr-x  2 root root 4096 Aug  3 14:12 rhel5Server-x86_64
drwxr-xr-x 10 root root 4096 Aug  3 16:05 rhel5s-i386
drwxr-xr-x  6 root root 4096 Aug  3 16:07 rhel-server-5-x86_64
(Each directory has its own systemid file created)
 
# cat /etc/mrepo.conf
[main]
srcdir = /var/mrepo
wwwdir = /var/www/mrepo
confdir = /etc/mrepo.conf.d
arch = i386

mailto = root at localhost
smtp-server = localhost

rhnlogin = rhnuserid:rhnpasswd
lftp-commands = set hftp:use-head 0

### Any other section is considered a definition for a distribution
### You can put distribution sections in /etc/mrepo.conf.d/
### Examples can be found in the documentation at:
### /usr/share/doc/mrepo-0.8.7/dists/.

### Additional repositories
updates = rhns:///rhel-$arch-server-5
# vt = rhns:///rhel-$arch-server-$repo-5
supplementary = rhns:///rhel-$arch-server-$repo-5
# fastrack = rhns:///rhel-$arch-server-$repo-5
# hts = rhns:///rhel-$arch-server-$repo-5
rhn-tools = rhns:///$repo-rhel-$arch-server-5

### RPMforge repository
# rpmforge = rsync://apt.sw.be/pub/freshrpms/pub/dag/redhat/el$release/en/$arch/RPMS.dag/
#rpmforge = ftp://apt.sw.be/pub/dag/pub/redhat/el$release/en/$arch/RPMS.dag/
rpmforge = http://apt.sw.be/redhat/el$release/en/$arch/RPMS.dag/

### EPEL repository
# EPEL = http://mirror.chpc.utah.edu/pub/epel/$release/$arch/
EPEL = http://mirror.metrocast.net/fedora/epel/5/x86_64/

### ELrepo repository
#elrepo-testing = http://elrepo.org/linux/testing/el5/$arch/
elrepo = http://elrepo.org/linux/elrepo/el5/$arch/

### Custom repository for your own RPM packages
mondo = http://www.mondorescue.org/ftp/rhel/5/x86_64
spacewalk = http://spacewalk.redhat.com/yum/1.7/RHEL/5/x86_64
spacewalk = http://spacewalk.redhat.com/yum/1.7/RHEL/5/i386/
 
# ls /etc/mrepo.conf.d
rhel5c.conf  rhel5s.conf
 
Thank you!
 
nz

________________________________
 
From:Alan Pittman <Alan.Pittman at publix.com>
To: "'fnwsa at yahoo.com'" <fnwsa at yahoo.com>; "'spacewalk-list at redhat.com'" <spacewalk-list at redhat.com> 
Sent: Friday, August 3, 2012 3:59:26 PM
Subject: RE: [Spacewalk-list] Repository URL?
 
Nick,
  Did you run the gensystemid command? If so, where does the systemid file reside? 
 
You should have a separate ID for each version and architecture that you want to download.
 
I created 4 IDs. They reside in the base (source) directories where mrepo stores the RPMs for each version/architecture.
 
/clonefs/6Server-i386/systemid
/clonefs/6Server-x86_64/systemid
/clonefs/5Server-i386/systemid
/clonefs/5Server-x86_64/systemid
 
In my mrepo.conf file, /clonefs is the srcdir= location and the  6Server-i386, 6Server-x86_64, etc, equate to the sections headers.
 
From my config file:
[5Server-x86_64]
name = Red Hat Enterprise Server ($release) ($arch)
release = 5
arch = x86_64
metadata = repomd repoview
iso = /clonefs/5Server-x86_64/rhel-server-5.7-x86_64-dvd.iso
 
[5Server-i386]
name = Red Hat Enterprise Server ($release) ($arch)
release = 5
arch = i386 
metadata = repomd repoview
iso = /clonefs/5Server-i386/rhel-server-5.7-i386-dvd.iso
 
[6Server-x86_64]
name = Red Hat Enterprise Server ($release) ($arch)
release = 6
arch = x86_64
metadata = repomd repoview
iso = /clonefs/6Server-x86_64/rhel-server-6.0-x86_64-dvd.iso
 
[6Server-i386]
name = Red Hat Enterprise Server ($release) ($arch)
release = 6
arch = i386 
metadata = repomd repoview
iso = /clonefs/6Server-386/rhel-server-6.0-i386-dvd.iso
 
 
Alan
 
 
 
From:fnwsa at yahoo.com [mailto:fnwsa at yahoo.com] 
Sent: Friday, August 03, 2012 3:36 PM
To: Alan Pittman; 'spacewalk-list at redhat.com'
Subject: Re: [Spacewalk-list] Repository URL?
 
Alan,
Thank you again for your help!
I have done mrepo configuration, but failed at 'mrepo -uvvv' with lots of errors like:
---------------------------------------------------------------------------
AttributeError: SafeTransport instance has no attribute '_use_datetime'
mrepo: Mirroring failed for rhns:///rhel-i386-server-vt-5 with message:
Failed with return code: 256
---------------------------------------------------------------------------
It looks like a datetime issue.
 
# date
Fri Aug  3 15:27:10 EDT 2012
# rpm -q rhpl
rhpl-0.221-2.el6.rf.x86_64

I've googled a lot but haven't found a solution yet. Any help will be greatly appreciated!
nz

________________________________
 
From:Alan Pittman <Alan.Pittman at publix.com>
To: "'fnwsa at yahoo.com'" <fnwsa at yahoo.com>; "'spacewalk-list at redhat.com'" <spacewalk-list at redhat.com> 
Sent: Friday, August 3, 2012 9:24:43 AM
Subject: RE: [Spacewalk-list] Repository URL?
 
Nick,
  Unfortunately, Spacewalk won’t/can’t connect to RHN. What mrepo will do is connect(logon) to RHN and pull all of the RPMs and place them in a series on directories. With the appropriate options, mrepo will then create a local repository which then can be used to populate the Spacewalk database.
 
Follow the steps to install mrepo (if you haven’t already) and run the gensystemid script (should be one of the steps in the install doc). Once that’s done, you’ll have to create or update the mrepo.conf file. Here’s a portion of mine so that you have an idea what to configure:
 
root at taeps001 etc]# cat ./mrepo.conf
### Configuration file for mrepo
 
### The [main] section allows to override mrepo's default settings
### The mrepo-example.conf gives an overview of all the possible settings
[main]
srcdir = /clonefs   
wwwdir = /var/www/mrepo
confdir = /etc/mrepo.conf.d
arch = i386 x86_64
 
mailto = root at localhost
smtp-server = localhost
 
rhnlogin = <rhnuserid>:<rhnpassword>
 
### Any other section is considered a definition for a distribution
### You can put distribution sections in /etc/mrepo.conf.d/
### Examples can be found in the documentation at:
### /usr/share/doc/mrepo-0.8.7/dists/.
 
[5Server-x86_64]
name = Red Hat Enterprise Server ($release) ($arch)
release = 5
arch = x86_64
metadata = repomd repoview
iso = /clonefs/5Server-x86_64/rhel-server-5.7-x86_64-dvd.iso
 
### Additional repositories
updates = rhns:///rhel-$arch-server-5
# vt = rhns:///rhel-$arch-server-$repo-5
supplementary = rhns:///rhel-$arch-server-$repo-5
# fastrack = rhns:///rhel-$arch-server-$repo-5
# hts = rhns:///rhel-$arch-server-$repo-5
rhn-tools = rhns:///$repo-rhel-$arch-server-5
 
### RPMforge repository
# rpmforge = rsync://apt.sw.be/pub/freshrpms/pub/dag/redhat/el$release/en/$arch/RPMS.dag/
#rpmforge = ftp://apt.sw.be/pub/dag/pub/redhat/el$release/en/$arch/RPMS.dag/
rpmforge = http://apt.sw.be/redhat/el$release/en/$arch/RPMS.dag/
 
### EPEL repository
# EPEL = http://mirror.chpc.utah.edu/pub/epel/$release/$arch/
EPEL = http://mirror.metrocast.net/fedora/epel/5/x86_64/ 
 
### ELrepo repository
elrepo = http://elrepo.org/linux/elrepo/el5/$arch/
#elrepo-testing = http://elrepo.org/linux/testing/el5/$arch/
 
### OpenVZ repositories
#ovzkernel = http://download.openvz.org/kernel/rhel5/
#ovztemplate = http://download.openvz.org/template/
#ovzutils = http://download.openvz.org/utils/
 
### Fedora EPEL packages (incompatible with RPMforge)
#epel = http://download.fedora.redhat.com/pub/epel/$release/$arch/
 
### Custom repository for your own RPM packages
mondo = http://www.mondorescue.org/ftp/rhel/5/x86_64
spacewalk = http://spacewalk.redhat.com/yum/1.7/RHEL/5/x86_64
 
 
From:fnwsa at yahoo.com [mailto:fnwsa at yahoo.com] 
Sent: Friday, August 03, 2012 9:07 AM
To: Alan Pittman; 'spacewalk-list at redhat.com'
Subject: Re: [Spacewalk-list] Repository URL?
 
Hi Alan,
 
Thank you very much for your very helpful reply!!
 
My purpose is to patch all of our RHEL5x/6x systems, so I need to "connect to RHN and download all of the available RPMS and populate your Spacewalk repository" as you said. Please correct me if I am wrong here.
 
I've just installed mrepo, but still don't understand the whole picture. With mrepor's help, can Spacewalk connect directly to the RHN servers? What URL should be used in the Repository URL? Yes, I have RHN userid and password.
 
Have a nice day!
 
Nick
 

________________________________
 
From:Alan Pittman <Alan.Pittman at publix.com>
To: "'fnwsa at yahoo.com'" <fnwsa at yahoo.com>; "'spacewalk-list at redhat.com'" <spacewalk-list at redhat.com> 
Sent: Thursday, August 2, 2012 9:42:35 PM
Subject: RE: [Spacewalk-list] Repository URL?
 
Nick,
   When I click on the link, the browser takes me to the repodata sub-directory. When I tried backing up a couple of levels, I never saw any RPMs. 
 
Can I assume that you want to connect to RHN and download all of the available RPMS and populate your Spacewalk repository? If so, you’ll have to download and install a utility called mrepo because Spacewalk doesn’t have the ability to connect directly to the RHN servers. 
 
Also,  must also have a valid RHN userid and password for mrepo to connect. 
 
aep
 
 
From:spacewalk-list-bounces at redhat.com [mailto:spacewalk-list-bounces at redhat.com] On Behalf Of fnwsa at yahoo.com
Sent: Thursday, August 02, 2012 5:01 PM
To: spacewalk-list at redhat.com
Subject: [Spacewalk-list] Repository URL?
 
Hi, I am now trying to create my first Repository for RHEL 6 (64bit) systems. Can I use the following link as Repository URL in  Spacewalk's Create New Repository page?

ftp://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/x86_64/Debuginfo/repodata/

If it's not the right one, where can I find it?

Thank  you in advance!

Nick
 
 
 

_______________________________________________
Spacewalk-list mailing list
Spacewalk-list at redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20120806/98cc58b0/attachment.htm>


More information about the Spacewalk-list mailing list