Red Hat Bugzilla – Bug 443454
python errors when cobbler sync command is run
Last modified: 2008-04-21 17:23:15 EDT
Description of problem:
multiple errors in /usr/lib/python2.5/site-packages/cobbler/cobbler.py file
after running cobbler sync command.
Version-Release number of selected component (if applicable):
type cobbler sync at CLI
Steps to Reproduce:
1. Set cobbler to manage DHCP in /var/lib/cobbler/settings
3. run cobbler sync
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/cobbler/cobbler.py", line 54, in main
File "/usr/lib/python2.5/site-packages/cobbler/cobbler.py", line 35, in __init__
self.api = api.BootAPI()
File "/usr/lib/python2.5/site-packages/cobbler/api.py", line 70, in __init__
File "/usr/lib/python2.5/site-packages/cobbler/api.py", line 364, in deserialize
File "/usr/lib/python2.5/site-packages/cobbler/config.py", line 169, in
if not serializer.deserialize(x,topological=True):
File "/usr/lib/python2.5/site-packages/cobbler/serializer.py", line 92, in
rc = storage_module.deserialize(obj,topological)
line 100, in deserialize
datastruct = yaml.load(data).next() # first record
File "/usr/lib/python2.5/site-packages/cobbler/yaml/load.py", line 84, in next
File "/usr/lib/python2.5/site-packages/cobbler/yaml/load.py", line 95, in
return self.parse_collection(self.dictionary(), self.parse_map_line)
File "/usr/lib/python2.5/site-packages/cobbler/yaml/load.py", line 101, in
File "/usr/lib/python2.5/site-packages/cobbler/yaml/load.py", line 115, in
File "/usr/lib/python2.5/site-packages/cobbler/yaml/load.py", line 136, in
self.error("bad key for map")
File "/usr/lib/python2.5/site-packages/cobbler/yaml/load.py", line 64, in error
File "/usr/lib/python2.5/site-packages/cobbler/yaml/stream.py", line 188, in error
raise YamlLoaderException(msg, self.lastLineRead(), line, self.filename)
YamlLoaderException: bad key for map:
near line 19:
for cobbler to manage DHCP and not throw errors
You did not specifiy a version above. What does "rpm -q cobbler" give you?
It looks like you've somehow broken your save files in /var/lib/cobbler. You
will probably want to remove them and try again.
Without knowing how they got in this state I'm not sure what can be done.
Hand-editing is the most likely cause, but it could be that you've managed to
feed the cobbler command line or web app some data it doesn't like. That's the
kind of data I need to find out what we would need to filter against.
A stock "cobbler sync" does not throw this error.
please reply to firstname.lastname@example.org
(In reply to comment #1)
> You did not specifiy a version above. What does "rpm -q cobbler" give you?
> It looks like you've somehow broken your save files in /var/lib/cobbler. You
> will probably want to remove them and try again.
> Without knowing how they got in this state I'm not sure what can be done.
> Hand-editing is the most likely cause, but it could be that you've managed to
> feed the cobbler command line or web app some data it doesn't like. That's the
> kind of data I need to find out what we would need to filter against.
> A stock "cobbler sync" does not throw this error.
Okay Hand editing the /etc/dhcpd.conf file is a no no so how do you make cobbler
"manage DHCP" ?
Hand editing the DHCP file is quite sane, hand editing /var/lib/cobbler/distros,
profiles, or systems is not.
Did you do any of that?
It could also be that you have a problem with the syntax of your settings file
as well, perhaps maybe there's an extra space after the "1" where you turned on
manage_dhcp ? Attach the settings file and your other config files and I can
perhaps take a look at them to see where the problem lies.
(To clarify, the file you should be editing when using DHCP management is
/etc/cobbler/dhcp.template, which cobbler uses to render /etc/dhcpd.conf)
Created attachment 303172 [details]
default cobbler kickstart file
was edited to get the correct pxe ks file for our uses
Created attachment 303175 [details]
cobbler needs to use these settings for our PXE server
Created attachment 303177 [details]
Settings for cobbler
The only other cobbler file I tried to edit besides th default kickstart file.
Thanks for the attaching the settings file, the other two files are not going to
be problems, as the error is a YAML parsing error.
The files I need to see are:
If you didn't hand edit them, it's still possible the command line was GIGO'd
somehow, and that may help me understand what data got inserted in that it can't
Created attachment 303188 [details]
Created attachment 303189 [details]
Created attachment 303190 [details]
none of which I have edited
I can't reproduce the error with any of the attached files.
Looking over the information again, the error does end with this:
YamlLoaderException: bad key for map:
near line 19:
In which case it looks like you are missing a colon between manage_dhcp and the
0, yet this is the not the same as the file you emailed. Possibly not the same
Let me check something
OK in the one I uploaded to the site it has multiple manage_dhcp entries, I
removed an re installed cobbler and the new file only has one manage_dhcp entries.
maybe the multiple entries are the problem?
Possible. The lack of the colon is also a problem.
Either way, sounds like you are fixed.
I'm probably going to look for some way to migrate the new installs away from
the slightly confusing YAML syntax for that one config file in a later version.
ok thanks for the help
For future reference, a couple of faster ways to get help:
(A) IRC -- #cobbler on irc.freenode.net
(A) the mailing list, email@example.com -- subscription required --
Bugzilla is of course fine, but this saves the trouble of filling out the
various fields and allows for other people to answer, so you might have your
problem resolved more quickly.
Generally I primarily use Trac for keeping track [sic] of Cobbler items --
https://fedorahosted.org/cobbler where you can find an account at