Registering Ubuntu and Debian Servers with Spacewalk

You probably have heard of Spacewalk, the systems management solution for RHEL / CentOS and other RedHat-based systems.
It provides and manages content / package updates for all your servers along with some other features like kickstarting / bootstrapping nodes, audits and some simple config management if you dont run Chef or Puppet or similar.

However, did you know that you can meanwhile also (fully) manage your Debian/Ubuntu systems with Spacewalk ? Documentation on this is still sparse and you have to figure out certain things on your own.
Read on after the jump how to completly setup and configure Spacewalk 2.2 to work with Ubuntu clients. Including Errata !

Setup

This article only shows the Debian/Ubuntu specific things you need to know, a general Spacewalk installation needs to be done beforehand, see https://fedorahosted.org/spacewalk/wiki/HowToInstall

Server

Create channels with ‘Architecture’ set to ‘amd64-debian’ and ‘Yum Repository Checksum Type’ to SHA256. For Ubuntu 12.04 (Precise Pangolin) I name them:

  • precise # Thats the parent channel of the following
  • precise-updates
  • precise-security
  • precise-backports

For Ubuntu 14.04 (Trusty Tahr) you would rather call them ‘trusty’

Enable epel-testing and

yum update python-debian

In /usr/lib/python2.6/site-packages/debian/debfile.py patch PART_EXTS = [gz, bz2, xz, lzma] to include lzma.
Meanwhile, after months of waiting, others + my patches finally made it upstream. So make sure you get python-debian-0.1.27-3 or higher from epel-testing EPEL repo.

Use https://github.com/stevemeier/spacewalk-debian-sync to get packages into the channels as Spacewalks reposync cant handle APT repos yet.
I meanwhile did my own Python version / port. So get https://github.com/philicious/spacewalk-scripts/blob/master/debianSync.py . Its faster than the Perl version. Its a drop-in replacement for Steves script.

./debianSync.py --username admin --password 'XXX' --channel 'precise' --url 'http://de.archive.ubuntu.com/ubuntu/dists/precise/main/binary-amd64/'
./debianSync.py --username admin --password 'XXX' --channel 'precise-updates' --url 'http://de.archive.ubuntu.com/ubuntu/dists/precise-updates/main/binary-amd64/'
./debianSync.py --username admin --password 'XXX' --channel 'precise-security' --url 'http://us.archive.ubuntu.com/ubuntu/dists/precise-security/main/binary-amd64/'

Thats already it for the Server side. Now get some clients registered with Spacewalk.

Clients

Ubuntu 12.04

For Ubuntu 12.04 there are no official packages, so I built them. Its better to build them for 12.04 rather than adding apt source from a higher release because you will end up with alot dependency and version problems of other packages. You can easily build them by yourself on a 12.04 machine:

apt-get install debhelper build-essential gcc devscripts git intltool quilt automake python-all-dev libnl-route-3-dev asciidoc pkg-config libxml2-utils docbook-xml xsltproc sgml-data docbook-xsl
apt-get -f install

git clone git://anonscm.debian.org/collab-maint/spacewalk/rhnlib.git
git clone git://anonscm.debian.org/collab-maint/spacewalk/rhn-client-tools.git rhn-client-tools
git clone git://anonscm.debian.org/collab-maint/spacewalk/python-ethtool.git python-ethtool
git clone git://anonscm.debian.org/collab-maint/spacewalk/rhnsd.git rhnsd
git clone git://anonscm.debian.org/collab-maint/spacewalk/apt-spacewalk.git

# now in every of these directories do:
debuild -i -us -uc -b
# If all 5 packages are built, the debs are found at ../, now install
dpkg -i *.deb
apt-get -f install

Ubuntu 14.04, 13.10, 13.04

For these releases, the packages are available from ‘universe’ repo but they are outdated so the above is suggested.

All Ubuntu

Note: Patching xmlrpclib.py is only necessary for rhn-client-tools  <=1.8.26-3 . Since version 1.8.26-4 you can skip this.

We need to fix a bug in python XMLRPCLib:

--- /usr/lib/python2.7/xmlrpclib.py 2013-05-28 20:44:38.000000000 +0200
+++ new/xmlrpclib.py 2013-05-28 20:44:24.000000000 +0200
@@ -654,8 +654,8 @@
f(self, value, write)

def dump_nil (self, value, write):
- if not self.allow_none:
- raise TypeError, "cannot marshal None unless allow_none is enabled"
+# if not self.allow_none:
+# raise TypeError, "cannot marshal None unless allow_none is enabled"
write("<value><nil/></value>")
dispatch[NoneType] = dump_nil

Now we can register with the Spacewalk server

apt-get install python-libxml2
mkdir /var/lock/subsys
rhnreg_ks --activationkey=1-ubuntu12.04-key --serverUrl=http://spacewalk.hc.lan/XMLRPC

You can now use Spacewalk as central APT repository

echo 'deb spacewalk://spacewalk.hc.lan/XMLRPC channels: precise-main precise-updates' > /etc/apt/sources.list.d/spacewalk.list
mv /etc/apt/sources.list /etc/apt/sources.list.bak
apt-get update

