Bug 1158155

Summary: Proxy server does not support Ubuntu/Debian packages
Product: [Community] Spacewalk Reporter: David Holland <david.w.holland+bz>
Component: Proxy ServerAssignee: Michael Mráka <mmraka>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.2CC: david.w.holland+bz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-proxy-2.3.3-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-04-14 19:03:23 UTC Type: Bug
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: 1207293    
Attachments:
Description Flags
Trivial Debian Support none

Description David Holland 2014-10-28 18:20:03 UTC
Description of problem:
Configuring a Debian system to talk to Spacewalk via proxy server fails to download packages. 

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


How reproducible:
Configure Ubuntu client to talk to RHN via proxy server. 


Steps to Reproduce:
1.  Install Spacewalk
2.  Install Spacewalk Proxy
3.  Configure Ubuntu client to talk via Spacewalk Proxy.
3a.  Use the following packages for your Ubuntu clients:   https://launchpad.net/~mj-casalogic/+archive/ubuntu/spacewalk-ubuntu

Actual results:
root@repo-agent04:/usr/lib/apt/methods# apt-get install bash
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  bash-doc
The following packages will be upgraded:
  bash
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 641 kB of archives.
After this operation, 8,192 B disk space will be freed.
WARNING: The following packages cannot be authenticated!
  bash
Install these packages without verification [y/N]? y
Err spacewalk://<deleted>/ channels:/channel_default_ubuntu1204lts_x8664_security bash amd64 4.2-2ubuntu2.3
  404  Not Found
Failed to fetch spacewalk://<deleted>/XMLRPC/GET-REQ/channel_default_ubuntu1204lts_x8664_security/getPackage/bash-4.2-2ubuntu2.3.amd64-deb.deb  404  Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?


Expected results:
Package installation to succeed. 
Installation will succeed if the client is pointed directly at the Spacewalk server.


Additional info:

Turning on debugging in the broker log shows: 

2014/10/28 13:49:57 -04:00 3134 1.2.3.4: broker/rhnBroker.__callLocalRepository('GET-REQ', 'channel_default_ubuntu1204lts_x8664_security', 'getPackage', ['bash-4.2-2ubuntu2.3.amd64-deb.deb'])
2014/10/28 13:49:57 -04:00 3134 1.2.3.4: broker/rhnRepository.__init__('channel_default_ubuntu1204lts_x8664_security',)
2014/10/28 13:49:57 -04:00 3134 1.2.3.4: common/rhnRepository.__init__('channel_default_ubuntu1204lts_x8664_security',)
2014/10/28 13:49:57 -04:00 3134 1.2.3.4: broker/rhnBroker.__callLocalRepository("Calling getPackage(['bash-4.2-2ubuntu2.3.amd64-deb.deb'])",)
2014/10/28 13:49:57 -04:00 3134 1.2.3.4: common/rhnRepository.getPackage('bash-4.2-2ubuntu2.3.amd64-deb.deb',)
2014/10/28 13:49:57 -04:00 3134 1.2.3.4: broker/rhnRepository.getPackagePath('bash-4.2-2ubuntu2.3.amd64-deb.deb',)
2014/10/28 13:49:57 -04:00 3134 1.2.3.4: broker/rhnRepository._cacheObj('package_mapping:channel_default_ubuntu1204lts_x8664_security:', '20141021111613', ())
2014/10/28 13:49:57 -04:00 3134 1.2.3.4: broker/rhnRepository._getPkgListDir('/var/spool/rhn-proxy/list',)
2014/10/28 13:49:57 -04:00 3134 1.2.3.4: broker/rhnRepository.getPackagePath('ERROR', 'Package not in mapping: bash-4.2-2ubuntu2.3.amd64-deb.deb')
2014/10/28 13:49:57 -04:00 3134 1.2.3.4: proxy/apacheHandler.response('Response type', <class 'spacewalk.common.rhnException.rhnFault'>)
2014/10/28 13:49:57 -04:00 3134 1.2.3.4: common/rhnApache.logHandler
2014/10/28 13:49:57 -04:00 3134 1.2.3.4: proxy/apacheHandler.cleanupHandler
2014/10/28 13:49:57 -04:00 3134 1.2.3.4: common/rhnApache.cleanupHandler
2014/10/28 13:49:57 -04:00 3134 1.2.3.4: common/rhnApache.timer('Request served in 0.03 sec',)

