Bug 477281 - Cobbler web interface kills system configuration
Cobbler web interface kills system configuration
Product: Fedora
Classification: Fedora
Component: cobbler (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Michael DeHaan
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-12-19 20:04 EST by Dennis Jacobfeuerborn
Modified: 2009-04-06 08:35 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-04-06 08:35:08 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
trace from log after clicking "save" in system configuration (109.54 KB, text/plain)
2008-12-19 20:04 EST, Dennis Jacobfeuerborn
no flags Details

  None (edit)
Description Dennis Jacobfeuerborn 2008-12-19 20:04:11 EST
Created attachment 327515 [details]
trace from log after clicking "save" in system configuration

After saving the configuration of a system a couple of times I get the following error:

Error while saving system :maximum recursion depth exceeded in cmp

After that I can no longer go to the system overview page. There I now get:

Fault: <Fault 1: "<type 'exceptions.TypeError'>:object of type 'NoneType' has no len()">

The reason for that is most likely that the system configuration file "/var/lib/cobbler/config/systems.d/mymobile" has a size of 0 bytes. After deleting the file I can get back to the system overview page again.

I think there are three problems here:
1) The actual recursion error
2) The fact that after such an error the configuration gets corrupted (the save handler should use a temporary file for it's work and not touch the original configuration file until the very end)
3) A corrupt system configuration file should not kill the system overview page. The page should display with an error message and the possibility to delete the offending file(s). It should still be possible to edit the other system configurations.

Attached is the trace from the log for the recursion error.

The cobbler version installed is: cobbler-1.4.0-2.fc10.noarch
Comment 1 Michael DeHaan 2008-12-21 14:17:26 EST
Please supply steps to reproduce this problem.
Comment 2 Ronald J. yacketta 2009-02-23 14:23:59 EST
I have been experiencing the same issue running:
# rpm -qa cobbler

Reproduction of the issue is not 100%, some times I can modify network settings and everything is fine while other times I get the above scenario. It has happened while adding / changing 'IP assignment', 'IP' and 'Virt Bridge' individually or any combination of them. I have also had it happen when adding a new interface (just adding and saving).
Comment 3 Ronald J. yacketta 2009-02-23 16:11:20 EST
Just had it happen on this config: All I did was added a Gateway and clicked save (via the webui) and it trashed the config and left cobbler in a unstable state.

cobbler system --name=test report
system                : test
profile               : f10-i386
comment               :
created               : Mon Feb 23 14:04:16 2009
gateway               :
hostname              : my.host.name
image                 :
kernel options        : {'ksdevice': 'eth0'}
kernel options post   : {}
kickstart             : <<inherit>>
ks metadata           : {}
mgmt classes          : []
modified              : Mon Feb 23 14:37:31 2009
name servers          : []
netboot enabled?      : True
owners                : ['admin']
server                : <<inherit>>
template files        : {}
virt cpus             : 2
virt file size        : 10
virt path             : /mnt/os1
virt ram              : 1024
virt type             : qemu
power type            : apc_snmp
power address         :
power user            :
power password        :
power id              :
interface        : eth0
  mac address    : 00:16:3e:2a:ae:e7
  bonding        :
  bonding_master :
  bonding_opts   :
  is static?     : False
  ip address     :
  subnet         :
  static routes  : []
  dns name       :
  dhcp tag       :
  virt bridge    : br9
interface        : eth1
  mac address    : 00:16:3e:77:4a:37
  bonding        :
  bonding_master :
  bonding_opts   :
  is static?     : True
  ip address     : X.X.X.X
  subnet         : X.X.X.X
  static routes  : []
  dns name       : my.host.name
  dhcp tag       : static
  virt bridge    : br2
Comment 4 Matt Shields 2009-02-24 13:34:55 EST
I'm seeing the same issue with cobbler-1.4.1-1.el5.noarch.rpm and cobbler-1.4.2-1.el5.noarch.rpm
Comment 5 Michael DeHaan 2009-02-25 14:30:23 EST
There was code added in 1.4.2 to eliminate this problem, though I could not repro it on my end after many tries.

If you are using serializer_yaml still in /etc/cobbler/modules.conf, then that most definitely doesn't have the fix.

If you are running 1.4.2 and still see a problem with serializer_catalog, then it's still present.

I'm going to dig further to figure out what might be causing this.   The serializer /should/ have locking code to prevent multiple writes at the same time, which was my first thought.  The infinite recursion traceback I've seen in the yaml module, however, may point to that being a culprit.
Comment 6 Michael DeHaan 2009-02-25 14:41:25 EST
Speculation about the infinite recursion problem may point to problems in the YAML library.  I'm not against removing the implementation we have and replacing it with pyyaml.

Anyway, that all being said, if anyone has the traceback caused by this (the infinite recursion one), please post it.  I've been looking through Trac/email and can't find a copy -- still looking.

If that points to yaml we'll investigate replacing our YAML library and this should be solved.
Comment 7 Matt Shields 2009-02-25 14:44:26 EST
If you can provide me the steps to get the traceback, I'll gladly get it for you.
Comment 8 Michael DeHaan 2009-04-06 08:35:08 EDT
This has been talked about a lot on the list, so hopefully not closing out the BZ a while back didn't leave anyone wondering.

This is fixed in 1.4.3 (swapping out the YAML parser eliminates the code that can go into an infinite recursion scenario completely), and fixed even better in 1.6 (moving to python-simplejson, where it's also nice and fast).  Upgrades happen automagically.

If anyone hasn't upgraded yet, they should try the latest 1.6.X and upgrade to that directly.

Note You need to log in before you can comment on or make changes to this bug.