[6.1 trunk] OpenERP + nginx blank page when download all files fail

Asked by Nhomar - Vauxoo

Hello.

I have a deploy running openerp-web client inside openerp-server.

I can access without any problem throught

http://my.domain.com:8069
And to gtk:
my.domain.com:8070

But, when i put nginx in front with this config:

http://paste.ubuntu.com/1209585/

It works from time to time but some issues appear:

1.- Extremelly slow from time to time it is shown, after +10 intents of refresh.
1.5 .- All the rest of times it is shown a blank sceen.
2.- Load the home screen, log in openerp and it works,
3.- Just click on close session and all blank again.

Server Shows no Errors, instead of that It shows the conection very good for static files:

2012-09-16 19:37:04,920 21119 INFO ? werkzeug: ip - - [16/Sep/2012 19:37:04] "GET / HTTP/1.0" 301 -
2012-09-16 19:37:05,185 21119 INFO ? werkzeug: ip - - [16/Sep/2012 19:37:05] "GET /web/webclient/home HTTP/1.0" 200 -
2012-09-16 19:37:06,034 21119 INFO ? werkzeug: ip - - [16/Sep/2012 19:37:06] "GET /web/webclient/css HTTP/1.0" 304 -
2012-09-16 19:37:07,044 21119 INFO ? werkzeug: ip - - [16/Sep/2012 19:37:07] "GET /web/webclient/js HTTP/1.0" 200 -

Nginx no show errors.
Chrome Js Console show this error:
   https://dl.dropbox.com/u/2428846/jserror.png

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Web (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Nhomar - Vauxoo
Solved:
Last query:
Last reply:
Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#1

Some hint about this issue?

Thanks!

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#2

http://paste.ubuntu.com/1210470/

This is the new config file , i reviewed some concepts bad done in the file exposed before, but the behaiviour is the same.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) said :
#3

The random JS errors you're seeing seem to indicate an issue with loading the combined javascript file (/web/webclient/js). It might be due to your connection, or to a timeout somewhere. If it works when nginx is not present, it should not be the connection, but there may be multiple factors involved...
At 60kB/s the loading of the 1.44Mb JS source should take about 25s, but it often fails after ~10s, when I see it from Belgium.
Might be worth a shot to enable gzip to speed up file downloads, as your upstream bandwidth seems to be capped very low (I suppose this is only meant as a test environment).

Have you checked the nginx logfiles thoroughly? Perhaps you can increase the logging details, to see more details about timeouts, upstream stuff, etc.

Also, why do you have an nginx 'upstream' config with only a single server? Try to remove that, just to make sure it's not part of the problem, and directly proxy_pass to the OpenERP server. Or try duplicating the same 'server' line twice in your 'upstream' block, as mentioned in the nginx wiki: http://wiki.nginx.org/HttpUpstreamModule#server

Basically your nginx config looks ok, but you should try to remove all the extra bits (upstream, https, etc.) until you can get it to work reliably, and then add things back one by one, to see where it breaks.

PS: you can change the URL to /web/webclient/home?debug to enable loading JS files one by one, but that won't fix your problem. Check the network panel of your browser's debugging tools to see which files fail to load...probably the biggest ones.

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#4

Hello Friend.

Thanks for your answer.

First Point:

I enabled debug on nginx:

http://paste.ubuntu.com/1211676/

This is my first 1000 lines of my nginx inmediatly i created a new log and try to connect.

Second Point:

I enabled debug mode on webclient and this is how the JS console looks like:

https://dl.dropbox.com/u/2428846/jsDebug.png

Extra test:

I tryed to download:

wget https://foam.no-ip.info/web/static/lib/jquery.deferred-queue/jquery.deferred-queue.js
--2012-09-17 15:07:19-- https://foam.no-ip.info/web/static/lib/jquery.deferred-queue/jquery.deferred-queue.js
WARNING: gnome-keyring:: couldn't connect to: /tmp/keyring-bT1GKZ/pkcs11: No such file or directory
Resolving foam.no-ip.info (foam.no-ip.info)... 187.205.28.89
Connecting to foam.no-ip.info (foam.no-ip.info)|187.205.28.89|:443... connected.
ERROR: The certificate of `foam.no-ip.info' is not trusted.
ERROR: The certificate of `foam.no-ip.info' hasn't got a known issuer.
The certificate's owner does not match hostname `foam.no-ip.info'