Examining the package cache file: /var/spool/rhn-proxy/list/package_mapping:channel_default_ubuntu1204lts_x8664_security:-20141021111613  (via strings) 

[root@spacewalk-proxy01 list]# strings *ubuntu*
(U!bash-4.2-2ubuntu2.3.amd64-deb.rpmq
(Uhrhn/6ec/bash/4.2-2ubuntu2.3/amd64-deb/6ecda87f241b2aa325a7a6db6925af01/bash-4.2-2ubuntu2.3.amd64-deb.rpmq
UCrhn/bash/4.2-2ubuntu2.3/amd64-deb/bash-4.2-2ubuntu2.3.amd64-deb.rpmq
eU*bash-builtins-4.2-2ubuntu2.3.amd64-deb.rpmq
(Uzrhn/b2f/bash-builtins/4.2-2ubuntu2.3/amd64-deb/b2f6077dc75cf8f33fdf9353a2050a5e/bash-builtins-4.2-2ubuntu2.3.amd64-deb.rpmq
UUrhn/bash-builtins/4.2-2ubuntu2.3/amd64-deb/bash-builtins-4.2-2ubuntu2.3.amd64-deb.rpmq	eU(bash-static-4.2-2ubuntu2.3.amd64-deb.rpmq
(Uvrhn/fda/bash-static/4.2-2ubuntu2.3/amd64-deb/fda214b733937ad03285f6c780f5a0d7/bash-static-4.2-2ubuntu2.3.amd64-deb.rpmq
UQrhn/bash-static/4.2-2ubuntu2.3/amd64-deb/bash-static-4.2-2ubuntu2.3.amd64-deb.rpmq
eU!bash-4.2-2ubuntu2.1.amd64-deb.rpmq
(Uhrhn/e5d/bash/4.2-2ubuntu2.1/amd64-deb/e5d12ea045b762e6c62824acacc70e93/bash-4.2-2ubuntu2.1.amd64-deb.rpmq
UCrhn/bash/4.2-2ubuntu2.1/amd64-deb/bash-4.2-2ubuntu2.1.amd64-deb.rpmq

(Note all the "-deb.rpm" named files.) 

Further examination of the rhnRepository.py source code:   https://github.com/spacewalkproject/spacewalk/blob/master/proxy/proxy/broker/rhnRepository.py

Shows such code as:   (Line 234) 

            extension = "rpm"
            if isSolarisArch(arch):
                extension = "pkg"

There are other examples. 

So, if its not a Solaris package, it has to be a RPM?     

I know Ubuntu is the OS of choice for lemonade stand vendors, but unfortunately due to reasons beyond my control, we're stuck with it, and would prefer a centrally managed Spacewalk infrastructure using proxies, instead of standalone servers.

Comment 1 David Holland 2014-10-30 14:45:39 UTC
Created attachment 952174 [details]
Trivial Debian Support

Against the 2.2 branch.

Comment 2 David Holland 2014-10-30 14:49:19 UTC
Attached a trivial patch to the rhnRepository.py proxy code.   It works for the cases I could think to try..

I don't know what kind of a package might show up as a list type, so I had to ignore that case....   "Works for me"

Comment 3 Michael Mráka 2014-11-04 09:35:35 UTC
Patch committed to spacewalk master as
commit 4b80f0a3874d345207771e7b069922c5fe8eb51e
    1158155 - fixed renaming of deb packages

Comment 4 Grant Gainey 2015-03-23 16:59:12 UTC
Moving bugs to ON_QA as we move to release Spacewalk 2.3

Comment 5 Grant Gainey 2015-04-14 19:03:23 UTC
Spacewalk 2.3 has been released. See

https://fedorahosted.org/spacewalk/wiki/ReleaseNotes23