v6 AttributeError: 'NoneType' object has no attribute 'locale'

Bug #664536 reported by GEM
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Odoo Web Client
Fix Released
Undecided
Unassigned

Bug Description

Hi,

ubuntu
revision rc1 and last revision :

see topic on openerp forum (I have no ubuntu) :
http://www.openerp.com/forum/post68229.html#p68229

log :

File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/rpc_utils.py", line 36, in <module>
init_rpc_session()
File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/rpc_utils.py", line 34, in init_rpc_session
rpc.initialize(host, port, protocol, storage=CPSessionWrapper())
File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/rpc.py", line 374, in initialize
session = RPCSession(host, port, protocol, storage=storage)
File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/rpc.py", line 246, in __init__
raise common.message(_("Unsupported protocol."))
File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/openobject/i18n/_gettext.py", line 127, in gettext2
value = gettext(key, locale, domain)
File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/openobject/i18n/_gettext.py", line 123, in gettext
return _gettext(key, locale, domain)
File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/openobject/i18n/_gettext.py", line 70, in _gettext
locale = get_locale()
File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/openobject/i18n/utils.py", line 71, in get_locale
locale = rpc.session.locale
AttributeError: 'NoneType' object has no attribute 'locale'

modify in openobject\i18n\utils.py line 70
from openerp.utils import rpc
by
from addons.openerp.utils import rpc

and after this an other error comes (always in th log I gave before) :

File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/__init__.py", line 4, in <module>
import rpc_utils
File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/rpc_utils.py", line 36, in <module>
init_rpc_session()
File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/rpc_utils.py", line 34, in init_rpc_session
rpc.initialize(host, port, protocol, storage=CPSessionWrapper())
File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/rpc.py", line 374, in initialize
session = RPCSession(host, port, protocol, storage=storage)
File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/rpc.py", line 246, in __init__
raise common.message(_("Unsupported protocol."))
File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/common.py", line 78, in message
raise TinyMessage(message=msg)
TinyMessage: Unsupported protocol.

Bye

Revision history for this message
Sam_inv (s-hollanders) wrote :

This would be my bug.

All suggestions GEM made didn't work out.

Thx

Revision history for this message
Navrang Oza (noz-tiny) wrote :

Hello,

Can any one tell me what steps you are doing exactly to run install web client ?
Is there installation problem ?

Thanks.

Revision history for this message
Sam_inv (s-hollanders) wrote :

Hi,

I actually tried it with 2 different methods.

One was the Allinone installer from I. Frenandez at OpenerpAppliance.com

The other install was made following the instructions in the Openerp Documentation, downloading the server and webclient from the download page on Openerp.com insteed of using Bazaar.

Then an additional install of Python Yaml and Mako.
And the use of sudo python setup.py install instead of the easy_install.

During both installations I didn't receive any error messages.

Thx

Revision history for this message
Cesitar Jones (cesitarjones) wrote :

I have the same issue in clean installs of Ubuntu 10.04 LTS. I got the sources with bzr. I tried with and without installation.

Revision history for this message
Cesitar Jones (cesitarjones) wrote :

I tested the web client in an Ubuntu Desktop with the same result as before if started from a terminal window but works fine if run thru pydev/eclipse. (I only have a version of python setup).

Revision history for this message
Cesitar Jones (cesitarjones) wrote :

my problem was somewhere in my configuration file. the instance over eclipse / pydev created a default config file and worked on it. the differences between the default config file and mine were:

default:
#tools.proxy.on = True

mine :
tools.proxy.on = False

and the following line was missing in my config file : tools.nestedvars.on = True

Revision history for this message
Sam_inv (s-hollanders) wrote :

Cesitar,

Could you tell me what the locations are of both files?
I thought there was only 1 under /etc

Sam

Revision history for this message
Cesitar Jones (cesitarjones) wrote : Re: [Bug 664536] Re: v6 AttributeError: 'NoneType' object has no attribute 'locale'
Download full text (4.0 KiB)

