Odoo Help


TypeError: Level not an integer or a valid string

David Dean
on 6/17/14, 10:19 AM 3,272 views

I've installed Odoo 7.0 from git on CentOS 6.5 with Python 2.7. When I start Odoo I see this error:

(odoo)[odoo@erp ~]$ odoo-server -c /etc/odoo-server.conf --log-level=notset
Traceback (most recent call last):
  File "/usr/bin/odoo-server", line 5, in <module>
  File "/opt/odoo/openerp/cli/__init__.py", line 61, in main
  File "/opt/odoo/openerp/cli/server.py", line 272, in run
  File "/opt/odoo/openerp/cli/server.py", line 232, in main
  File "/opt/odoo/openerp/netsvc.py", line 244, in init_logger
  File "/usr/local/lib/python2.7/logging/__init__.py", line 1136, in setLevel
    self.level = _checkLevel(level)
  File "/usr/local/lib/python2.7/logging/__init__.py", line 191, in _checkLevel
    raise TypeError("Level not an integer or a valid string: %r" % level)
TypeError: Level not an integer or a valid string: <function critical at 0x7feafd1d8de8>


However I know the level string is correct because when I enter an invalid string Odoo notifies me:

(odoo)[odoo@erp ~]$ odoo-server -c /etc/odoo-server.conf --log-level=INFO
Usage: odoo-server [options]

odoo-server: error: option --log-level: invalid choice: 'INFO' (choose from 'info', 'debug_rpc', 'warn', 'test', 'critical', 'debug_sql', 'error', 'debug', 'debug_rpc_answer', 'notset')

Any ideas what I'm doing wrong here?

Werkzeug is  version 0.9.6.





have you tried in capitals?: --log-level=NOTSET

Hannes Smit
on 6/17/14, 10:55 AM

I'm sorry, this was a mistake.. 'notset' is working in my 7.0 version.

Hannes Smit
on 6/17/14, 11:02 AM

The problem still happens if I try 'info' or 'critical' or any of the other options. Anything in uppercase results in: "error: option --log-level: invalid choice: 'NOTSET' (choose from 'info', 'debug_rpc', 'warn', 'test', 'critical', 'debug_sql', 'error', 'debug', 'debug_rpc_answer', 'notset')" ...but if I select any of these options, e.g. critical, info, debug, etc it says: "TypeError: Level not an integer or a valid string:"

David Dean
on 6/17/14, 11:05 AM
Hannes Smit
On 6/17/14, 10:57 AM

Well, it seems that the mapping in init_logger() in netsvc doesn't define notset.

So, maybe it defaults to the main loggers. I'm not sure why you're getting this error. Are you using a configuration file as well maybe??

David Dean
On 6/17/14, 11:11 AM

Ok, problem solved. I had the following line defined in the Odoo configuration file:

log_handler = werkzeug:critical

Commenting this line allowed Odoo to startup normally.


Thanks to everyone for their help. I spent many hours trying to figure this one out!

@David: do you know why this werkzeug was in your configuration file?

Hannes Smit
on 6/18/14, 4:49 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 6/17/14, 10:19 AM
Seen: 3272 times
Last updated: 3/16/15, 8:10 AM