Clearly this is the problem, i will follow testing,

IMHO this should be managed, trying to show some kind of screen when this happend, blank screen is really dificult to debug, and for some reason in some cases it is WORKING, and develop a tech strategy to download at least generic scripts from google code for example.

BTW, when i verify the certificate i will be in touch.

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#5

Hello,

More Tests:
I tried to donwload trhought wget and the error shown up is present, then i force the download for all files without ssl verification:

wget https://domain.of.my.server/web/static/lib/jquery.ui.timepicker/js/jquery-ui-timepicker-addon.js --no-check-certificate

And file is downloaded effectivally, i don't know how pass "--no-check-certificate" to chrome and firefox, but BTW IMHO i need to confirgure nginx to send this info in plain way, how do a do this?

Regards!

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#6

Ok.

More tests.

My new config file isolation the ssl stuff (i thought it was the problem) but not:

upstream openerpweb {
    server 192.168.1.71:8069 weight=1 max_fails=3 fail_timeout=30s;
    server 192.168.1.71:8069 weight=1 max_fails=3 fail_timeout=30s;
}

server {
    listen 80;
    server_name foam.no-ip.info;
    client_max_body_size 200m;
    access_log /var/log/nginx/openerp-access.log;
    error_log /var/log/nginx/openerp-error.log debug;
    location / {
        proxy_pass http://openerpweb;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
    }
}

I think the main js file on webclient have some kind of problem.

With this configuration i make :

wget http://my.ip.server/web/static/lib/jquery.ui.timepicker/js/jquery-ui-timepicker-addon.js

And all is downloaded fine, but throught openerp-web i have this issue on js console, several sintax errors and after the the first js error all is stopped.

https://dl.dropbox.com/u/2428846/httperror.png

Do i need post an OPW bug friends?.

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#7

Nginx Log when i make wget to an script:

http://paste.ubuntu.com/1212062/

Nginx Log when it fails.

http://paste.ubuntu.com/1212063/

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#8

Other test, it doesn't work at all! following your advice @oliver:

1.- nginx config file without any noise just the proxy.

http://paste.ubuntu.com/1212134/

2.- nginx debuger log, without any noise.

http://paste.ubuntu.com/1212126/

3.- openerp debuger log

http://paste.ubuntu.com/1212132/

The good news here is that with ?debug it run very fine, al is loaded, the issue is sending all js file at ones, the first script on openerp-web left the webpage blank, ¿shouldn't it show some kind of basic error, a message or somethis like a try: except if some "$" is not found.?

Well but BTW it is not working.

I have all in a VM's enviroment.

"main physical machine" > "openerp virtual machine"
                                                                     ^
                                                "postgres Master virtual machine"

If it helps to you to enlight me.

Thanks a lot to everybody.

Regards.

Revision history for this message
Cristian Salamea (ovnicraft) said :
#9

I highly recommend you read this: http://www.theopensourcerer.com/2012/03/how-to-openerp-6-1-ubuntu-10-04-lts-nginx-ssl-reverse-proxy/

I configure my servers based on it.

Regards,

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#10

Ok.

Thanks for your help, just informing all my initial config was based on this how-to,

see my first config file.
http://paste.ubuntu.com/1209585/

Where in proxy_pass i putt openerpweb (not the ip.of.my.server) as the example explain.

The problem here looks like openerp-web is not sending correctly all js files at same time, or using some kind of local cache to do that, cause in my case i have nginx in other server it is broken.

BTW, Thanks for take 5 minutes in try to enlight me.

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#11

I extend the timeout taking parameters from some places:

When i crete a new db:

<html>
<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx/1.1.19</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->

This error appear.

If i open more than one navigator.

Error again "Blank page."

I could log in server from one navigator at times.

My new config file "Just proxying."

