Ticket #993 (closed defect: fixed)
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: |
Description
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/Core.py", line 202, in BindStructure self.Bind(entry, metadata) File "/usr/lib64/python2.4/site-packages/Bcfg2/Server/Core.py", 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/Cfg.py", 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/__init__.py", line 150, in Install states[entry] = func(entry) File "/usr/lib64/python2.4/site-packages/Bcfg2/Client/Tools/POSIX.py", line 735, in InstallPath return ret(entry) File "/usr/lib64/python2.4/site-packages/Bcfg2/Client/Tools/POSIX.py", line 715, in Installfile return ret(entry) File "/usr/lib64/python2.4/site-packages/Bcfg2/Client/Tools/POSIX.py", line 674, in InstallConfigFile newfile.write(filedata) TypeError: argument 1 must be string or read-only character buffer, not None
Attachments
Change History
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:4 Changed 12 years ago by solj
- Status changed from accepted to closed
- Resolution set to fixed
This traceback is fixed in 3c290811195e23c9a948ac15c304b34ea16fbe9b.