Sure. the default location for the config file is under /etc when you follow
the install procedure. But you also can run the web client without install.
That's my case. My customized file was under my home folder. the one created
by the web client was in a folder named "doc" under the web client folder
(for instance: /home/<user>/trunk/web/doc/)

the web client only needs one of them.

On Sun, Oct 24, 2010 at 6:03 AM, Sam_inv <email address hidden> wrote:

> Cesitar,
>
> Could you tell me what the locations are of both files?
> I thought there was only 1 under /etc
>
> Sam
>
> --
> v6 AttributeError: 'NoneType' object has no attribute 'locale'
> https://bugs.launchpad.net/bugs/664536
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in OpenObject Web Client: New
>
> Bug description:
> Hi,
>
> ubuntu
> revision rc1 and last revision :
>
> see topic on openerp forum (I have no ubuntu) :
> http://www.openerp.com/forum/post68229.html#p68229
>
> log :
>
> File
> "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/rpc_utils.py",
> line 36, in <module>
> init_rpc_session()
> File
> "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/rpc_utils.py",
> line 34, in init_rpc_session
> rpc.initialize(host, port, protocol, storage=CPSessionWrapper())
> File
> "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/rpc.py",
> line 374, in initialize
> session = RPCSession(host, port, protocol, storage=storage)
> File
> "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/rpc.py",
> line 246, in __init__
> raise common.message(_("Unsupported protocol."))
> File
> "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/openobject/i18n/_gettext.py",
> line 127, in gettext2
> value = gettext(key, locale, domain)
> File
> "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/openobject/i18n/_gettext.py",
> line 123, in gettext
> return _gettext(key, locale, domain)
> File
> "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/openobject/i18n/_gettext.py",
> line 70, in _gettext
> locale = get_locale()
> File
> "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/openobject/i18n/utils.py",
> line 71, in get_locale
> locale = rpc.session.locale
> AttributeError: 'NoneType' object has no attribute 'locale'
>
> modify in openobject\i18n\utils.py line 70
> from openerp.utils import rpc
> by
> from addons.openerp.utils import rpc
>
>
> and after this an other error comes (always in th log I gave before) :
>
> File
> "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/__init__.py",
> line 4, in <module>
> import rpc_utils
> File
> "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/rpc_utils.py",
> line 36, in <module>
> init_rpc_session()
> File
> "/usr/local/lib/python2.6/dist-packages/ope...

Read more...

Revision history for this message
Jeroen Vet (jeroen-vet) wrote :

Hi, I struggled with the same issue as GEM reported but could solve the problem. The cause is and old format in the openerp-web.cfg file.
The old format is:
# OpenERP Server
[openerp]
host = 'localhost'
port = '8070'
protocol = 'socket'

whereas the new format should be:
# OpenERP Server
openerp.server.host = 'localhost'
openerp.server.port = '8070'
openerp.server.protocol = 'socket'
openerp.server.timeout = 450

The script of Fernandez has not been fully updated for version 6 so after installing the web server it overwrites the new config file with an old format. The new format is in the doc folder of the openerp-web directory.

Revision history for this message
Sam_inv (s-hollanders) wrote :

Thx for the reply.

I tried your solution and changed the file located at /etc/openerp-web.cfg
Then restarted both server and web.

But my output is still the same.

Sam

Revision history for this message
Jeroen Vet (jeroen-vet) wrote :

Hi Sam,
Strange I could be sure it was because "protocol" is not read from the config file. It was not defined so that resulted in the "Unsupported protocol" message and the subsequent error. You are sure the new config file is supplied as a parameter when you start openerp-web? Does the file have the right permissions? Sorry if I insult your intelligence.

Revision history for this message
Cesitar Jones (cesitarjones) wrote :
Download full text (5.4 KiB)

I don't have too much experience with Openerp, linux and the works. Don't
know exactly what is going on. Probably Jeroen Vet is right. But if you
still have problems maybe you can check or try my install procedure:

1. Install Linux Ubuntu 10.04 LTS in a empty virtual box using the virtual
machine install mode. Perform a full system upgrade. (I guess this is not
required if you install a newer version).
2. Install dependencies with apt-get:
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y install postgresql wget bzr language-pack-es
language-support-es python python-dev build-essential python-setuptools
python-psycopg2 python-reportlab python-egenix-mxdatetime python-tz
python-pychart python-pydot python-lxml python-libxslt1 python-vobject
graphviz python-libxml2 python-imaging python-profiler python-openssl
python-matplotlib python-hippocanvas python-yaml python-mako
python-xlwt python-cherrypy3 python-formencode python-simplejson
python-pybabel
3. sudo easy_install -U setuptools (Don't thing this is really needed)
4. edit postgresql config files
5. reboot
6. Download the bzr sources. I prefer to do this inside the user folder
instead of /opt:
mkdir openerp
cd openerp
bzr branch lp:openerp openerp
mkdir trunk
cd trunk
python bzr_set.py -v trunk
(if you already have downloaded the branches, just perform un update)
7. Then try to execute the trunk/server/bin/./openerp-server.py with command
line arguments for database setup. Use -s to save the settings.
8. Then try to execute the trunk/web/.openerp-web.py without arguments.
9. If everything works, kill the servers and edit the config files created.
The web client's is in the doc folder.

Good luck!

On Wed, Oct 27, 2010 at 8:52 AM, Sam_inv <email address hidden> wrote:

> Thx for the reply.
>
> I tried your solution and changed the file located at /etc/openerp-web.cfg
> Then restarted both server and web.
>
> But my output is still the same.
>
> Sam
>
> --
> v6 AttributeError: 'NoneType' object has no attribute 'locale'
> https://bugs.launchpad.net/bugs/664536
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in OpenObject Web Client: New
>
> Bug description:
> Hi,
>
> ubuntu
> revision rc1 and last revision :
>
> see topic on openerp forum (I have no ubuntu) :
> http://www.openerp.com/forum/post68229.html#p68229
>
> log :
>
> File
> "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/rpc_utils.py",
> line 36, in <module>
> init_rpc_session()
> File
> "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/rpc_utils.py",
> line 34, in init_rpc_session
> rpc.initialize(host, port, protocol, storage=CPSessionWrapper())
> File
> "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/rpc.py",
> line 374, in initialize
> session = RPCSession(host, port, protocol, storage=storage)
> File
> "/usr/local/lib/python2.6/dist-packages/openerp_web-6.0.0_rc1-py2.6.egg/openerp-web/addons/openerp/utils/rpc.py",
> line 246, in __init__
> raise common.message(_("Unsupported protocol."))
> File
> ...

Read more...

Revision history for this message
Sam_inv (s-hollanders) wrote :

Jeroen,

I'm not on it expert just a good user of software, so I'm not insulted at all, rather glad someone is helping.
The process that is running for Web = /usr/bin/python /usr/local/bin/openerp-web -c /etc/openerp-web.cfg
the permissions are set as 0644.

Cesitar.

I'll try that later on since the gtk client is working I am able to test, but for some reason the web interface feels better to me.

Thx,
Sam

Revision history for this message
Vadim - Enapps LTD (vadim-enapps) wrote :

I had the same error when using the allinone installer which is fixed by simply copying the default cfg file to the /etc.

sample cfg file is here: http://www.smartmode.co.uk/data/files/files/openerp-web.cfg

then restart the web-server - /etc/init.d/openerp-web restart

Revision history for this message
Sam_inv (s-hollanders) wrote :

Thx,

It works now, your script did for the openerp-web.cfg did the trick.

For those who are interested in attachment you can find the script that I had under /etc that was not working.
Maybe this way the programmers can find what was wrong with it.

thx again,
Sam

Changed in openobject-client-web:
status: New → Fix Released
Revision history for this message
MED (benkhalifamohamed) wrote :

CentOs 5:
OpenERP Server V 6.0.0

I installed OpenERP Web 6.0.1,The problem was solved by re-installing OpenERP Web Client with the version 6.0.0.

I think that the bug is related with the new package of sources of the new version Web 6.0.1!

Thx
Med

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.