Bug 443454 - python errors when cobbler sync command is run
python errors when cobbler sync command is run
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: cobbler (Show other bugs)
8
i686 Linux
low Severity low
: ---
: ---
Assigned To: Michael DeHaan
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-21 12:50 EDT by Tim McConnell
Modified: 2008-04-21 17:23 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-04-21 17:03:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
default cobbler kickstart file (889 bytes, text/plain)
2008-04-21 13:22 EDT, Tim McConnell
no flags Details
dhcpd.conf (445 bytes, text/plain)
2008-04-21 13:24 EDT, Tim McConnell
no flags Details
Settings for cobbler (1.53 KB, text/plain)
2008-04-21 13:27 EDT, Tim McConnell
no flags Details
distros (1.31 KB, text/plain)
2008-04-21 15:00 EDT, Tim McConnell
no flags Details
/profiles (680 bytes, text/plain)
2008-04-21 15:00 EDT, Tim McConnell
no flags Details
/systems (7 bytes, text/plain)
2008-04-21 15:01 EDT, Tim McConnell
no flags Details

  None (edit)
Description Tim McConnell 2008-04-21 12:50:06 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):


How reproducible:
type cobbler sync at CLI 

Steps to Reproduce:
1. Set cobbler to manage DHCP in /var/lib/cobbler/settings
2.save file 
3. run cobbler sync
  
Actual results:
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/cobbler/cobbler.py", line 54, in main
    return BootCLI().run(sys.argv)
  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__
    self.deserialize()
  File "/usr/lib/python2.5/site-packages/cobbler/api.py", line 364, in deserialize
    return self._config.deserialize()
  File "/usr/lib/python2.5/site-packages/cobbler/config.py", line 169, in
deserialize
    if not serializer.deserialize(x,topological=True):
  File "/usr/lib/python2.5/site-packages/cobbler/serializer.py", line 92, in
deserialize
    rc = storage_module.deserialize(obj,topological)
  File "/usr/lib/python2.5/site-packages/cobbler/modules/serializer_yaml.py",
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
    return self.parseLines()
  File "/usr/lib/python2.5/site-packages/cobbler/yaml/load.py", line 95, in
parseLines
    return self.parse_collection(self.dictionary(), self.parse_map_line)
  File "/usr/lib/python2.5/site-packages/cobbler/yaml/load.py", line 101, in
parse_collection
    lineParser(items)
  File "/usr/lib/python2.5/site-packages/cobbler/yaml/load.py", line 115, in
parse_map_line
    self.parse_map_line_simple(items, self.line)
  File "/usr/lib/python2.5/site-packages/cobbler/yaml/load.py", line 136, in
parse_map_line_simple
    self.error("bad key for map")
  File "/usr/lib/python2.5/site-packages/cobbler/yaml/load.py", line 64, in error
    self.nestedDocs.error(msg, self.line)
  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:
manage_dhcp 0


Expected results:
for cobbler to manage DHCP and not throw errors

Additional info:
Comment 1 Michael DeHaan 2008-04-21 12:58:02 EDT
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.

Comment 2 Tim McConnell 2008-04-21 12:59:12 EDT
please reply to tmcconnell@soleranetworks.com 
Comment 3 Tim McConnell 2008-04-21 13:01:56 EDT
(In reply to comment #1)
> You did not specifiy a version above.  What does "rpm -q cobbler" give you?
 
cobbler-0.8.3-3.fc8

> 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" ? 
Comment 4 Tim McConnell 2008-04-21 13:03:52 EDT
(In reply to comment #1)
> You did not specifiy a version above.  What does "rpm -q cobbler" give you?
 
cobbler-0.8.3-3.fc8

> 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" ? 
Comment 5 Michael DeHaan 2008-04-21 13:13:30 EDT
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.



Comment 6 Michael DeHaan 2008-04-21 13:14:38 EDT
(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)


Comment 7 Tim McConnell 2008-04-21 13:22:43 EDT
Created attachment 303172 [details]
default cobbler kickstart file 

was edited to get the correct pxe ks file for our uses
Comment 8 Tim McConnell 2008-04-21 13:24:39 EDT
Created attachment 303175 [details]
dhcpd.conf 

cobbler needs to use these settings for our PXE server
Comment 9 Tim McConnell 2008-04-21 13:27:58 EDT
Created attachment 303177 [details]
Settings for cobbler 

The only other cobbler file I tried to edit besides th default kickstart file.
Comment 10 Michael DeHaan 2008-04-21 13:59:39 EDT
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:

/var/lib/cobbler/distros
/var/lib/cobbler/profiles
/var/lib/cobbler/systems

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
read back.

Thanks!
Comment 11 Tim McConnell 2008-04-21 15:00:09 EDT
Created attachment 303188 [details]
distros
Comment 12 Tim McConnell 2008-04-21 15:00:56 EDT
Created attachment 303189 [details]
/profiles 

/profiles
Comment 13 Tim McConnell 2008-04-21 15:01:33 EDT
Created attachment 303190 [details]
/systems 

/systems
Comment 14 Tim McConnell 2008-04-21 15:02:14 EDT
none of which I have edited 
Comment 15 Michael DeHaan 2008-04-21 15:20:45 EDT
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:
manage_dhcp 0
"""

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
file?
Comment 16 Tim McConnell 2008-04-21 15:43:22 EDT
Let me check something
Comment 17 Tim McConnell 2008-04-21 16:48:12 EDT
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? 
Comment 18 Michael DeHaan 2008-04-21 17:03:33 EDT
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.

Comment 19 Tim McConnell 2008-04-21 17:18:28 EDT
ok thanks for the help 
Comment 20 Michael DeHaan 2008-04-21 17:23:15 EDT
For future reference, a couple of faster ways to get help:

(A) IRC -- #cobbler on irc.freenode.net

(A) the mailing list, et-mgmt-tools@redhat.com -- subscription required --
https://www.redhat.com/archives/et-mgmt-tools/

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
https://admin.fedoraproject.org/accounts




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