Odoo Help

0

Exception: bus.Bus unavailable

By
SEAN CALLAHAN
on 4/28/16, 1:16 AM 4,535 views

Hello,


I have Odoo9 and am getting this error when I try to click  "conversations" (top right hand corner) to send messages. When I refresh the page, the messagebox appears. When I type, the message will not appear until I refresh the page.


I am using nginx and workers =3, and I have read other similar discussions about how it might be something to do with the nginx ports but I'm unsure of what I have to change to fix this. Other discussions talked about missing libraries but I have installed those. Any help would be greatly appreciated.


Traceback (most recent call last):

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 643, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 680, in dispatch

result = self._call_function(**self.params)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 316, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 118, in wrapper

return f(dbname, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 309, in checked_call

result = self.endpoint(*a, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 959, in __call__

return self.method(*args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 509, in response_wrap

response = f(*args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/addons/bus/controllers/main.py", line 34, in poll

raise Exception("bus.Bus unavailable")

Exception: bus.Bus unavailable


This is the relevant part of my nginx:

upstream openerp-im {

server 127.0.0.1:8072 weight=1 fail_timeout=0;

}

# You may add here your # server { # ... # } # statements for each of your virtual hosts to this file ## # You should look at the following URL's in order to grasp a solid understanding # of Nginx configuration files in order to fully unleash the power of Nginx. # http://wiki.nginx.org/Pitfalls # http://wiki.nginx.org/QuickStart # http://wiki.nginx.org/Configuration # # Generally, you will want to move this file somewhere, and start with a clean # file but keep this around for reference. Or just disable in sites-enabled. # # Please see /usr/share/doc/nginx-doc/examples/ for ## Based on: http://www.schenkels.nl/2013/01/reverse-ssl-proxy-using-nginx-with-openerp-v7/ ## OpenERP backend ## upstream openerp { server 127.0.0.1:8069; } upstream openerp-im { server 127.0.0.1:8072 weight=1 fail_timeout=0; } ## https site## server { listen 443 default; server_name mydomain.com; root /usr/share/nginx/html; index index.html index.htm; client_max_body_size 0m; # log files access_log /var/log/nginx/openerp.access.log; error_log /var/log/nginx/openerp.error.log; # ssl files ssl on; ssl_certificate /etc/ssl/nginx/server.crt; ssl_certificate_key /etc/ssl/nginx/server.key; keepalive_timeout 60; # limit ciphers ssl_ciphers HIGH:!ADH:!MD5; ssl_protocols SSLv3 TLSv1; ssl_prefer_server_ciphers on; # proxy buffers proxy_buffers 16 64k; proxy_buffer_size 128k; ## default location ## location / { proxy_pass http://openerp; # force timeouts if the backend dies proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_redirect off; # set headers proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; } # cache some static data in memory for 60mins location ~* /web/static/ { proxy_cache_valid 200 60m; proxy_buffering on; expires 864000; proxy_pass http://openerp; } } ## http redirects to https ## server { listen 80; server_name mydomain.com; # Strict Transport Security add_header Strict-Transport-Security max-age=2592000; rewrite ^/.*$ https://$host$request_uri? permanent; }

SEAN CALLAHAN
on 4/28/16, 9:10 PM

see my answer update for the fix

Axel Mendoza
on 4/28/16, 11:26 PM

This didnt work for me: I also recieve this message from nginx *7139 connect() failed (111: Connection refused) while connecting to upstream, client:

SEAN CALLAHAN
on 5/3/16, 5:36 AM

for that you need to specify workers and longpolling_port in the odoo config file to get it working. normally 3 or more workers should work

Axel Mendoza
on 5/5/16, 5:20 PM

I have both longpolling (8072) and workers (4) already set

SEAN CALLAHAN
on 5/5/16, 10:52 PM
1
Axel Mendoza
On 4/28/16, 8:42 AM

You need to use the upstream openerp-im just to proxy the /longpolling/ urls and use another upstream to the / url. Put the same proxy headers in both locations in order to get it work. I read somewhere that 4 is the minimum number of workers to get it working but I don't see why in the code. If you still have issues with that just post your nginx config to get it fixed

Update based on your config:

upstream openerp {

server 127.0.0.1:8069;

}

upstream openerp-im {

server 127.0.0.1:8072 weight=1 fail_timeout=0;

}

server {

listen 443 default;

server_name mydomain.com;

root /usr/share/nginx/html;

index index.html index.htm;

client_max_body_size 0m;

# log files

access_log /var/log/nginx/openerp.access.log;

error_log /var/log/nginx/openerp.error.log;

# ssl files

ssl on;

ssl_certificate /etc/ssl/nginx/server.crt;

ssl_certificate_key /etc/ssl/nginx/server.key;

keepalive_timeout 60;

# limit ciphers

ssl_ciphers HIGH:!ADH:!MD5;

ssl_protocols SSLv3 TLSv1;

ssl_prefer_server_ciphers on;

# proxy buffers

proxy_buffers 16 64k;

proxy_buffer_size 128k;

## default location ##

location / {

proxy_pass http://openerp;

# force timeouts if the backend dies

proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;

proxy_redirect off;

# set headers

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto https;

}

location /longpolling/ {

proxy_pass http://openerp-im;

# force timeouts if the backend dies

proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;

proxy_redirect off;

# set headers

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto https;

}

# cache some static data in memory for 60mins

location ~* /web/static/ {

proxy_cache_valid 200 60m;

proxy_buffering on;

expires 864000;

proxy_pass http://openerp;

}

}

## http redirects to https ##

server {

listen 80;

server_name mydomain.com;

# Strict Transport Security

add_header Strict-Transport-Security max-age=2592000;

rewrite ^/.*$ https://$host$request_uri? permanent;

}

 See the added config in bold for the longpolling upstream


Works to me. Thanks!

Michell Stuttgart
on 9/19/17, 11:09 AM
0
SEAN CALLAHAN
On 4/28/16, 8:56 PM

Here is my nginx config


# You may add here your
# server {
# ...
# }
# statements for each of your virtual hosts to this file
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for
## Based on: http://www.schenkels.nl/2013/01/reverse-ssl-proxy-using-nginx-with-openerp-v7/
## OpenERP backend ##
upstream openerp {
server 127.0.0.1:8069;
}
upstream openerp-im {
server 127.0.0.1:8072 weight=1 fail_timeout=0;
}
## https site##
server {
listen 443 default;
server_name mydomain.com;
root /usr/share/nginx/html;
index index.html index.htm;
client_max_body_size 0m;
# log files
access_log /var/log/nginx/openerp.access.log;
error_log /var/log/nginx/openerp.error.log;
# ssl files
ssl on;
ssl_certificate /etc/ssl/nginx/server.crt;
ssl_certificate_key /etc/ssl/nginx/server.key;
keepalive_timeout 60;
# limit ciphers
ssl_ciphers HIGH:!ADH:!MD5;
ssl_protocols SSLv3 TLSv1;
ssl_prefer_server_ciphers on;
# proxy buffers
proxy_buffers 16 64k;
proxy_buffer_size 128k;
## default location ##
location / {
proxy_pass http://openerp;
# force timeouts if the backend dies
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
# set headers
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
# cache some static data in memory for 60mins
location ~* /web/static/ {
proxy_cache_valid 200 60m;
proxy_buffering on;
expires 864000;
proxy_pass http://openerp;
}
}
## http redirects to https ##
server {
listen 80;
server_name mydomain.com;
# Strict Transport Security
add_header Strict-Transport-Security max-age=2592000;
rewrite ^/.*$ https://$host$request_uri? permanent;
}

About This Community

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

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 4/28/16, 1:16 AM
Seen: 4535 times
Last updated: 4/28/16, 8:56 PM