cannot concatenate 'str' and 'lxml.etree._LogEntry' objects

Bug #413594 reported by Albert Cervera i Areny - http://www.NaN-tic.com
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Undecided
Christophe Simonis (OpenERP)

Bug Description

When developing I made a mistake and got the following error:

[2009-08-14 15:07:08,315] ERROR:web-services:[01]: Environment Information :
[2009-08-14 15:07:08,316] ERROR:web-services:[02]: PlatForm : Linux-2.6.26-2-xen-686-i686-with-debian-squeeze-sid
[2009-08-14 15:07:08,317] ERROR:web-services:[03]: Operating System : posix
[2009-08-14 15:07:08,318] ERROR:web-services:[04]: Operating System Release : 2.6.26-2-xen-686
[2009-08-14 15:07:08,319] ERROR:web-services:[05]: Operating System Version : #1 SMP Sun Jun 21 09:15:17 UTC 2009
[2009-08-14 15:07:08,320] ERROR:web-services:[06]: Operating System Architecture : 32bit
[2009-08-14 15:07:08,321] ERROR:web-services:[07]: Operating System Locale :
[2009-08-14 15:07:08,324] ERROR:web-services:[08]: Python Version : 2.5.4
[2009-08-14 15:07:08,325] ERROR:web-services:[09]: OpenERP-Server Version : 5.0.1
[2009-08-14 15:07:08,326] ERROR:web-services:[10]: Last revision No. & ID : Traceback (most recent call last):
[2009-08-14 15:07:08,326] ERROR:web-services:[11]: File "/project/openobject-server-5.0/bin/osv/osv.py", line 57, in wrapper
[2009-08-14 15:07:08,327] ERROR:web-services:[12]: if not pooler.get_pool(dbname)._ready:
[2009-08-14 15:07:08,328] ERROR:web-services:[13]: File "/project/openobject-server-5.0/bin/pooler.py", line 81, in get_pool
[2009-08-14 15:07:08,329] ERROR:web-services:[14]: pool = get_db_and_pool(db_name, force_demo, status, update_module)[1]
[2009-08-14 15:07:08,330] ERROR:web-services:[15]: File "/project/openobject-server-5.0/bin/pooler.py", line 40, in get_db_and_pool
[2009-08-14 15:07:08,331] ERROR:web-services:[16]: addons.load_modules(db, force_demo, status, update_module)
[2009-08-14 15:07:08,332] ERROR:web-services:[17]: File "/project/openobject-server-5.0/bin/addons/__init__.py", line 728, in load_modules
[2009-08-14 15:07:08,333] ERROR:web-services:[18]: r = load_module_graph(cr, graph, status, report=report)
[2009-08-14 15:07:08,334] ERROR:web-services:[19]: File "/project/openobject-server-5.0/bin/addons/__init__.py", line 618, in load_module_graph
[2009-08-14 15:07:08,335] ERROR:web-services:[20]: tools.convert_xml_import(cr, m, fp, idref, mode=mode, **kwargs)
[2009-08-14 15:07:08,336] ERROR:web-services:[21]: File "/project/openobject-server-5.0/bin/tools/convert.py", line 879, in convert_xml_import
[2009-08-14 15:07:08,337] ERROR:web-services:[22]: logger.notifyChannel('init', netsvc.LOG_ERROR, relaxng.error_log.last_error)
[2009-08-14 15:07:08,340] ERROR:web-services:[23]: File "/project/openobject-server-5.0/bin/netsvc.py", line 174, in notifyChannel
[2009-08-14 15:07:08,341] ERROR:web-services:[24]: msg = common().get_server_environment() + msg
[2009-08-14 15:07:08,342] ERROR:web-services:[25]: TypeError: cannot concatenate 'str' and 'lxml.etree._LogEntry' objects

The following patch fixes it for me:

=== modified file 'bin/netsvc.py'
--- bin/netsvc.py 2009-07-07 10:02:07 +0000
+++ bin/netsvc.py 2009-08-14 13:16:44 +0000
@@ -171,7 +171,7 @@
             msg = tools.exception_to_unicode(msg)

         if level in (LOG_ERROR,LOG_CRITICAL):
- msg = common().get_server_environment() + msg
+ msg = common().get_server_environment() + str(msg)

         result = tools.ustr(msg).strip().split('\n')
         if len(result)>1:

And then I get a proper error:

[2009-08-14 15:10:40,155] ERROR:init:[01]: Environment Information :
[2009-08-14 15:10:40,155] ERROR:init:[02]: PlatForm : Linux-2.6.26-2-xen-686-i686-with-debian-squeeze-sid
[2009-08-14 15:10:40,155] ERROR:init:[03]: Operating System : posix
[2009-08-14 15:10:40,156] ERROR:init:[04]: Operating System Release : 2.6.26-2-xen-686
[2009-08-14 15:10:40,156] ERROR:init:[05]: Operating System Version : #1 SMP Sun Jun 21 09:15:17 UTC 2009
[2009-08-14 15:10:40,156] ERROR:init:[06]: Operating System Architecture : 32bit
[2009-08-14 15:10:40,156] ERROR:init:[07]: Operating System Locale :
[2009-08-14 15:10:40,156] ERROR:init:[08]: Python Version : 2.5.4
[2009-08-14 15:10:40,156] ERROR:init:[09]: OpenERP-Server Version : 5.0.1
[2009-08-14 15:10:40,157] ERROR:init:[10]: Last revision No. & ID : /project/modules/test/test_view.xml:36:0:ERROR:RELAXNGV:RELAXNG_ERR_ATTRVALID: Element wizard failed to validate attributes
Traceback (most recent call last):
  File "openobject-server-5.0/bin/openerp-server.py", line 111, in <module>
    pooler.get_db_and_pool(db, update_module=tools.config['init'] or tools.config['update'])
  File "/project/openobject-server-5.0/bin/pooler.py", line 40, in get_db_and_pool
    addons.load_modules(db, force_demo, status, update_module)
  File "/project/openobject-server-5.0/bin/addons/__init__.py", line 728, in load_modules
    r = load_module_graph(cr, graph, status, report=report)
  File "/project/openobject-server-5.0/bin/addons/__init__.py", line 618, in load_module_graph
    tools.convert_xml_import(cr, m, fp, idref, mode=mode, **kwargs)
  File "/project/openobject-server-5.0/bin/tools/convert.py", line 875, in convert_xml_import
    relaxng.assert_(doc)
  File "lxml.etree.pyx", line 2669, in lxml.etree._Validator.assert_ (src/lxml/lxml.etree.c:99559)
AssertionError: Element wizard failed to validate attributes, line 36

Related branches

Changed in openobject-server:
assignee: nobody → Christophe (OpenERP) (kangol)
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.