Skip to Content
Menu
This question has been flagged
3 Replies
12841 Views

Hi,

I am introducing Odoo in our organization and encounter an error in my browser (Firefox and Safari).
After finding the problem location, I have a solution, but I am not certain what the best way forward is. First, is patching the code enough or is this a symptom of another problem? Second, what is the best way to submit the patch? As you might guess, I am new to tinkering with Odoo. Please advise.

Here are the details. Request:

http://192.168.99.100/web?debug=#page=0&limit=80&view_type=list&model=project.project&action=142 

Popup:

Odoo Client Error
TypeError: undefined is not an object (evaluating 'val.constructor')
http://192.168.99.100/web/static/src/js/pyeval.js:814

After clicking OK (:-)) the next pop-up says:

Odoo Client Error
TypeError: undefined is not an object (evaluating 'dict['widget'].get('value')[1]')
undefined:74

 I use Odoo version 8.0-20150401 from the Docker image. The code at odoo-8.0/addons/web/static/src/js/pyeval.js 814 is:

var wrap_context = function (context) {
for (var k in context) {
if (!context.hasOwnProperty(k)) { continue; }
var val = context[k];
if (val === null) { continue; } // <======= also test against undefined?
if (val.constructor === Array) { // <======= line 814
context[k] = wrapping_list.fromJSON(val);
} else if (val.constructor === Object
&& !py.PY_isInstance(val, py.object)) {
context[k] = wrapping_dict.fromJSON(val);
}
}
return context;
};

At first glance I would say that the test for null should also include a test for undefined. Any thoughts from more experienced hackers?

Regards, Markus

Avatar
Discard
Author

Judging by the comments and answers, no one else encounters this problem. It was probably caused by a timeout of the nginx proxy. After tuning the proxy and restoring a backup of the data we seem to have no reoccurrence of the problem. Thank you for your time :-)

Author Best Answer

The timeout reported in the nginx log coincided with a request causing long query of the DB. As soon as the nginx timeout was longer than the query time the problem disappeared.

My guess is that the timeout reply received by the client is not converted to a proper error/exception structure in the 'context' array, causing an undefined entry in the array.

FYI: the relevant lines in nginx.conf to prevent the problem in my situation are:

http { 
server {
proxy_connect_timeout 600s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;

Hope this helps.

Regards, Markus

Avatar
Discard
Best Answer

I just got the same error in a custom form, but there is no network traffic when the error occurs. How did you connect it to a proxy problem?

Avatar
Discard
Related Posts Replies Views Activity
1
Mar 24
905
0
Oct 23
1579
0
Mar 16
3771
0
Mar 15
3974
1
Jun 24
235