So far everything could be googled together from different sources. Btw this article also applies for Debian systems.
In the next upcoming article I will however show you how to get Errata automatically imported into Spacewalk from the Ubuntu security mailing list http://www.ubuntu.com/usn/ and https://lists.ubuntu.com/archives/ubuntu-security-announce/

    • Robert
    • November 10th, 2014 4:50pm

    Thanks for this! I’ve got one question, however. After syncing repos to my spacewalk server and registering my Ubuntu machine, it seems like apt is pulling down empty repos. On the spacewalk web gui, I can see a package (e.g. git), but apt-cache search does not find that package.

    I can see apt-get update pulling down a package list, but it is only 20B (which seems really small…). Any idea why this might be?

    root@ubuntu:/etc/apt# apt-get clean
    root@ubuntu:/etc/apt# apt-get update
    Apt-Spacewalk: Updating sources.list
    WARNING:root:could not open file ‘/etc/apt/sources.list’


    Get:1 spacewalk:// channels:/main amd64 Packages [20 B]

    Fetched 40 B in 5s (7 B/s)
    Reading package lists… Done

      • phil
      • November 11th, 2014 12:21pm

      hm for me it pulls more than 20B. Maybe check your firewall/iptables settings on client and spacewalk server.

      root@ubuntu:/etc/apt/sources.list.d# apt-get update
      Apt-Spacewalk: Updating sources.list

      Get:1 spacewalk://spacewalk.hc.lan channels:/main amd64 Packages [1,923 kB]

      Fetched 5,441 kB in 7s (680 kB/s)
      Reading package lists… Done

        • Robert
        • November 12th, 2014 6:38pm

        Thanks. Turns out I needed to upgrade spacewalk to 2.2 (was on 2.1 or 2.0, i believe) and then delete/re-sync the ubuntu repository.

    • Robert
    • November 14th, 2014 9:35pm

    In case this happens to anyone else:

    After syncing repos and registering my ubuntu server to spacewalk, I was getting “unmet dependencies” errors when attempting to do anything with apt-get.
    root@ubuntu:/etc/apt# apt-get install git
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    You might want to run ‘apt-get -f install’ to correct these:
    The following packages have unmet dependencies:
    dh-python : Depends: python3:any (>= 3.3.2-2~) but it is not installable
    git : Depends: liberror-perl but it is not going to be installed
    Depends: git-man (> 1:1.9.1) but it is not going to be installed
    Depends: git-man (= 3.3.2-2~) but it is not installable
    python-apt : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable

    E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).

    In the end, I had to move and touch /var/lib/dpkg/status

    root@ubuntu:~ cd /var/lib/dpkg/
    root@ubuntu:/var/lib/dpkg# mv status status.bad
    root@ubuntu:/var/lib/dpkg# touch status
    root@ubuntu:/var/lib/dpkg# apt-get clean
    root@ubuntu:/etc/apt# apt-get install git
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    The following extra packages will be installed:

    Need to get 39.5 MB of archives.
    After this operation, 175 MB of additional disk space will be used.
    Do you want to continue? [Y/n] n

      • phil
      • November 17th, 2014 11:14am

      Although I didn’t encounter that problem, thanks for the hint! Probably will save me or others valuable hours :p

      • matus
      • January 30th, 2015 5:00pm

      If you clean the status file, you will break dpkg, your system will not know what packages are installed.

      try to run:

      dpkg -l python

      It will probably get “dpkg-query: no packages found matching python” even though python is installed.

      The issue you having is a bug in spacewalk and I don’t think it was reported yet.

      It took me a week to figure it out that spacewalk is not populating full package metadata. Because flag “Multi-Arch” is missing in python and python3 metadata, apt-get thinks that dependencies are not met.

      Basically, same issue as Debian use to have when Multi-Arch was introduced: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=723586

      In this case spacewalk is creating metadata during repo sync and Multi-Arch flag is ignored.

      you can compare Packages file from spacewalk in /var/cache/rhn/repodata/main_trusty/ on your spacewalk server with one from ubuntu repository.

      I can confirm if I manually add “Multi-Arch: allowed” into python and python3 in /var/cache/rhn/repodata/main_trusty/Packages and create Packages.gz, “apt-get update && apt-get upgrade” works. However, this is not a solution, as this files will be overwritten with new versions of python.

      Until this is fixed in spacewalk, workaround may be keeping sources.list with ubuntu repos enabled.

      Hope this help

        • Ranjith
        • September 21st, 2015 6:03pm

        Hi Matus,

        Is any fix released for this issue.? I was looking for a patch management solution for my ubuntu 14.04 desktops. We have evaluated multiple options like apt-cache , spacewalk and we were about to finalize the spacewalk. During implementation only we find out this issue. Every desktop direct internet connection is not feasible in our environment. Please help me to find any stable patch management tool for my 14.04 desktops or any fix for Python error during upgrade with spacewalk.

        • litewhatever
        • November 11th, 2016 7:23am

        Hello

        I know this issue is old but it is currently hitting me on ubuntu 14.04 🙂
        Did you report this to upstream?
        Could you elaborate it a bit – does the original Packages in ubuntu upstream have this parameter?

        Regards,
        Kristjan

    • Christian
    • December 10th, 2014 12:14pm

    Hi There,

    thanks for your great manual!
    I’ve got the Spacewalk Client running on Ubuntu 14, but I’ve got problems with 12.
    First of all, the path to the GIT is not correct. I get the GIT with

    git clone http://alioth.debian.org/anonscm/git/collab-maint/spacewalk/ ….

    The compilation and installation goes without probs. But after the client registration, I get the error message

    in /var/log/up2date I’ve got
    up2date Warning: haldaemon or messagebus service not running. Cannot probe hardware and DMI information.
    [Wed Dec 10 12:48:33 2014] up2date
    Traceback (most recent call last):
    File “/usr/sbin/rhnreg_ks”, line 218, in
    cli.run()

    File “/usr/lib/python2.7/xmlrpclib.py”, line 658, in dump_nil
    raise TypeError, “cannot marshal None unless allow_none is enabled”
    : cannot marshal None unless allow_none is enabled

    Any suggestion?

    The Client ist registering correctly on the spacewalk server, but after apt-get update the package list is not transferred to server.

    Another Question:
    is there a DEB-Version available of the management daemon RHNMD ?

      • Christian
      • December 10th, 2014 12:30pm

      ah, I’m sorry, I forgot to edit
      usr/lib/python2.7/xmlrpclib.py

      Now it’s running.

      But another Question:
      is there a DEB-Version available of the management daemon RHNMD ?

      -christian

        • phil
        • December 10th, 2014 2:11pm

        For me, the git clone with the repo URLs from the article are working.

        There is no official rhnmd available. However you can try to build it for debian. Chances are good that its not to hard to port.

        Personally I dont use Spacewalk for monitoring so I didnt care.

  1. Hey any thoughts on how to get the configuration modules working?? My ubuntu 14.04 machine shows up and is registered, but the spacewalk configuration deployment does not seem to be enabled.

      • phil
      • December 16th, 2014 11:54am

      I havent tried it out but configuration management needs “rhncfg rhncfg-actions rhncfg-client” packages on the client to work properly. However these packages are not ported to debian/ubuntu yet so your best chance is to try building them from source for debian. They might work out of the box or with simple changes.

      (to be honest I never used Spacewalks config management. Neither with RedHat nor with Ubuntu as its rudimentary and way better doing this with Puppet, Chef etc..)

  2. I have a question.

    With debian. I noticed the package rhncfg-actions are not installed. I believe these are needed in order to do remote command executions and run scripts.

    Were you able to get this function working for debian clients? If so how may I install that package? It doesnt seem to be on the apt sources or on this blog? :0

    Cheers

    Nick Tailor

    • Willi
    • January 8th, 2015 10:40am

    Hi,
    I’m just a bit confused:
    I sync the Ubuntu-mirrors to channels as described in your instruction (this takes me about 10hours). But how can I force spacewalk to check the official-ubuntu-repos for newer packages to sync?
    I can’t use the “repo-sync” option, as this works only for yum-repos, right?

    Thanks for your help.

      • phil
      • January 8th, 2015 11:08am

      Hi,
      I wasnt clear about this in the article. You simply do cronjobs for the spacewalk-debian-sync.pl commands. When the scripts is re-run, it will compare already synced packages against the package list from the repo.

      And yes you are right, the “repo-sync” tool and option does only work and apply for yum repos.

    • Willi
    • January 9th, 2015 11:03am

    Hi,

    I encounter 3 other very strange problems:
    1. I set the client to an interval of 60 minutes in /etc/rhnsd but it doesn’t pull anything from the server. Anyone got an answer to this?

    2. When I try to install a package (select from web-gui and schedule it), the client is removing lots of stuff including all rhn-packages. WHY? Or better: Did anyone encouter this problems?

    3. Spacewalk tells me, that there are updates available for the server, I select them, but when I run “rhn_check” (to force the client to ask the server), I got the following:
    “Apt-Spacewalk: Updating sources.list
    WARNING:root:could not open file ‘/etc/apt/sources.list'”
    And in the Spacewalk log for this update I found:
    “Client execution returned “update failed” (code 1)”
    Anyone got an idea for these errors?

    Thanks for the help and time in advance.

      • phil
      • January 9th, 2015 1:58pm

      I didnt encounter that yet. Try running rhn_check -vv on the client after you scheduled an update

        • Willi
        • January 9th, 2015 2:13pm

        I get the following output and the only error I can see is, that he is “unable to open the timestamp file”. Can you imagine, which file he is referring to in this case?

        >>>
        D: do_call packages.checkNeedUpdate(‘rhnsd=1’,){}
        D: local action status: (0, ‘unable to open the timestamp file’, {})
        D: rpcServer: Calling XMLRPC registration.welcome_message
        <<<

          • phil
          • January 9th, 2015 3:57pm

          the “timestamp” message is fine. I also get that. I dont even think its an error.

          Your output looks exactly like mine when there are no actions for this host.

            • Willi
            • January 10th, 2015 9:53am

            So you mean, he doesn’t recognize, that there are actions for this host?
            I mean basically, spacewalk tells me that there are updates available and shows me the installed packages and this is fine so far.
            But es already mentioned in the initial question, the client doesn’t pull to infos (interval is set to 61) and if I force him to pull the updates, nothing happens.
            If I select a package-installation (e.g. alien) just for testing the funtionality and force the client to pull the actions, he installs alien but uninstalls a lot of other things, including rhn-packages, which are needed for the operation.
            On the internet, I can’t find any hint to solve this problem. And this page is the only very good source for information about spacewalk and ubuntu.

            • phil
            • January 11th, 2015 3:07pm

            Unless you schedule an update installation the clients won’t update anything.

            If it uninstalls rhn-packages then there is something wrong in apt. rhn_check just uses apt. So run “apt install some_package” manually and see why it wants to uninstall rhn-packages. Maybe they werent installed correctly.

            • Willi
            • January 13th, 2015 9:22am

            I scheduled an update and an installation for some packages.
            But for some reason, the client doesn’t pull the information from the server. Ports are opened, interval set to 61, all mirrors are synced to the spacewalk server.

            Maybe the uninstall was due to I did not sync the universe-repo to the spacewalk-server. I will try again, when the 35524 packages are synced.

          • christian
          • February 24th, 2015 10:12am

          Hi Willi,

          I’ve got a solution:
          sometimes apt-get update breaks and lists are not downloaded correctly.

          And then if you try to apply an errata from spacewalk which has some dependencies to a paket within a corrupt list, it fails.

          Try to download the list again, after success you can apply the errata.

          -chris

      • Jarrad
      • January 13th, 2015 10:07am

      I’m encountering all 3 of these problems also. To get past #1 I just run rhn_check on a cron. #2 is of the most concern. It ended up removing half of the packages on the system rendering it unusable.

      I’m running Ubuntu 14.04LTS

        • James M.
        • May 17th, 2016 4:17am

        Anyone have a fix for this. I had #2 happen to 2 of our production machines…

    • Brandt Tullis
    • January 22nd, 2015 9:21pm

    Thanks to spacewalk-debian-sync.pl , my Ubuntu hosts are successfully checking in with SpaceWalk. Here is the issue:
    -In SpaceWalk GUI, I select an Ubuntu host and “upgrade packages”
    -The updates install and a green check appears by the system – 0 packages available.
    -On the system, apt-get -u upgrade shows 22 package upgrades available:

    root@NUSTWPAPPTST02:/home/admin-tbwa# apt-get -u upgrade
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Calculating upgrade… Done
    The following packages will be upgraded:
    bind9-host bsdutils dnsutils file gcc-4.9-base iputils-ping
    iputils-tracepath language-pack-en libbind9-90 libdns100 libevent-2.0-5
    libgcc1 libisc95 libisccc90 libisccfg90 liblwres90 libmagic1 ntpdate
    python3-distupgrade python3-update-manager ubuntu-release-upgrader-core
    update-manager-core
    22 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    Need to get 1,834 kB of archives.
    After this operation, 545 kB of additional disk space will be used.
    Do you want to continue? [Y/n] n
    Abort.

    Do I need to create another Ubuntu channel to cover these packages? Here is my crontab -e contents on the Spacewalk server:

    0 23 * * * spacewalk-debian-sync.pl –username admin-spacewalk –password gDl64AiKK13ad –channel trusty-security –url ‘http://gb.archive.ubuntu.com/ubuntu/dists/trusty-security/main/binary-amd64/’

    30 23 * * * spacewalk-debian-sync.pl –username admin-spacewalk –password gDl64AiKK13ad –channel trusty-updates –url ‘http://gb.archive.ubuntu.com/ubuntu/dists/trusty-updates/main/binary-amd64/’

    0 0 * * * spacewalk-debian-sync.pl –username admin-spacewalk –password gDl64AiKK13ad –channel trusty –url ‘http://gb.archive.ubuntu.com/ubuntu/dists/trusty/main/binary-amd64/’

    Thanks for your time!

      • phil
      • January 23rd, 2015 10:58am

      Are you sure apt-transport-spacewalk is installed correctly?
      When I run rhn_check or apt I see this:

      root@ubuntu:/home/phil# rhn_check
      Apt-Spacewalk: Updating sources.list
      …do stuff
      Apt-Spacewalk: Updating package profile

      Also do ‘apt-cache policy some_package’ on the packages it wants to upgrade to see from where that update is available and check if that version really is synced to Spacewalk. No matter if you dont use Spacewalk as your repo source you still need it synced so systems package list can be compared against potential updates.

        • Brandt Tullis
        • January 23rd, 2015 3:56pm

        apt-transport-spacewalk is installed from Ubuntu repository, along with the patch for xmlrpclib.py. rhn_check yields “updating sources.list” and “updating package profile.” Thanks for the apt-cache policy command. All of the packages not getting installed are in the spacewalk repo, in channels from which other packages are being installed. I can find the package when browsing the channel in the GUI – such a package lists no available machines. Also, I can browse the systems and find the current version of the package listed as installed…

      • matus
      • January 30th, 2015 5:42pm

      All the packages that are not updating are listed as the Extra Packages in Spacewalk.

      This is actually few bugs in Spacewalk, during repository sync spacewalk is splitting version of the packages into epoch, version, and release. However, Debian/Ubuntu version format is bit messy and not always detected right by spacewalk. So far I have found three possible combinations of version names that will break.

      1. if the release is “0” spacewalk will cut the “0” from the version and replace it with “X”, however ubuntu client will still report it as “0” and dont appear as the same. You can see them in repository

      2. some package versions contain multiple hyphens (in my case I found two: dialog and libedit2). For example package “dialog” is installed as version 1.2-20130928-1, but spacewalk stores it as 1.2-20130928 and therefore they appear different.

      3. If epoch exist in package version (ie 2:1.3.123-1), spacewalk client reports epoch, while spacewalk server ignores it. Again, packages are not recognized as the same.

      I have workaround for all three issues, but not sure if it wont break functionality, neither if it is acceptable change. But it may help someone to fix following bugs.

      Basically, I have disabled epoch and release and parsing whole version. I have deleted the whole repository and resync again. Now all my packages have release “X” and empty epoch, but all packages are recognized and updating (so far)

      !!!DON’T do following on production server those changes will be overwritten bu spacewalk upgrade and break the spacewalk channels!!!

      If you want to test it, edit:
      /usr/lib/python2.6/site-packages/spacewalk/common/rhn_deb.py
      and comment out couple of lines:

      —beginning—

      # version_tmpArr = version.split(‘-‘)
      # if len(version_tmpArr) == 1:
      self.hdr[‘version’] = version
      self.hdr[‘release’] = “X”
      # elif len(version_tmpArr) == 3:
      # self.hdr[‘version’] = ‘-‘.join(version_tmpArr[:-1])
      # self.hdr[‘release’] = version_tmpArr[-1]
      # else:
      # self.hdr[‘version’] = version
      # self.hdr[‘release’] = “”
      # self.hdr[‘version’] = version_tmpArr[0]
      # self.hdr[‘release’] = version_tmpArr[1]

      —end—

      this will cause repo sync to set release as “X” (epoch is already ignored) and parse whole version from metadata as version into spacewalk database.

      and on client side, you need to do the same thing by editing:
      /usr/share/rhn/up2date_client/debUtils.py

      and changing following block to look like this:

      —beginning—

      def parseVRE(version):
      epoch = ”
      release = ‘X’
      # if version.find(‘:’) != -1:
      # epoch, version = version.split(‘:’)
      # if version.find(‘-‘) != -1:
      # tmp = version.split(‘-‘)
      # version = ‘-‘.join(tmp[:-1])
      # release = tmp[-1]
      return version, release, epoch

      —end—

      Then delete all packages from the spacewalk channels and resync repositories again.

      After that all packages should be recognized.

      Hope this helps

      regards
      Matus

        • Brandt Tullis
        • February 11th, 2015 6:23pm

        Thanks for your reply! I followed your instructions. My rhn_deb.py is missing 5 lines compared to yours. Mine looks like:

        #version_tmpArr = version.split(‘-‘)
        #if len(version_tmpArr) == 1:
        self.hdr[‘version’] = version
        self.hdr[‘release’] = “X”
        #else:
        #self.hdr[‘version’] = version_tmpArr[0]
        #self.hdr[‘release’] = version_tmpArr[1]

        My spacewalk-debian-syn fails:

        INFO: Repo URL: http://us.archive.ubuntu.com/ubuntu/dists/trusty/main/binary-amd64/
        INFO: Ubuntu root is http://us.archive.ubuntu.com/ubuntu/
        INFO: Fetching Packages.gz… done
        INFO: Packages in repo: 8566
        INFO: Packages already synced: 4
        INFO: Packages to sync: 8562
        INFO: 1/8562 : sosreport_3.1-1ubuntu2_amd64.deb
        While running ‘packages.channelPackageSubscriptionBySession’: caught
        : ‘NoneType’ object is unsubscriptable

        I understand scripting but cannot debug this OOP code. Any assistance would be greatly appreciated!

          • matus
          • February 16th, 2015 2:38pm

          Hi Brandt,

          my mistake, I was messing with the rhn_deb.py file and had some leftover stuff there. I have removed my commented changes and here is a diff:

          73,79c73,84
          < version_tmpArr = version.split('-')
          < if len(version_tmpArr) == 1:
          < self.hdr['version'] = version
          < self.hdr['release'] = "X"
          < else:
          < self.hdr['version'] = version_tmpArr[0]
          # version_tmpArr = version.split(‘-‘)
          > # if len(version_tmpArr) == 1:
          > self.hdr[‘version’] = version
          > self.hdr[‘release’] = “X”
          > # else:
          > # self.hdr[‘version’] = version_tmpArr[0]
          > # self.hdr[‘release’] = version_tmpArr[1]

          I had to re-running sync couple of times cleared all the error messages for me. Although, I’m not sure if I had the same error message.

          Good luck

        • Pedro Andujar
        • June 11th, 2015 10:32am

        Thank you matus for this info. This also affects to ERRATA reports. What I did, using spacewalk 2.3 is leave the server as it is (rhn_deb.py remains untouched) and just changed the debUtils.py to do the same as the server does:

        def parseVRE(version):
        epoch = ”
        version_tmpArr = version.split(‘-‘)
        if len(version_tmpArr) == 1 :
        version = version
        release = ‘X’
        return version, release, epoch

        else:
        version = version_tmpArr[0]
        release = version_tmpArr[1]
        return version, release, epoch

        This is working fine for me, and new errata alerts are appearing because now its able to recognise the version, which is a good thing.

        Reindexed old errata reports to make this work.

        Cheers

    • Klaas Demter
    • January 23rd, 2015 12:55pm

    Hey, I think the right solution is to work the other way around with the xmlrpc lib. The default behaviour is supposed to be not to allow_none. In this case you should modify the rhnlib file and leave the system python packages as is:
    diff rhnlib/rhn/rpclib.py.old rhnlib/rhn/rpclib.py
    232c232
    return xmlrpclib.dumps(params, methodname, encoding=self._encoding, allow_none=True)

    • matus
    • January 30th, 2015 5:50pm

    for anyone who is getting loots of emails from spacewalk “Spacewalk TRACEBACK from spacewalk.example.org” with error message:

    Extra information about this error:
    Response sent back to the caller:
    While running ‘repodata’: caught
    : repodata() takes exactly 2 arguments (3 given)

    On client machine create file /etc/apt/apt.conf or new file in apt.conf.d and add following:

    Acquire::Pdiffs “false”;

    this will disable apt to check for repodata/Packages.diff/Index in the repository , that doesn’t exist in spacewalk

      • phil
      • January 31st, 2015 12:44pm

      Ah thanks ! These Traceback mails were really annoying and irritating me whether sth was broken or not but everything seemed to work fine. Already reported it https://bugzilla.redhat.com/show_bug.cgi?id=1187189

      Also thank you very much for your other really helpful comments !
      (In case you are using my Errata script ‘parseUbuntu.py’, I updated it 3 days ago fixing an important bug. So be sure to get latest version)

        • James M.
        • May 7th, 2016 3:15am

        Has anyone tried this fix?

        I created a new file in /etc/apt/apt.conf.d/00spacewalk with one line:

        Acquire::Pdiffs “false”;

        This doesn’t seen to fix the problem. When I run rhn_check on the client, I am still spammed with emails.

    • Marc
    • February 3rd, 2015 9:42am

    Is there a way to also register Ubuntu 10.04 clients? Tried to compile the packages like for 12.04 but have unmet dependencies. Then I installed python 2.7.5, but got still unmet dependencies

      • phil
      • February 3rd, 2015 12:40pm

      I havent tried it. But compiling like for 12.04 is the right approach. You can compare the unmet dependencies with the available versions and change them in the debian/control file and try to compile.

    • Bernd Zeimetz
    • February 13th, 2015 9:22am

    The xmlrpclib.py patch is seriously wrong as it will submit broken package information to spacewalk. Fixing the installTime function in rhn-client-tools is the proper fix, taking the package form jessie helps.

    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=728365

      • phil
      • February 13th, 2015 4:23pm

      I already updated the article about this patch being obsolete with the correct rhn-client-tools version.
      I got the xmlrpclib.py patch from a mailinglist or something before it was fixed in the rhn-client-tools and it worked fine.
      Should I re-import all packages without the xmlrpclib patch if you say the patch submitted broken package information? (However the packages seemed fine in Spacewalk and also Errata is working great for them)

      On a side-note: could you help getting the missing client packages into debian/ubuntu repos? (rhncfg, pyjabber, osad; built by Martin Juhl https://launchpad.net/~mj-casalogic/+archive/ubuntu/spacewalk-ubuntu/+packages)

    • boss
    • March 15th, 2015 3:19pm

    ./spacewalk-debian-sync.pl –username admin –password ‘xxx’ –channel ‘ubuntu14base’ –url ‘http://de.archive.ubuntu.com/ubuntu/dists/trusty/main/binary-amd64/’
    INFO: Repo URL: http://de.archive.ubuntu.com/ubuntu/dists/trusty/main/binary-amd64/
    INFO: Ubuntu root is http://de.archive.ubuntu.com/ubuntu/
    INFO: Fetching Packages.gz… done
    INFO: Packages in repo: 8566
    INFO: Packages already synced: 9
    INFO: Packages to sync: 8557
    INFO: 1/8557 : language-pack-gnome-mt-base_14.04+20140410_all.deb
    ERROR: /tmp/language-pack-gnome-mt-base_14.04+20140410_all.deb: This file doesn’t appear to be a package
    ERROR: rhnpush failed

    am i missing anything ?

      • phil
      • March 16th, 2015 11:55am

      you might have missed to edit /usr/lib/python2.6/site-packages/debian/debfile.py and patch PART_EXTS = [‘gz’, ‘xz’, ‘lzma’] to include lzma.

        • Will
        • February 29th, 2016 4:35am

        I edited the /usr/lib/python2.6/site-packages/debian/debfile.py file and i still get the same error. Any idea ?

          • phil
          • February 29th, 2016 5:32pm

          which error exactly ?

            • Will
            • March 1st, 2016 9:20pm

            [root@upr-spacewalk-01 ]# ./debianSync.py -u admin -p ‘XXX’ –channel ubuntu -r ‘http://mirror.aarnet.edu.au/pub/ubuntu/archive/dists/trusty/main/binary-amd64/’
            INFO: Repo URL: http://mirror.aarnet.edu.au/pub/ubuntu/archive/dists/trusty/main/binary-amd64/
            INFO: Repo root: http://mirror.aarnet.edu.au/pub/ubuntu/
            INFO: Packages in repo: 8567
            INFO: Packages synced: 0
            INFO: Packages to sync: 8567
            INFO: 1/8567: account-plugin-aim_3.8.6-0ubuntu9_amd64.deb
            ERROR: rhnpush [ rhnpush -c ubuntu -u admin -p XXX /tmp/account-plugin-aim_3.8.6-0ubuntu9_amd64.deb ] failed: (”, “ERROR: /tmp/account-plugin-aim_3.8.6-0ubuntu9_amd64.deb: This file doesn’t appear to be a package\n”)

            • phil
            • March 2nd, 2016 1:29pm

            I’m sorry, the line should read PART_EXTS = [‘gz’, ‘bz2’, ‘xz’, ‘lzma’]
            Pls try with also the “bz2” in the list

    • Stefan Ivanov
    • March 16th, 2015 7:57am

    Hey all,
    good guide but i have problem with Ubuntu 14.04. Wen i push from Spacewalk to install some package and force “rhn_check -v” Spacewalk remove packages and i need to reinstall the mashine 🙂 any ides.
    Regards. Stefan

      • phil
      • March 16th, 2015 11:57am

      run apt-get install your_package manually. If apt wants to remove packages its because of a previous package install wasnt successful so you need to fix that. not related to Spacewalk usually

        • Stefan Ivanov
        • March 16th, 2015 3:06pm

        Hey,
        here is the resulte.
        tension@ubuntu:~/pkg$ sudo apt-get install b43-fwcutter
        Reading package lists… Done
        Building dependency tree
        Reading state information… Done
        You might want to run ‘apt-get -f install’ to correct these:
        The following packages have unmet dependencies:
        apt-xapian-index : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
        dh-python : Depends: python3:any (>= 3.3.2-2~) but it is not installable
        landscape-common : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
        language-selector-common : Depends: python3:any (>= 3.3.2-2~) but it is not installable
        lsb-release : Depends: python3:any (>= 3.3.2-2~) but it is not installable
        python-apt : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
        python-chardet : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
        python-configobj : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
        python-dbus : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
        python-debian : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable

        E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).

        everything is installed correctly. I thing spacewalk change packages name?
        Regards. Stefan

          • phil
          • March 16th, 2015 3:27pm

          problem is with python package. you need to install python >= 2.7.1 but for some reason your apt cant find it. try apt-get update and apt-cache policy python

            • Stefan Ivanov
            • March 18th, 2015 10:53am

            Hey there,
            after i put back original repo everything is ok no problems with my python.
            apt-cache policy python
            python:
            Installed: 2.7.5-5ubuntu3
            Candidate: 2.7.5-5ubuntu3
            Version table:
            *** 2.7.5-5ubuntu3 0
            500 spacewalk://192.168.22.3/ channels:/main amd64 Packages
            100 /var/lib/dpkg/status
            Regards Stefan.

    • Brian
    • March 19th, 2015 7:58pm

    Hi, I am greatly appreciative of this script. I am running into an issue syncing repos. I keep getting tracebacks that say the device is running out of space. So i modified the script to use /var/tmp instead of /tmp (/var/tmp has 30GB free which should be plenty of space). I get a 500 internal error from the console, and a no more space on device error from the traceback. What do you think is going on?

      • phil
      • March 19th, 2015 8:11pm

      Thats a problem with the space on your Spacewalk server where it stores the packages. Thats why you get these traceback mails and see error 500 in the script. (I cutted your log because its not relevant anymore)

    • Raj
    • March 30th, 2015 5:37pm

    I am running a nightly build 2.3 with Oracle 11g backend. I get the following while trying to import the Ubuntu packages.

    ./spacewalk-debian-sync.pl –username admin –password ‘admin’ –channel ‘precise’ –url ‘http://de.archive.ubuntu.com/ubuntu/dists/precise/main/binary-amd64/’
    INFO: Repo URL: http://de.archive.ubuntu.com/ubuntu/dists/precise/main/binary-amd64/
    INFO: Ubuntu root is http://de.archive.ubuntu.com/ubuntu/
    INFO: Fetching Packages.gz… done
    INFO: Packages in repo: 8076
    INFO: Packages already synced: 0
    INFO: Packages to sync: 8076
    INFO: 1/8076 : language-pack-si_12.04+20120417_all.deb
    Internal Server Error
    ERROR: rhnpush failed

    [Mon Mar 30 10:17:49 2015] [error] Spacewalk 828 2015/03/30 10:17:49 -07:00: (‘Unhandled exception’, InvalidArchError(‘Invalid channel architecture 514’,))

      • phil
      • March 31st, 2015 9:13am

      Hi, I havent tested Debian repos with Spacewalk 2.3 yet so I cant says anything. I’ll test in next weeks and update my Blog as soon as I have something useful.

        • Raj
        • March 31st, 2015 3:37pm

        Hi Phil,

        Thank you for that.

        Cheers,

        Raj

          • phil
          • April 1st, 2015 3:48pm

          I now tested this with Spacewalk 2.3 from nightly repo and its working. I used postgresql backend but that is not of importance here. My guess is, your channel architecture is set wrong in Spacewalk. Be sure it is “AMD64 Debian”

            • Raj
            • April 2nd, 2015 11:20pm

            Hmm…That is strange. I just did a re-install of SW with a nightly build and Oracle 11g backend. I am still facing the same issue.

            • Raj
            • April 15th, 2015 10:16pm

            I noticed that, when you try to sync the Ubuntu repository from a master SW server to a slave SW server, it doesn’t sync. Later when you try to upload packages to the slave SW server using your script, it fails with the error I reported earlier.

            • phil
            • April 16th, 2015 9:25am

            I never tried Ubuntu / Debian support with Spacewalk Proxy servers. I might do that somewhen in the future.

  3. Thanks for this!

    I created a PPA to simplify the client install process on 12.04 and 14.04 — basically removing the compilations and python library edit:

    https://launchpad.net/~aaronr/+archive/ubuntu/spacewalk

    • Justin C
    • July 9th, 2015 5:24pm

    Does anyone use it for Ubuntu and CentOS? I’ve been working on getting Ubuntu working and think I am close. So now I’m adding CentOS and when I click to sync the repo I get:

    “The scheduling service appears down. Please contact your Satellite administrator.”

      • phil
      • July 9th, 2015 5:34pm

      yes I have both CentOS and Ubuntu channels/clients in one Spacewalk. Your error message sounds like taskomatic isnt running. Check “Admin->Task Engine Status” or do a “spacewalk-service restart”

    • purnima
    • August 4th, 2015 4:12pm

    I get this error
    mount: no media found on /dev/sr0

    and it does not loads. a=Any thoughts?

      • phil
      • August 4th, 2015 4:46pm

      please be more specific what you are doing when getting this error

    • A Person
    • August 13th, 2015 11:44am

    Thanks for the great tutorial. We’ve managed to get Ubuntu 14.04 clients registered with Spacewalk successfully.

    The catch is, that when you run apt-get update, it seems to be throwing up a 404 error. That’s despite having the packages successfully synchronised into the channels.

    Some example errors we get:

    W: Failed to fetch spacewalk://FQDN/dists/channels:/main/binary-amd64/Packages 404 Not Found
    W: Failed to fetch spacewalk://FQDNdists/channels:/ubuntu-14.04-core/binary-amd64/Packages 404 Not Found
    W: Failed to fetch spacewalk://FQDN/dists/channels:/ubuntu-14.04-security/binary-amd64/Packages 404 Not Found
    W: Failed to fetch spacewalk://FQDN/dists/channels:/ubuntu-14.04-universe/binary-amd64/Packages 404 Not Found
    W: Failed to fetch spacewalk://FQDN/dists/channels:/ubuntu-14.04-updates/binary-amd64/Packages 404 Not Found

    Any suggestions on where it would be good to look into what’s causing the problem?

    Thanks for any help you can give.

      • phil
      • August 13th, 2015 12:42pm

      Spacewalk server is responsible for routing these requests. Check path /var/cache/rhn/repodata/ where there should be a folder per channel and in there files “Packages” and “Packages.gz”

        • A Person
        • August 13th, 2015 4:56pm

        Weirdly, without touching anything, it’s started working. I’m guessing there was some task that hadn’t completed / run at that point.

        The folder all have the expected contents now. Thanks for the pointers anyway.

    • Tevfik
    • October 30th, 2015 7:34pm

    Hi,
    On ubuntu client registering step, I get an error and couldn’t find solution:
    ###########################################################################
    rhnreg_ks –activationkey=1-445800092fd1efd0e8c390e7ef9466bc –serverUrl=http://spacewalk.yasar.lnx/XMLRPC
    ###########################################################################

    An error has occurred:
    ###########################################################################
    The certificate /usr/share/rhn/RHNS-CA-CERT is expired. Please ensure you have the correct certificate and your system time is correct.
    See /var/log/up2date for more information
    ###########################################################################

    Any Idea?
    Best regards,

      • phil
      • November 3rd, 2015 11:48am

      This sounds like a general issue and unrelated to client OS. Could you please check your /etc/rhn/up2date file for the key sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT . This is the correct line. You might have /usr/share/rhn/RHNS-CA-CERT there. If you dont have RHN-ORG-TRUSTED-SSL-CERT you can wget it from http://your.spacewalk/pub/RHN-ORG-TRUSTED-SSL-CERT

        • Tevfik
        • November 3rd, 2015 12:26pm

        I did but not work. Then re-install spacewalk.
        Now i have another problem. I dont know why.
        [root@spacewalk spacewalk]# ./spacewalk-debian-sync.pl –username admin –password ‘blabla’ –channel ‘trusty’ –url

        INFO: Packages to sync: 8566
        INFO: 1/8566 : checkbox-ng-service_0.3-2_all.deb

        ERROR: unhandled exception occurred: (mismatched tag: line 158, column 2).
        ERROR: rhnpush failed

        Is here correct address to ask?

          • phil
          • November 4th, 2015 11:34am

          the “mismatched tag” error is unrelated to the previous SSL Cert error. You are seeing a new problem which just recently got reported https://bugzilla.redhat.com/show_bug.cgi?id=1277623

            • Tevfik
            • November 13th, 2015 9:08am

            I downgrade python.
            Now I can register my ubuntu 14.04. But now another problem exist.
            As your directives, I rename my sources.list and add spacewalk.list in appropriate directory.
            But when I try to run upgrade my ubuntu with apt-get upgrade , I got some dependency problem:
            root@spaceclient:/home/awtadm# apt-get upgrade
            Reading package lists… Done
            Building dependency tree
            Reading state information… Done
            You might want to run ‘apt-get -f install’ to correct these.
            The following packages have unmet dependencies:
            apt-xapian-index : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
            dh-python : Depends: python3:any (>= 3.3.2-2~) but it is not installable
            landscape-common : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
            language-selector-common : Depends: python3:any (>= 3.3.2-2~) but it is not installable
            lsb-release : Depends: python3:any (>= 3.3.2-2~) but it is not installable


            ufw : Depends: python3:any (>= 3.3.2-2~) but it is not installable
            update-manager-core : Depends: python3:any (>= 3.2~) but it is not installable
            update-notifier-common : Depends: python3:any but it is not installable
            E: Unmet dependencies. Try using -f

            If I run apt-get -f install , then ubuntu client lost spacewalk method
            What do you suggest me about this?

            • phil
            • November 19th, 2015 2:45pm

            you might wanna try “apt-cache policy python python3” to see if its available. If you only have spacewalk as source-repo, then make sure it is synced.

    • Tevfik
    • December 4th, 2015 9:16am

    phil :
    you might wanna try “apt-cache policy python python3″ to see if its available. If you only have spacewalk as source-repo, then make sure it is synced.

    Seems python3 installed:
    ###############################
    root@spaceclient:/etc/apt# apt-cache policy python python3
    python:
    Installed: 2.7.5-5ubuntu3
    Candidate: 2.7.5-5ubuntu3
    Version table:
    *** 2.7.5-5ubuntu3 0
    500 spacewalk://spacewalk.yasar.net/ channels:/main amd64 Packages
    100 /var/lib/dpkg/status
    python3:
    Installed: 3.4.0-0ubuntu2
    Candidate: 3.4.0-0ubuntu2
    Version table:
    *** 3.4.0-0ubuntu2 0
    500 spacewalk://spacewalk.yasar.net/ channels:/main amd64 Packages
    100 /var/lib/dpkg/status
    ##############################
    and I synced client by using “rhn-profile-sync -vvv”
    ##############################
    updateLoginInfo() login info
    D: login(forceUpdate=True) invoked
    logging into up2date server
    D: rpcServer: Calling XMLRPC up2date.login
    D: writeCachedLogin() invoked
    D: Wrote pickled loginInfo at 1446127326.97 with expiration of 1446130926.97 seconds.
    successfully retrieved authentication token from up2date server
    D: logininfo:{‘X-RHN-Server-Id’: 1000010010, ‘X-RHN-Auth-Server-Time’: ‘1449220378.59’, ‘X-RHN-Auth’: ‘3lnf4yi2JXLsBzgGimxZ/lDi5HcB6KzxulLiOOHRMtw=’, ‘X-RHN-Auth-Channels’: [[‘trusty’, ‘20151203161949’, ‘1’, ‘1’]], ‘X-RHN-Auth-User-Id’: ”, ‘X-RHN-Auth-Expire-Offset’: ‘3600.0’}
    Updating package profile…
    Updating package profile
    D: rpcServer: Calling XMLRPC registration.welcome_message
    D: rpcServer: Calling XMLRPC registration.update_packages
    Updating hardware profile…
    Warning: haldaemon or messagebus service not running. Cannot probe hardware and DMI information.
    ###########################
    but when run apt-get update I got this:
    ###########################
    root@spaceclient:/etc/apt# apt-get update
    Apt-Spacewalk: Updating sources.list
    WARNING:root:could not open file ‘/etc/apt/sources.list’

    Ign spacewalk://spacewalk.yasar.net channels: InRelease
    Ign spacewalk://spacewalk.yasar.net channels: Release.gpg
    Ign spacewalk://spacewalk.yasar.net channels: Release
    Ign spacewalk://spacewalk.yasar.net channels:/main amd64 Packages/DiffIndex
    Ign spacewalk://spacewalk.yasar.net channels:/main i386 Packages/DiffIndex
    Get:1 spacewalk://spacewalk.yasar.net channels:/main amd64 Packages [2.022 kB]
    Get:2 spacewalk://spacewalk.yasar.net channels:/main i386 Packages [2.022 kB]
    Ign spacewalk://spacewalk.yasar.net channels:/main Translation-en_US
    Ign spacewalk://spacewalk.yasar.net channels:/main Translation-en
    Fetched 4.044 kB in 2s (1.457 kB/s)
    Reading package lists… Done
    ###############################
    Everything looks ok. till when I try to upgrade or install some packages:
    root@spaceclient:/etc/apt# apt-get install mysql-client
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    You might want to run ‘apt-get -f install’ to correct these:
    The following packages have unmet dependencies:
    apt-xapian-index : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
    dh-python : Depends: python3:any (>= 3.3.2-2~) but it is not installable
    landscape-common : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
    language-selector-common : Depends: python3:any (>= 3.3.2-2~) but it is not installable
    lsb-release : Depends: python3:any (>= 3.3.2-2~) but it is not installable
    mysql-client : Depends: mysql-client-5.5 but it is not going to be installed
    python-apt : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
    python-chardet : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
    python-configobj : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
    python-dbus : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
    python-debian : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
    python-gi : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
    python-gobject-2 : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
    python-libxml2 : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
    python-newt : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
    python-openssl : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
    python-pkg-resources : Depends: python:any (>= 2.7) but it is not installable
    Depends: python:any (< 2.8) but it is not installable
    python-requests : Depends: python:any (= 2.7.5-5~) but it is not installable
    python-serial : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
    python-six : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
    python-twisted-core : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
    python-urllib3 : Depends: python:any (>= 2.7.5-5~) but it is not installable
    Depends: python:any (= 2.7.1-0ubuntu2) but it is not installable
    python-zope.interface : Depends: python:any (>= 2.7.1-0ubuntu2) but it is not installable
    python3-apport : Depends: python3:any (>= 3.3.2-2~) but it is not installable
    python3-commandnotfound : Depends: python3:any (>= 3.3.2-2~) but it is not installable
    python3-distupgrade : Depends: python3:any (>= 3.3.2-2~) but it is not installable
    python3-problem-report : Depends: python3:any (>= 3.3.2-2~) but it is not installable
    python3-software-properties : Depends: python3:any (>= 3.3.2-2~) but it is not installable
    python3-update-manager : Depends: python3:any (>= 3.3.2-2~) but it is not installable
    software-properties-common : Depends: python3:any (>= 3.3.2-2~) but it is not installable
    ubuntu-release-upgrader-core : Depends: python3:any (>= 3.2~) but it is not installable
    ufw : Depends: python3:any (>= 3.3.2-2~) but it is not installable
    update-manager-core : Depends: python3:any (>= 3.2~) but it is not installable
    update-notifier-common : Depends: python3:any but it is not installable
    E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution)
    ###########################
    Really need to work spacewalk for ubuntu clients. I have centos clients too and they have no problem.
    Regards..

    • mhofmann
    • December 8th, 2015 9:19am

    There is a Bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1243387

    And the Workaround from the Spacewalk Mailinglist:

    I think, I fix won’t come that soon…. 🙁

    To work around, I did

    1. deactivate the schedule for the main channel (we use debian)

    2. Go to /var/cache/rhn/repodata/

    There are 2 files: Packages and Packages.gz

    Edit Packages and add the header

    Multi-Arch: allowed

    to the package section “Package: python”, “Package: python2.7” and “Package: python3”

    Example:

    Package: python
    Version: 2.7.9-1
    Architecture: amd64
    Maintainer: Matthias Klose
    Installed-Size: 680
    Provides: python-ctypes, python-email, python-importlib, python-profiler, python-wsgiref
    Depends: python2.7 (>= 2.7.9-1~), libpython-stdlib (=2.7.9-1)
    Conflicts: python-central (<< 0.5.5)
    Replaces: python-dev (<=2.7.9-1~)
    Pre-Depends: python-minimal (= 2.7.9-1)
    Breaks: update-manager-core (< Packages.gz

    4. Go to you clients and “apt-get update”. You maybe have to clean the old lists before on the client

    For me, this works pretty well….right now.

    • Fulvio
    • January 15th, 2016 2:49pm

    Thanks a lot for this guide! Works like a charm. Now heading to the “Errata” one…

    • mpco
    • March 30th, 2016 7:47pm

    Does this work for Spacewalk 2.3? I created the base channel and synced this with an Ubuntu main repository. It says it completed (see below) but there are no packages in the channel and no disk space has been consumed.
    .
    .
    .
    INFO: 8566/8567: zsh-doc_5.0.2-3ubuntu6_all.deb
    INFO: 8567/8567: zsh-doc_5.0.2-3ubuntu6_all.deb
    INFO: Sync complete

    Thank you

    • Steve
    • March 31st, 2016 8:40pm

    Hey Phil,

    When I’m running the command to download the updates for two of the four channels I get a memory error. Any idea what is happening?

    INFO: Repo URL: http://us.archive.ubuntu.com/ubuntu/dists/trusty-updates/main/b inary-amd64/
    INFO: Repo root: http://us.archive.ubuntu.com/ubuntu/
    INFO: Packages in repo: 5314
    INFO: Packages synced: 1932
    INFO: Packages to sync: 3382
    INFO: 1/3382: libreoffice-dbg_4.2.8-0ubuntu4_amd64.deb
    Traceback (most recent call last):
    File “/sbin/debianSync.py”, line 123, in
    pkgFile.write(url.read())
    File “/usr/lib64/python2.6/socket.py”, line 362, in read
    return buf.getvalue()
    MemoryError

    Both error on different packages but show the same error and line.

    Thanks in advance, all your blog posts have been super helpful.

      • phil
      • March 31st, 2016 8:53pm

      Sounds like a python problem to me. Theres some QA on Stackoverflow for it, google “python file write memory error”. Likely caused by to less RAM. Unfortuantely I cannot try myself atm.
      However, as a workaround you could download the problematic files and push them to SW manually, see https://github.com/philicious/spacewalk-scripts/blob/master/debianSync.py#L127

        • Steve
        • April 1st, 2016 4:13pm

        Thanks for the response Phil. I did a few things, I upped the ram on the server and tried to manually install the package, sadly it would not install still. So I enabled the force option on rhnpush and still no luck. The error has change though

        Internal server error 500 Internal Server Error
        Error pushing ./libreoffice-dbg_4.2.8-0ubuntu4_amd64.deb: (500)
        Waiting 3 seconds and trying again…
        Waiting 5 seconds and trying again…
        Unable to load package ./libreoffice-dbg_4.2.8-0ubuntu4_amd64.deb : Package is invalid

        So it looks like something may be wrong with the package and this is why its stopping my repo download. Is there a way to tell the script to skip packages that fail and continue? I have 3000ish packages left to download and doing them manually will take forever.

        Thanks again, this is extremely helpful.

          • phil
          • April 3rd, 2016 7:54pm

          hm to bad, I still cant try myself. As a workaround you could edit debianSync.py script near the end (https://github.com/philicious/spacewalk-scripts/blob/master/debianSync.py#L116) and compare the current pkg against offending packages and then skip them

            • Steve
            • April 4th, 2016 8:36pm

            Hey Phil,

            Thats what I ended up doing. I ended up with having problems with three packages so I told the script to skip them using an if/else statement. Thanks for the help!

  4. Hi Phil,

    I’ve tried getting this setup on CentOS 7 and came across a bug that I think may be related to python-debian. The error appears in the apache logs for Spacewalk after the script gives this error:

    # ./debianSync.py –username user –password ‘ABCD’ –channel ‘1-ubuntu-1404’ –url ‘http://de.archive.ubuntu.com/ubuntu/dists/precise/main/binary-amd64/’

    INFO: 2/7957: akonadi-server_1.7.2-0ubuntu1_amd64.deb
    ERROR: rhnpush [ rhnpush -c 1-ubuntu-1404 -u admin -p test123 /tmp/akonadi-server_1.7.2-0ubuntu1_amd64.deb ] failed: (‘Internal server error 500 Internal Server Error\nInternal server error 500 Internal Server Error\nInternal server error 500 Internal Server Error\n’, ‘Error pushing /tmp/akonadi-server_1.7.2-0ubuntu1_amd64.deb: (500)\nWaiting 5 seconds and trying again…\nError pushing /tmp/akonadi-server_1.7.2-0ubuntu1_amd64.deb: (500)\nWaiting 3 seconds and trying again…\nError pushing /tmp/akonadi-server_1.7.2-0ubuntu1_amd64.deb: (500)\nWaiting 1 seconds and trying again…\nGiving up after 3 attempts\n’)

    [:error] [pid 13884] Exception Handler Information
    [:error] [pid 13884] Traceback (most recent call last):
    [:error] [pid 13884] File “/usr/lib/python2.7/site-packages/spacewalk/server/apacheUploadServer.py”, line 102, in _wrapper
    [:error] [pid 13884] ret = function(req)
    [:error] [pid 13884] File “/usr/share/rhn/upload_server/handlers/package_push/package_push.py”, line 115, in handler
    [:error] [pid 13884] self.file_checksum_type, self.file_checksum)
    [:error] [pid 13884] File “/usr/lib/python2.7/site-packages/spacewalk/server/rhnPackageUpload.py”, line 272, in save_uploaded_package
    [:error] [pid 13884] a_pkg.read_header()
    [:error] [pid 13884] File “/usr/lib/python2.7/site-packages/spacewalk/common/rhn_deb.py”, line 121, in read_header
    [:error] [pid 13884] self.header = deb_Header(self.header_data)
    [:error] [pid 13884] File “/usr/lib/python2.7/site-packages/spacewalk/common/rhn_deb.py”, line 42, in __init__
    [:error] [pid 13884] self.deb = debfile.DebFile(stream.name)
    [:error] [pid 13884] File “/usr/lib/python2.7/site-packages/debian/debfile.py”, line 297, in __init__
    [:error] [pid 13884] compressed_part_name(DATA_PART)))
    [:error] [pid 13884] File “/usr/lib/python2.7/site-packages/debian/debfile.py”, line 282, in compressed_part_name
    [:error] [pid 13884] ” (expected one of: %s)” % candidates)
    [:error] [pid 13884] InvalidPackageError

    This doesn’t seem like a problem with your script but with the python-debian module. Any ideas on what’s going wrong?

    BTW this post has been great – the patching of the python-debian module worked (Python 2.7 vs Python 2.6) – I’m hoping to get all this wrapped up into one Ansible playbook for servers and clients 🙂

    • GDog
    • April 16th, 2016 8:50am

    Hi!

    I am currently trying to set up my Debian repository with your script. And I really love it! But when I execute ./debianSync.py –username Admin –password ‘Spacewalk’ –channel ‘mychannel’ –url ‘http://ftp.debian.org/debian/dists/Debian8.4/main/binary-armhf/’

    The packages load that slow, they might be finished in the middle of June. Any suggestions? My Setup is a CentOS7 Server in a VirtualBox with 3GB of RAM and bridged Network. Even though any other components I install are quite fast, so it is not my network speed which causes the issue…

      • phil
      • April 16th, 2016 12:57pm

      Hey! Hard to tell whats slowing it down. Did you try different repo mirrors already? For further investigation I would alter the script so it doesnt rhn_push but only downloads and prints the URL. Then CURL a few big packages to compare against script. But tbh, I dont think its about the script.

    • acrnm
    • April 17th, 2016 5:22am

    Hi! Thanks for the super informative articles.
    I’ve successfully installed spacewalk on centos 7, and I’m in the process of registering a ubuntu 14.04 to spacewalk.

    I keep getting this error when trying to register:
    An error has occurred:

    See /var/log/up2date for more information

    Any idea how to resolve this?

    Thanks!

      • phil
      • April 17th, 2016 11:48am

      Unfortunately no idea without further infos. What does /var/log/up2date say ? Also try running rhnreg_ks with -vv for high verbosity

    • Raz Singolda
    • April 21st, 2016 4:08am

    Hello
    I’m trying to run the script debianSync.py and i’m getting this error:
    ERROR: rhnpush [ rhnpush -c precise-updates -u xxx -p xxxx /tmp/akregator_4.8.5-0ubuntu0.1_amd64.deb ] failed: (”, “ERROR: /tmp/akregator_4.8.5-0ubuntu0.1_amd64.deb: This file doesn’t appear to be a package\n”).
    Is there a solution for this issue??
    Thanks
    Raz

      • phil
      • April 21st, 2016 1:00pm

      Hi Raz, you likely didnt patch the debfile.py to include xz and lzma. However since a few days you dont even need to, but install python-debian-0.1.27-3 from EPEL-testing. They finally added my patch. Original bug report https://bugzilla.redhat.com/show_bug.cgi?id=1021625
      Try with that new python-debian version and the error should be gone.

    • Sean
    • April 25th, 2016 3:16pm

    Been following this for a while but waited until 16.04 to roll this out. I’ve got a 16.04 system with spacewalk installed, registered and running actions. The only part I’m having issues with this ‘apt-get update’.

    /etc/apt/sources.list.d/spacewalk.list is now built automatically
    deb spacewalk://~~~.com channels: main xenial-spacewalk xenial-updates

    Running an update dumps this, but I can’t figure were it’s getting a channel called ‘Release’

    Reading package lists… Done
    W: The repository ‘spacewalk://~~~.com channels: Release’ does not have a Release file.
    N: Data from such a repository can’t be authenticated and is therefore potentially dangerous to use.
    N: See apt-secure(8) manpage for repository creation and user configuration details.

    First time working with Ubuntu, trying to work it in to our RHEL,OEL,CentOS Spacewalk environment, any help would be appreciated.

      • phil
      • April 25th, 2016 3:46pm

      Err if I understand correct, its working in general but you are wondering about those warnings. This has to do with the packages not being GPG signed. See http://www.devops-blog.net/spacewalk/gpg-signing-apt-repository-in-spacewalk

        • Sean
        • May 3rd, 2016 2:48pm

        It seems similar and I’ll try the fix there, but the first difference I noticed is that I am unable to select ‘yes’ to install the packages. It just halts.

        Reading package lists… Done
        W: The repository ‘spacewalk://~~~.com/XMLRPC channels: Release’ does not have a Release file.
        N: Data from such a repository can’t be authenticated and is therefore potentially dangerous to use.
        N: See apt-secure(8) manpage for repository creation and user configuration details.
        W: The repository ‘spacewalk://~~~.com channels: Release’ does not have a Release file.
        N: Data from such a repository can’t be authenticated and is therefore potentially dangerous to use.
        N: See apt-secure(8) manpage for repository creation and user configuration details.
        E: Failed to fetch spacewalk://~~~.com/XMLRPC/dists/channels:/xenial/binary-amd64/Packages 404 Not Found
        E: Failed to fetch spacewalk://~~~.com/XMLRPC/dists/channels:/xenial/binary-i386/Packages 404 Not Found
        E: Some index files failed to download. They have been ignored, or old ones used instead.

          • phil
          • May 4th, 2016 12:04pm

          Hey Sean, I think there is some APT config which prevents you from accepting unauthenticated packages at all.
          On the other hand, the 404 on the “Packages” file is suspicious. Check if /var/cache/rhn/repodata/CHANNEL_NAME/Packages(.gz) exists. If not, check taskomatic scheduler.

          PS: You are bleeding edge. I havent tested Ubuntu16 with Spacewalk yet. But it should work

            • Sean
            • May 16th, 2016 2:48pm

            Figured out the 404, had a release file in my main ‘xenial’, not sure why and didn’t think much of it.

            Origin: Ubuntu
            Label: Ubuntu
            Suite: xenial
            Version: 12.04
            Codename: xenial
            Date: Tue, 03 May 2016 10:54:06 -0400
            Architectures: amd64
            Components: repodata
            Description: Ubuntu Precise 12.04
            MD5Sum:
            a8edeab000c866fd70ba64ff45153d94 6483158 repodata/binary-amd64/Packages
            63fdaab9cd031be5ab976cbe9b04ae4b 1209191 repodata/binary-amd64/Packages.gz
            a8edeab000c866fd70ba64ff45153d94 6483158 repodata/binary-i386/Packages
            63fdaab9cd031be5ab976cbe9b04ae4b 1209191 repodata/binary-i386/Packages.gz
            SHA256:
            5f2ade4bf255437787822e88f48c413366043565f5ea516309f1c0e9a64bdb78 6483158 repodata/binary-amd64/Packages
            19e22655c98ea2e0816fcc0e7bb79eaca92504f65723141521653ca34e487daa 1209191 repodata/binary-amd64/Packages.gz
            5f2ade4bf255437787822e88f48c413366043565f5ea516309f1c0e9a64bdb78 6483158 repodata/binary-i386/Packages
            19e22655c98ea2e0816fcc0e7bb79eaca92504f65723141521653ca34e487daa 1209191 repodata/binary-i386/Packages.gz

            Now I’m down to merge list errors

            E: Problem parsing dependency Breaks
            E: Error occurred while processing kmod (NewVersion2)
            E: Problem with MergeList /var/lib/apt/lists/~~~.com_dists_xenial_repodata_binary-amd64_Packages

            E: The package lists or status file could not be parsed or opened.

            Package: kmod
            Version: 22-1ubuntu4
            Architecture: amd64
            Maintainer: Ubuntu Developers
            Installed-Size: 241
            Depends: libc6 (>=2.17), libkmod2 (=22-1ubuntu4), lsb-base (>=4.1+Debian11ubuntu7)
            Breaks: oss-compat (=4)
            Filename: XMLRPC/GET-REQ/xenial/getPackage/kmod-22-1ubuntu4.amd64-deb.deb

            Looks to be the lack of a space in ‘=4’, the work around here gets me around that https://bugzilla.redhat.com/show_bug.cgi?id=1226329.

            • phil
            • May 17th, 2016 11:24am

            Did you perhaps play with GPG signing repo? As your Release file shows “Description: Ubuntu Precise 12.04” but “Codename : Xenial”. So it looks like it comes from https://github.com/philicious/spacewalk-scripts/blob/master/secureApt.sh

    • James M.
    • April 25th, 2016 7:55pm

    Hello,

    On the client, I run “rhnreg_ks –activationkey=1-ubuntu –serverUrl=https://x.x.x.x/XMLRPC –sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT”

    and I see the system being registered in spacewalk. However, when I run rhn_check on the client, it says “Unable to read system id”. Systemid file does not exist in /etc/sysconfig/rhn/

    Any idea on this issue?

    Thanks!

    J

      • phil
      • April 25th, 2016 8:47pm

      Hey James, check if /etc/sysconfig/rhn/systemid exists. That file should be created when registering the system. If not, its likely you have some permission problem. Make sure you register as root or sudoer. You can also run the register command again with -vv for verbosity.

    • James M.
    • May 6th, 2016 10:25pm

    Hello Phil,

    I was messing around trying to use a third part certificate instead of self signed.
    This guide was used to generate a new CA:

    https://access.redhat.com/solutions/10809

    Whereabouts should I go to append my third part cert and key?

    Thanks,

    J

      • James M.
      • May 7th, 2016 1:54am

      I suppose my real question is, how to do install a third certificate into spacewalk?

    • James M.
    • May 7th, 2016 2:31am

    Went through this procedure:
    https://access.redhat.com/solutions/15753

    when I run debianSync.py, I get the following error:

    failed: (”, “\nERROR: unhandled exception occurred: ([(‘SSL routines’, ‘SSL3_GET_SERVER_CERTIFICATE’, ‘certificate verify failed’)]).\n”)

      • phil
      • May 7th, 2016 12:06pm

      Not sure why you are getting this error. It sounds like you didnt import the RootCA.
      That article is the correct procedure, also seen here https://fedorahosted.org/spacewalk/wiki/ChangeCaCert
      I’d suggest running rhn_check in verbose mode and also rhnpush.
      Note: rhnpush (debianSync.py) is running on the server, so you also need to import the CA there, like it would be a client.

        • cardoppler
        • August 1st, 2016 10:50am

        Have you guys had any luck with this? I am stuck with the same exact problem…

        phil :
        Not sure why you are getting this error. It sounds like you didnt import the RootCA.
        That article is the correct procedure, also seen here https://fedorahosted.org/spacewalk/wiki/ChangeCaCert
        I’d suggest running rhn_check in verbose mode and also rhnpush.
        Note: rhnpush (debianSync.py) is running on the server, so you also need to import the CA there, like it would be a client.

    • James M.
    • May 16th, 2016 9:51pm

    I applied a couple of erratas recently and it seemed to have uninstalled spacewalk on the client.
    Doing a apt-get update shows:

    /usr/lib/apt/methods/spacewalk

    Any idea on the issue?

      • James M.
      • May 16th, 2016 9:57pm

      During the errata application, it shows that it is removing a ton of packages:

      (Reading database … 94238 files and directories currently installed.)
      Removing apparmor (2.8.95~2430-0ubuntu5.3) …
      * Clearing AppArmor profiles cache [ OK ]
      All profile caches have been cleared, but no profiles have been unloaded.
      Unloading profiles will leave already running processes permanently
      unconfined, which can lead to unexpected situations.

      To set a process to complain mode, use the command line tool
      ‘aa-complain’. To really tear down all profiles, run the init script
      with the ‘teardown’ option.”
      Removing apport (2.14.1-0ubuntu3.19) …
      apport stop/waiting
      Removing apt-transport-spacewalk (1.0.6-2.1) …
      Removing apt-xapian-index (0.45ubuntu4) …
      Removing index /var/lib/apt-xapian-index…
      Removing byobu (5.77-0ubuntu1.2) …
      Removing command-not-found (0.3ubuntu12) …
      Removing rhnsd (4.9.15-1) …
      Removing rhn-client-tools (1.8.9-3) …
      ..
      Removing python3-apt (0.9.3.5ubuntu2) …
      sh: 1: /usr/lib/apt-spacewalk/pre_invoke.py: not found

      (APT output shortened)

        • phil
        • May 17th, 2016 11:39am

        Hi James, I’ve heard and seen this before. Its happening because of conflicts in APT. Often because of python2.6/7 vs python3 packages and/or partially installed packages. To get to the root of it: Do an “apt-get update” before applying errata, to see if APT is operating normally. Now install the package from errata manually via APT and carefully read the output. There has to be some hint. And you can paste your log here.
        PS: make sure you build the Spacewalk packages for your system and dont use the outdated ones from Ubuntu/Launchpad repos.

          • James M.
          • May 17th, 2016 1:07pm

          Hi Phil, thank you for the response.
          It seems like the issue was caused by removing sources.list, but in your instructions it calls to remove it.

          Also, I’m using the client posted by Aaron Russell on your comments. Not sure if this could be causing the issue,but as mentioned earlier, putting sources.list back seems to work.

          Is there a way to fix the broken machine? Apt-get update gives me a /usr/lib/apt/methods/spacewalk method not found error.

            • phil
            • May 17th, 2016 1:39pm

            sources.list is containing your old repo sources. spacewalk.list tells APT to use Spacewalk as repo. Which only works if you have synced the repos into SW. Its not mandatory to use SW as source tho. You can even mix sources. For errata it doesnt matter where the update is coming from.

            Aarons packages should be fine but I never tested them.

            Fixing the broken machine could be a tedious task. First you need to remove the spacewalk-transport remnants so APT can work again, then reinstall spacewalk client packages. And ofc any other package you are missing.

    • Sean
    • May 17th, 2016 5:40pm

    phil :
    Did you perhaps play with GPG signing repo? As your Release file shows “Description: Ubuntu Precise 12.04″ but “Codename : Xenial”. So it looks like it comes from https://github.com/philicious/spacewalk-scripts/blob/master/secureApt.sh

    I had, but hadn’t followed though. Got all that setup now.

    Now I’m down to E: Failed to fetch store:/var/lib/apt/lists/partial/~~~.com_dists_xenial-spacewalk_repodata_binary-amd64_Packages.gz Hash Sum mismatch

    md5sum,shasum of Packages.gz match the info in the Release file.

      • phil
      • May 17th, 2016 7:02pm

      That might just be a typical APT error not related to SW at all. See http://askubuntu.com/questions/41605/trouble-downloading-packages-list-due-to-a-hash-sum-mismatch-error .. The suggested answer usually works. Its some APT caching related problem that can happen

        • Sean
        • May 19th, 2016 7:05pm

        I had to apply the https://bugzilla.redhat.com/show_bug.cgi?id=1226329 fix to both Packages & Packages.gz, and resign. I can now list the packages, woo!

        But running a apt-get upgrade now gives me Hash Sum mismatch error on every ‘.deb’ package :(.

        E: Failed to fetch spacewalk://~~~~.com/XMLRPC/GET-REQ/xenial/getPackage/usbutils-1:007-4.amd64-deb.deb Hash Sum mismatch

          • Charles
          • June 20th, 2016 7:16pm

          I ran into you issue as well. After investigation i think that xenial (Ubuntu 16.4) stopped supporting MD5 or SHA1 hash for packages.

          you can see the error (after turning up the logs for apt) when trying to install a package:

          After this operation, 91.1 kB of additional disk space will be used.
          Get:1 spacewalk://spacewalk.lab.cor xenial/repodata amd64 iftop amd64 1.0~pre4-3 [35.2 kB]
          0% [1 iftop 0 B/35.2 kB 0%]201 URI Done: spacewalk://spacewalk.lab.cor/XMLRPC/GET-REQ/xenial/getPackage/iftop-1.0~pre4-3.amd64-deb.deb
          ReceivedHash:
          – SHA256:d5556fd9b289841eaa42877ca642195bf6d80b0acd78ab0392513f561d8d37f9
          – MD5Sum:eb6c0afc0eedd268c0c8281d84a2c944
          ExpectedHash:
          – MD5Sum:eb6c0afc0eedd268c0c8281d84a2c944

          Err:1 spacewalk://spacewalk.lab.cor xenial/repodata i386 iftop amd64 1.0~pre4-3
          Hash Sum mismatch

          After i’ve manually calculated the SHA256 hash of the package and added it to the /var/cache/rhn/repodata/xenial/Packages under the right section i can successfully install the iftop package:

          After this operation, 91.1 kB of additional disk space will be used.
          Get:1 spacewalk://spacewalk.lab.cor xenial/repodata amd64 iftop amd64 1.0~pre4-3 [35.2 kB]
          0% [1 iftop 0 B/35.2 kB 0%]201 URI Done: spacewalk://spacewalk.lab.cor/XMLRPC/GET-REQ/xenial/getPackage/iftop-1.0~pre4-3.amd64-deb.deb
          ReceivedHash:
          – SHA256:d5556fd9b289841eaa42877ca642195bf6d80b0acd78ab0392513f561d8d37f9
          – MD5Sum:eb6c0afc0eedd268c0c8281d84a2c944
          ExpectedHash:
          – SHA256:d5556fd9b289841eaa42877ca642195bf6d80b0acd78ab0392513f561d8d37f9
          – MD5Sum:eb6c0afc0eedd268c0c8281d84a2c944

          Selecting previously unselected package iftop.
          (Reading database … 141118 files and directories currently installed.)
          Preparing to unpack …/iftop_1.0~pre4-3_amd64.deb …
          Unpacking iftop (1.0~pre4-3) …
          Processing triggers for man-db (2.7.5-1) …
          Setting up iftop (1.0~pre4-3) …
          Apt-Spacewalk: Updating package profile

          I’m not sure where to go from here but hopefully someone will be able to dig deeper into this

    • James M.
    • June 6th, 2016 8:41pm

    I’ve cloned a VM that was already registered to spacewalk.
    After cloning it, I’ve rename the hostname and rejoin it to spacewalk, however I’m not seeing any needed package updates that I know exists on the spacewalk dashboard. I see green check marks.
    Is there some sort of clean up that I need to do before rejoining?

    I’ve tried deleting systemid and systemid.bak.

      • phil
      • June 7th, 2016 11:18am

      Hey, so I would first delete the system from SW and also delete the systemid file on the client, yes. Then register with “rhnreg_ks –force..” and then verify the two systems have different systemIds now.
      Then make sure its subscribed to correct channels and also make sure the update package really exists in a subscribed repo.
      You can also run “rhn_check -vv..” to force a check-in. And if SW is also configured as a repo for the client, try “apt-cache policy PACKAGENAME” to see the candidates. It should show the installed version + all others it finds in any repo.

    • Rajesh
    • June 29th, 2016 11:15am

    the below error i am getting what would be the solution?

    Sync started: Wed Jun 29 16:37:26 2016
    [‘/usr/bin/spacewalk-repo-sync’, ‘–channel’, ‘ubuntu14-security’, ‘–type’, ‘yum’]
    Repo URL: http://security.ubuntu.com/ubuntu/
    ERROR: failure: repodata/repomd.xml from ubuntu14-security: [Errno 256] No more mirrors to try.
    http://security.ubuntu.com/ubuntu/repodata/repomd.xml: [Errno 14] HTTP Error 404 – Not Found
    Sync completed.
    Total time: 0:00:00

    • Russell
    • November 11th, 2016 5:13am

    Hey, thanks for the write up.

    I just came across an issue then doing ./debiansync.py … i would get a HTTP 500 error and when checking the httpd error log i could see this
    NameError: global name ‘UnicodeType’ is not defined
    traced it back to the /usr/lib/python2.6/site-packages/spacewalk/server/importlib/debPackage.py file and changed line 65

    from
    if isinstance(val, UnicodeType):
    to
    if isinstance(val, str):

    then ran ./debiansync.py again without issues.

    Hope this helps someone else out.
    Cheers
    Russell

    • arij
    • January 24th, 2017 3:10pm

    Hi,

    I have problem with debiansync.py when I want to sync my ubuntu channel I have this error :

    ERROR: rhnpush [ rhnpush -c precise-backports -u admin -p XXX /tmp/augeas-dbg_1.2.0-0ubuntu1.1~ubuntu12.04.1_amd64.deb ] failed: (‘Internal server error 500)

    Could you help me please.

    Best Regards.

      • phil
      • January 24th, 2017 3:23pm

      Hi Arij,
      try to run the rhnpush manually with -vv for getting more debug output

    • arij
    • January 24th, 2017 3:39pm

    Hi,

    I have this :No new files to upload; exiting
    but my repository sync from a valid url : http://us.archive.ubuntu.com/ubuntu/dists/precise/main/binary-amd64/

    So I didn’t know what is the problem.
    Thank you for your help.

    • Miguel
    • February 22nd, 2017 1:17pm

    After the process of install client in “Ubuntu 16.04.2 LTS” and do

    rhnreg_ks –activationkey=1-161460cf5004f0f902777ce0aa6a6f89 –serverUrl=http://spacewalk.domain.com/XMLRPC

    Appears the following message…

    Segmentation fault (core dumped)

    Anybody known which is the issue?

      • phil
      • February 22nd, 2017 2:29pm

      sounds bad. try running with -vv for more verbosity.

        • Miguel
        • February 24th, 2017 9:10am

        This is the message after -vv …..

        D: rpcServer: Calling XMLRPC registration.welcome_message
        Warning: haldaemon or messagebus service not running. Cannot probe hardware and DMI information.

        D: rpcServer: Calling XMLRPC registration.welcome_message
        Segmentation fault (core dumped)

          • phil
          • February 24th, 2017 1:32pm

          Ok. So the haldeamon/messagebus message is normal.
          A segmentation fault (memory access exception) is very bad in general. Hard for me to say why its happening.
          Make sure you are using repos/packages destined for that OS.
          Then it would also be interesting to try with a comparable client.

            • Miguel
            • March 3rd, 2017 12:04pm

            This issue only happens for me with clients Ubuntu 16.04 with codename xenial. I have tested with a clean Ubuntu 16.04 and a Linux Mint 18 Sarah.

            I have downloaded the correct repos/packages destined for this OS.

            ./debianSync.py –username root –password ‘xxxx’ –channel ‘xenial’ –url ‘http://us.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/’

            For Ubuntu 14.04 and codename trusty I haven’t any problem.

            In both cases I have the same issue.

            Looking log files I have the following messages:

            /var/log/syslog and /var/log/kern.log

            kernel: [ 4611.471812] rhnreg_ks[2761]: segfault at 0 ip 00000000004c9b5a sp 00007ffd570ba180 error 4 in python2.7[400000+2ea000]

            Someone with the same issue?

            • phil
            • March 14th, 2017 1:09pm

            I’m having the same problem now on a Ubuntu16 and client packages freshly built from git. Strangely this did work before. I’ll see if I can trace down the bug

            • phil
            • March 14th, 2017 2:07pm

            so I was able to trace it down with gdb. short answer, on xenial do: apt-get install python-ethtool=0.11-3 , on trusty/precise you need to do “git checkout debian/0.11-3” before debuild

            • Miguel
            • March 17th, 2017 9:39am

            Thanks phil. It works for me already. I’ve tested with Ubuntu 16.04.2 LTS and desktops Linux Mint 18 Sarah and It works fine. Thanks a lot again.

            • Miguel
            • March 23rd, 2017 2:28pm

            Hi again phil,

            I’m adding Linux Mint Desktops to spacewalk. I could register 3 types of OS Linux Mint 17.3 Rosa (trusty codename), Linux Mint 18 Sarah and Linux Mint 18.1 Serena with xenial codenames.

            I can do rhn_check without problems but…I have the following issues:

            – All Linux Mint systems need updates but in spacewalk appears as up to date

            – In the Linux Mint 17.3 Rosa (trusty codename) y add the repos with:
            echo ‘deb spacewalk://spacewalk.hc.lan/XMLRPC channels: trusty-main trusty-security trusty-updates’ >
            etc/apt/sources.list.d/spacewalk.list and when I do sudo apt-get update I don’t have any issues, but in the others OS Linux Mint 18 adding the repos with echo ‘deb spacewalk://spacewalk.hc.lan/XMLRPC channels: xenial-main xenial-security xenial-updates’ > /etc/apt/sources.list.d/spacewalk.list …
            The spacewalk.list file contains:
            deb spacewalk://spacewdeb.domain.com channels: main xenial-security xenial-updates

            when I do sudo apt-get update appears the following message

            Reading package lists… Done
            W: The repository ‘spacewalk://spacewdeb.domain.com channels: Release’ does not have a Release file.
            N: Data from such a repository can’t be authenticated and is therefore potentially dangerous to use.
            N: See apt-secure(8) manpage for repository creation and user configuration details.

            – Is there any only url for Lunix Mint distib?

            Thanks for advance

            • phil
            • March 24th, 2017 1:07pm

            I havent done anything with Mint yet. So I cant really help here. However Spacewalk has some problems with properly handling Debian package versions which leads to some packages not being shown as updates properly. See https://github.com/spacewalkproject/spacewalk/pull/500 for more infos

    • LeoKing
    • February 24th, 2017 7:37pm

    My spacewalk setup with ubuntu16 is working but I do have some issues with the clients.

    On the spacewalk clients whose repos are pointed to spacewalk:

    apt list –upgradable says all the installed packages are unknown.

    Example:

    apt list –upgradable
    Listing… Done
    imagemagick/unknown,unknown,unknown,unknown,unknown,unknown 8:6.8.9.9-7ubuntu5.4 amd64 [upgradable from: 8:6.8.9.9-7ubuntu5.3]
    imagemagick-6.q16/unknown,unknown,unknown,unknown,unknown,unknown 8:6.8.9.9-7ubuntu5.4 amd64 [upgradable from: 8:6.8.9.9-7ubuntu5.3]

    It says all the packages need to be upgrade which is not true.

    apt list –upgradable | wc -l
    1373
    apt-get upgrade
    1353 upgraded, 0 newly installed, 0 to remove and 19 not upgraded.

    But when I mv /etc/apt/sources.list.bak /etc/apt/sources.list && apt-get update

    apt list –upgradable
    Listing… Done
    imagemagick/xenial-updates,xenial-security 8:6.8.9.9-7ubuntu5.4 amd64 [upgradable from: 8:6.8.9.9-7ubuntu5.3]
    imagemagick-6.q16/xenial-updates,xenial-security 8:6.8.9.9-7ubuntu5.4 amd64 [upgradable from: 8:6.8.9.9-7ubuntu5.3]

    apt list –upgradable | wc -l
    49

    sudo apt-get upgrade says
    48 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

    Any idea, what might this could be?

    • Annwoy Ghatak
    • March 6th, 2017 1:32pm

    While running “debuild -i -us -uc -b” on python-ethtool, it give me error.

    dh_auto_build: python setup.py build –force returned exit code 1
    make[1]: *** [override_dh_auto_build] Error 1

    Please help!

      • phil
      • March 14th, 2017 1:10pm

      which OS? I just build the packages again myself yesterday and debuild didnt error

    • vyas
    • April 5th, 2017 2:37pm

    my spacewalk server is set up on Rhel 7.3 and my client is ubuntu 16.04 LTS and when i use your script on my spacewalk server and i am getting this errors

    [root@nblnxyum001t yum.repos.d]# ./spacewalk-debian-sync.pl -username admin -password ‘XXXX’ –channel ‘ubuntu-x86_64’ –url ‘http://de.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/’
    INFO: Repo URL: http://de.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/
    INFO: Ubuntu root is http://de.archive.ubuntu.com/ubuntu/
    INFO: Fetching Packages.gz… done
    INFO: Packages in repo: 7322
    INFO: Packages already synced: 0
    INFO: Packages to sync: 7322
    INFO: 1/7322 : python-babel-localedata_1.3+dfsg.1-6_all.deb

    ERROR: unhandled exception occurred: (Certificate file /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT is not accessible).
    ERROR: rhnpush failed

      • phil
      • April 5th, 2017 3:08pm

      hm. interesting. first, check if that file exists and is accessible. then you can also run that rhnpush command manually with -vv for high verbosity.
      which SW server version is that? As of 2.6 syncing debian repos is natively supported

    • vyas
    • April 5th, 2017 3:40pm

    The SW server version is 2.5 and here is the error message i am receiving

    ./spacewalk-debian-sync.pl -username admin -password ‘Spacewalk1234’ –channel ‘ubuntu-x86_64’ -url ‘http://de.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/’
    INFO: Repo URL: http://de.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/
    INFO: Ubuntu root is http://de.archive.ubuntu.com/ubuntu/
    INFO: Fetching Packages.gz… done
    INFO: Packages in repo: 7322
    INFO: Packages already synced: 0
    INFO: Packages to sync: 7322
    INFO: 1/7322 : python-babel-localedata_1.3+dfsg.1-6_all.deb
    (‘Internal server error’, 500, ‘Internal Server Error’)
    Error pushing /tmp/python-babel-localedata_1.3+dfsg.1-6_all.deb: (500)
    Waiting 5 seconds and trying again…
    (‘Internal server error’, 500, ‘Internal Server Error’)
    Error pushing /tmp/python-babel-localedata_1.3+dfsg.1-6_all.deb: (500)
    Waiting 1 seconds and trying again…
    (‘Internal server error’, 500, ‘Internal Server Error’)
    Error pushing /tmp/python-babel-localedata_1.3+dfsg.1-6_all.deb: (500)
    Waiting 4 seconds and trying again…
    Giving up after 3 attempts
    ERROR: rhnpush failed

      • phil
      • April 5th, 2017 7:31pm

      try running rhnpush -vv on a deb manually/directly

    • vyas
    • April 6th, 2017 2:41pm

    i run this command on the SW server on redhat i am getting this error message
    [root@ yum.repos.d]# rhnpush -vv
    No new files to upload; exiting

    is i am doing anything wrong

    • vyas
    • April 7th, 2017 1:45pm

    rhnpush -vv -c ubuntu-x86_64 -u admin -p XXXXX DEB-PACKAGE-FILE
    Connecting to https://localhost/APP
    url is https://localhost/PACKAGE-PUSH
    Result codes: 200 OK
    Computing checksum and package info. This may take some time …
    Could not read file DEB-PACKAGE-FILE

      • phil
      • April 7th, 2017 8:20pm

      DEB-PACKAGE-FILE was a placeholder. you have to supply the path to a .deb file

    • vyas
    • April 10th, 2017 3:09pm

    where do you want run this command on SW server or on client

    rhnpush -vv -c ubuntu-x86_64 -u admin -p Spacewalk1234 DEB-PACKAGE-FILE

    • vyas
    • April 19th, 2017 7:07pm

    when i run

    rhnpush -vv -c ubuntu-x86_64 -u admin -p Spacewalk1234 DEB-PACKAGE-FILE

    [Wed Apr 19 14:57:19.149000 2017] [:error] [pid 21559] Exception reported from nblnxyum001t [Wed Apr 19 14:57:19.149029 2017] [:error] [pid 21559] Time: Wed Apr 19 14:57:19 2017 [Wed Apr 19 14:57:19.149033 2017] [:error] [pid 21559] Exception type [Wed Apr 19 14:57:19.149036 2017] [:error] [pid 21559] Exception while handling function server.apacheUploadServer._wrapper
    [Wed Apr 19 14:57:19.149038 2017] [:error] [pid 21559] Request object information:
    [Wed Apr 19 14:57:19.149040 2017] [:error] [pid 21559] URI: /PACKAGE-PUSH [Wed Apr 19 14:57:19.149041 2017] [:error] [pid 21559] Remote Host: localhost

    ….
    [:error] [pid 22855] Traceback (most recent call last):
    [Wed Apr 19 14:57:20.302034 2017] [:error] [pid 22855] File “/usr/lib/python2.7/site-packages/spacewalk/server/apacheUploadServer.py”, l ine 103, in _wrapper
    [Wed Apr 19 14:57:20.302036 2017] [:error] [pid 22855] ret = function(req)
    [Wed Apr 19 14:57:20.302038 2017] [:error] [pid 22855] File “/usr/share/rhn/upload_server/handlers/package_push/package_push.py”, line 1 25, in handler
    [Wed Apr 19 14:57:20.302070 2017] [:error] [pid 22855] relative_path=self.rel_package_path, org_id=self.org_id)
    [Wed Apr 19 14:57:20.302090 2017] [:error] [pid 22855] File “/usr/lib/python2.7/site-packages/spacewalk/server/rhnPackageUpload.py”, lin e 137, in push_package
    [Wed Apr 19 14:57:20.302093 2017] [:error] [pid 22855] header_end=a_pkg.header_end, channels=channels)
    [Wed Apr 19 14:57:20.302095 2017] [:error] [pid 22855] File “/usr/lib/python2.7/site-packages/spacewalk/server/importlib/mpmSource.py”, line 110, in create_package
    [Wed Apr 19 14:57:20.302096 2017] [:error] [pid 22855] org_id=org_id, channels=channels)
    [Wed Apr 19 14:57:20.302098 2017] [:error] [pid 22855] File “/usr/lib/python2.7/site-packages/spacewalk/server/importlib/debPackage.py”, line 65, in __init__
    [Wed Apr 19 14:57:20.302100 2017] [:error] [pid 22855] if isinstance(val, UnicodeType):
    [Wed Apr 19 14:57:20.302106 2017] [:error] [pid 22855] NameError: global name ‘UnicodeType’ is not defined [Wed Apr 19 14:57:20.302113 2017] [:error] [pid 22855] [Wed Apr 19 14:57:20.308076 2017] [:error] [pid 22855] Spacewalk 22855 2017/04/19 14:57:20 -04:00: (‘Unhandled exception’,)

    • Harry
    • May 5th, 2017 6:10am

    Getting below error when runnning “sudo debuild -i -us -uc -b” in directory “/python-ethtool”


    error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1
    dh_auto_build: python setup.py build –force returned exit code 1
    make[1]: *** [override_dh_auto_build] Error 1
    make[1]: Leaving directory `/home/ubuntu/python-ethtool’
    make: *** [build] Error 2
    dpkg-buildpackage: error: debian/rules build gave error exit status 2
    debuild: fatal error at line 1364:
    dpkg-buildpackage -rfakeroot -D -us -uc -i -b failed

    • uly
    • June 12th, 2017 2:27pm

    Hi, I am trying to set up Spacewalk 2.6 for Ubuntu 14.04 and 16.04 on a CentOS 7 Server.

    I created the following channels and child-channels:
    Ubuntu 14.04 Trusty
    -Ubuntu 14.04 Trusty-Security
    -Ubuntu 14.04 Trusty-Updates
    Ubuntu 16.04 Xenial
    -Ubuntu 16.04 Xenial-Security
    -Ubuntu 16.04 Xenial-Updates

    Then I created repositories for the main channel and the child-channels and did a sync of all the repositories.

    Every sync ended with the message: “Linking packages to channel.”

    However, in the Spacewalk web interface the software channels don’t show any packages. If I look in a channel under Packages > List/Remove there is only: “This channel contains no packages.”

    If I look under “Manage Software Packages” I can see the packages, but they are not linked to channels.

    How can I link them? And how can this be done automatically. Because I don’t know which package belongs to which repository/channel.

      • phil
      • June 12th, 2017 3:31pm

      did you use the sync script mentioned in this post or the native APT-syn feature available in Spacewalk as of 2.6 ?

        • uly
        • June 13th, 2017 7:01am

        I used the native APT-sync feature available in Spacewalk 2.6.

        • uly
        • June 13th, 2017 10:13am

        For testing purpose I set up another channel with a CentOS 7 repository. After the sync finished, the packages are properly displayed in the channel.

        • uly
        • June 13th, 2017 1:18pm

        I found the solution!
        I don’t know why, but the “Architecture” option in the channels was set to x86_64 and not AMD64 Debian.
        I thought I selected this architecture back when I created the channels.

        The error message “ERROR: Package arch amd64-deb incompatible with channel” only shows up if you run the reposync command in the shell and not if you start the sync from the web interface.

  1. January 27th, 2015
  2. March 10th, 2015
  3. July 8th, 2015
  4. November 2nd, 2015