Odoo Help

Welcome!

This community 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.

0

TypeError: Level not an integer or a valid string

By
David Dean
on 6/17/14, 10:19 AM 1,658 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.

 

 

 

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

0
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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

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