Ticket #993 (closed defect: fixed)

Opened 12 years ago

Last modified 12 years ago

Traceback on ConfigFile with unicode char in it

Reported by: acherry Owned by: solj
Priority: major Milestone: Bcfg2 1.2.0 Release
Component: bcfg2-server Version: 1.0
Keywords: Cc:


We have a ConfigFile? defined that contains a unicode character that bcfg2-server is unable to decode. This results in a traceback on the server side, and a failure to create the file on the client side. I also tried this on our test server running 1.1.1, and the problem persists there, with the addition of a client-side traceback.

Server-side traceback

Feb 28 20:40:31 mgt14 bcfg2-server[4306]: Unexpected failure in BindStructure:
 Path /var/lib/ubcache/project-contacts
 Traceback (most recent call last):
   File "/usr/lib64/python2.4/site-packages/Bcfg2/Server/", line 202, in BindStructure
     self.Bind(entry, metadata)   File "/usr/lib64/python2.4/site-packages/Bcfg2/Server/", line 235, in Bind
     return glist[0].Entries[entry.tag][entry.get('name')](entry, metadata)
   File "/usr/lib64/python2.4/site-packages/Bcfg2/Server/Plugins/", line 99, in bind_entry
     entry.text = unicode(data, self.encoding) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 20946: ordinal not in range(128)

Client-side traceback (in 1.1.1):

Installing ConfigFile /var/lib/ubcache/project-contacts
Unexpected failure of install method for entry type Path
Traceback (most recent call last):
  File "/usr/lib64/python2.4/site-packages/Bcfg2/Client/Tools/", line 150, in Install
    states[entry] = func(entry)
  File "/usr/lib64/python2.4/site-packages/Bcfg2/Client/Tools/", line 735, in InstallPath
    return ret(entry)
  File "/usr/lib64/python2.4/site-packages/Bcfg2/Client/Tools/", line 715, in Installfile
    return ret(entry)
  File "/usr/lib64/python2.4/site-packages/Bcfg2/Client/Tools/", line 674, in InstallConfigFile
TypeError: argument 1 must be string or read-only character buffer, not None


Change History

comment:1 Changed 12 years ago by acherry

  • Component changed from bcfg2-client to bcfg2-server

comment:2 Changed 12 years ago by solj

  • Owner changed from desai to solj
  • Status changed from new to accepted

You have 2 options in this case. You can either specify UTF-8 for the enconding on the server in bcfg2.conf or you can set it to base64 in your info.xml file. If you choose the latter, you will not get readable diffs in the reporting system.

Will keep this ticket open until we have verified that the tracebacks are fixed.

comment:3 Changed 12 years ago by solj

  • Milestone set to Bcfg2 1.1.2 Release (Bugfix)

comment:4 Changed 12 years ago by solj

  • Status changed from accepted to closed
  • Resolution set to fixed

This traceback is fixed in 3c290811195e23c9a948ac15c304b34ea16fbe9b.

comment:5 Changed 12 years ago by solj

  • Milestone changed from Bcfg2 1.1.2 Release (Bugfix) to Bcfg2 1.2.0 Release

WARNING! You need to establish a session before you can create or edit tickets. Otherwise the ticket will get treated as spam.


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.