Skip to Content
Menu
This question has been flagged
2 Replies
13592 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>
    openerp.cli.main()
  File "/opt/odoo/openerp/cli/__init__.py", line 61, in main
    o.run(args)
  File "/opt/odoo/openerp/cli/server.py", line 272, in run
    main(args)
  File "/opt/odoo/openerp/cli/server.py", line 232, in main
    openerp.netsvc.init_logger()
  File "/opt/odoo/openerp/netsvc.py", line 244, in init_logger
    logger.setLevel(level)
  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.

Thanks.

 

 

 

Avatar
Discard

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

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

Author

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:"

Best Answer

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??

Avatar
Discard
Author Best Answer

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!

Avatar
Discard

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