cobbler: 2.4.0 from epel-testing host : SL 6.43 64 bit
In http://cobbler.github.com/manuals/2.2.3/4/7_-_Package_Management_and_Mirrori... "Also apt" section, there is this example:
cobbler repo add --name=foo --mirror=http://url --breed=apt --arch=i386
So far, I have been using either ISO image import or apt-mirror to do direct Ubuntu mirror as debmirror was not available for RHEL for quite some time. But now since debmirror is on my cobbler server, so I decided to give cobbler's apt mirror a work-out:
[root@cobbler ~]# cobbler repo add --name=ubtest --mirror=http://us.archive.ubuntu.com --breed=apt --arch=x86_64 [root@cobbler ~]# cd /var/www/cobbler/ks_mirror [root@cobbler ks_mirror]# cobbler repo list [...] ubtest [...] [root@cobbler ks_mirror]# cobbler reposync task started: 2012-11-28_095927_reposync task started (id=Reposync, time=Wed Nov 28 09:59:27 2012) hello, reposync run, reposync, run! running: /usr/bin/debmirror --passive --nocleanup --method=http --host=us.archive.ubuntu.co --root=us.archive.ubuntu.co --dist=hive.ubuntu.com /var/www/cobbler/repo_mirror/ubtest --nosource -a amd64 received on stdout: gpgv: keyblock resource `/var/lib/cobbler/.gnupg/trustedkeys.gpg': No such file or directory gpgv: no valid OpenPGP data found. [GNUPG:] NODATA 1 [GNUPG:] NODATA 2 gpgv: the signature could not be verified. Please remember that the signature file (.sig or .asc) should be the first file given on the command line. Errors: Release gpg signature does not verify
received on stderr: rsync: failed to connect to us.archive.ubuntu.co: Connection timed out (110) rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.6] Warning: failed to use rsync to download extra files. [...]
So, the character 'm' in the us.archive.ubuntu.com got chopped off before the source hostname was fed to debmirror. Looks like there is an off-by-one error in action_reposync.py?
[...] 474 idx = mirror.find("://") 475 method = mirror[:idx] 476 mirror = mirror[idx+3:] 477 478 idx = mirror.find("/") 479 host = mirror[:idx] 480 mirror = mirror[idx+1:] 481 482 idx = mirror.rfind("/dists/") 483 suite = mirror[idx+7:] 484 mirror = mirror[:idx] 485 486 mirror_data = "--method=%s --host=%s --root=%s --dist=%s " % ( method , host , mirror , suite ) [...]
Regards,
-- Zack
OK. Upon reviewing the code once more, I could get around it for now:
[root@cobbler ks_mirror]# cobbler repo add --name=ubtest --mirror=http://archive.ubuntu.com/ --breed=apt --arch=x86_64
Then, I ran cobbler reposync as shown below. This time, as I anticipated, the 'm' in .com is perserved. But then cobbler didn't feed debmirror with enough defaults. So, IMHO there are still two bugs:
0. Usability. Often times, people forget to end a URL with a slash, so we need to accommodate this "habit". 1. Complete defaults should be provided to debmirror.
[root@cobbler ks_mirror]# cobbler reposync [...] running: /usr/bin/debmirror --passive --nocleanup --method=http --host=archive.ubuntu.com --root= --dist= /var/www/cobbler/repo_mirror/ubtest --nosource -a amd64 received on stdout: received on stderr: Option root requires an argument Option dist requires an argument Usage: /usr/bin/debmirror [options] <mirrordir>
For details, see man page.
Exception occured: <class 'cobbler.cexceptions.CX'> Exception value: 'cobbler reposync failed' Exception Info: File "/usr/lib/python2.6/site-packages/cobbler/utils.py", line 131, in die raise CX(msg)
Exception occured: <class 'cobbler.cexceptions.CX'> Exception value: 'cobbler reposync failed' Exception Info: File "/usr/lib/python2.6/site-packages/cobbler/action_reposync.py", line 125, in run self.sync(repo) File "/usr/lib/python2.6/site-packages/cobbler/action_reposync.py", line 171, in sync return self.apt_sync(repo) File "/usr/lib/python2.6/site-packages/cobbler/action_reposync.py", line 514, in apt_sync utils.die(self.logger,"cobbler reposync failed") File "/usr/lib/python2.6/site-packages/cobbler/utils.py", line 139, in die raise CX(msg)
reposync failed, tries left: 0 Exception occured: <class 'cobbler.cexceptions.CX'> Exception value: 'reposync failed, retry limit reached, aborting' Exception Info: File "/usr/lib/python2.6/site-packages/cobbler/utils.py", line 131, in die raise CX(msg)
Exception occured: <class 'cobbler.cexceptions.CX'> Exception value: 'reposync failed, retry limit reached, aborting' Exception Info: File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 89, in run rc = self._run(self) File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 251, in runner name=None, nofail=nofail, logger=self.logger) File "/usr/lib/python2.6/site-packages/cobbler/api.py", line 758, in reposync return reposync.run(name) File "/usr/lib/python2.6/site-packages/cobbler/action_reposync.py", line 147, in run utils.die(self.logger,"reposync failed, retry limit reached, aborting") File "/usr/lib/python2.6/site-packages/cobbler/utils.py", line 139, in die raise CX(msg)
!!! TASK FAILED !!! [...]
[...] 474 idx = mirror.find("://") 475 method = mirror[:idx] 476 mirror = mirror[idx+3:] 477 478 idx = mirror.find("/") 479 host = mirror[:idx] 480 mirror = mirror[idx+1:] 481 482 idx = mirror.rfind("/dists/") 483 suite = mirror[idx+7:] 484 mirror = mirror[:idx] 485 486 mirror_data = "--method=%s --host=%s --root=%s --dist=%s " % ( method , host , mirror , suite ) [...]
[...]
Regards,
-- Zack
Upon reviewing this section of code more:
[...] 474 idx = mirror.find("://") 475 method = mirror[:idx] 476 mirror = mirror[idx+3:] 477 478 idx = mirror.find("/") 479 host = mirror[:idx] 480 mirror = mirror[idx+1:] 481 482 idx = mirror.rfind("/dists/") 483 suite = mirror[idx+7:] 484 mirror = mirror[:idx] 485 486 mirror_data = "--method=%s --host=%s --root=%s --dist=%s " % ( method , host , mirror , suite ) [...]
I think now I know how to use this feature. In this case, I recommend to update the documentation so that the correct syntax is shown explicity.
Regards,
-- Zack
cobbler@lists.fedorahosted.org