server {
    listen 80;
    server_name foam.no-ip.info;
    access_log /var/log/nginx/openerp-access-http.log;
    error_log /var/log/nginx/openerp-error-http.log;
    location / {
        proxy_pass http://192.168.1.71:8069;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
        # by default, do not forward anything
        proxy_redirect off;
    }
    location ~* /web/static {
        proxy_cache_valid 200 60m;
        proxy_buffering on;
        expires 864000;
        proxy_pass http://192.168.1.71:8069;
    }
}

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#12

When i log in to server:

Other error.

Su versión de OpenERP no está soportada. Los servicios de soporte & mantenimiento están disponibles aqui:OpenERP Enterprise.
Uncaught The key default_home was not found
http://foam.no-ip.info/web/webclient/js:22517

Regards.

Revision history for this message
Mario Montes (syci) said :
#13

Nhomar, hola, si quieres prueba esta instalación que esta con 6.1 usuario demo/demo sobre la bd:demo y ya me dices.
Está con nginx hacia un server 8069, tengo varios servidores en modo SaaS y van perfecto.

https://openerp.syci.es

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#14

@all

I must to add other information that i could not replicate yet:

port 8069 is tottally blocked, i can access to this server Just for :443 or :80

@mario

Muchas gracias

Todo está en el mismo server?¿

Local toda mi configuración funciona, pero yo tengo una arquitectura de :

nginx > openerp > postgres

En máquinas diferentes openerp y postgres están en máquinas virtuales.

Cual es el puerto netrpc de tu server?

sa;ludos

Revision history for this message
Mario Montes (syci) said :
#15

xmlrpc_port = 8069 (no estoy usando netrpc ya que dentro de poco solo XMLRPC y JSON)

Todo está en el mismo servidor menos el nginx, tienes que tener en cuenta que tu fichero hosts del server nginx tiene que apuntar la IP interna a foam.no-ip.info porque si intenta resolver hacia afuera no va ir bien.

Para el https redirijo completo:

server {

listen 80;
server_name openerp.syci.es;
rewrite ^ https://$host$request_uri? permanent;
}

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) said :
#16

Hi Nhomar,

There is no problem with downloading the unified JS file in openerp-web, it's just a large file and your system seems to have trouble sending large files. It does not seem to be a problem of OpenERP at all since it works when you connect directly to 8069. In debug mode the browser downloads many smaller JS files instead, but even in this case the bigger ones fail, same problem (I can see it from here).

The certificate warning is not relevant, you have certainly seen a warning the first time you connected to nginx with your browser, and you have added a security exception, so it is totally trusting the certificate. Otherwise you would not be able to even see a blank page. Look elsewhere.

BTW openerp-web cannot do much to help you debug the problem: it cannot even start. Imagine you try to run the OpenERP server and you have random source files missing in your install, how could OpenERP warn you except with a random error in the terminal? ;-) Of course it could give a generic error, but that would not help you much in this case.

What kind of network topology/restrictions do you have in place on this connection. You're saying that port 8069 is totally blocked, so how did you test without going through nginx? Did you do it via another network? If yes, what is different between the 2 connections? Is there a firewall or proxy that could drop long connections? What else is running on this network?
Try to have the simplest setup first, i.e. no firewall, no proxy, just OpenERP, then add nginx+proxy, then add the rest, one step at a time.
And to convince yourself that this really works, install OpenERP + nginx on your own laptop and you will see that it works reliably.

Revision history for this message
David Diz (daviddiz) said :
#17

I am suffering the same issue with the web client.
The error that shows is:

uncaught exception: The key default_home was not found

I have OpenERP 6.1 + Nginx too.

For Nhomar or Olivier , have you made ​​some progress on this issue?

Revision history for this message
David Diz (daviddiz) said :
#18

Ok , i think that's an internal issue because the error only happens with an external request.
The problem could be the firewall or another reverse proxy installed in our infrastructure,
i will continue searching the error

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#19

dude/.

This problem was because my ISP was blocking soem ports , what i didn'y understand is that the web some times works wwith the same error.

I change my ISP , open correctly my NAT and all works smoth.

FYI I will close this quetion, but, what i think is a bug i that the client raise an undescriptible error, but this is other history.

THanks Oliver.