Yenthe666 / InstallScript

Odoo install script
MIT License
1.25k stars 1.56k forks source link

Odoo17 on ubuntu 22.04 error #408

Open the-boxer opened 10 months ago

the-boxer commented 10 months ago

I have installed odoo17 community version using this script. Odoo seems to be working fine with "demo" data.. I only added a purchased app from the odoo app site called "odoo_import_image_url" which resulted in getting this error: UncaughtClientError > TypeError Uncaught Javascript Error > undefined is not an object (evaluating 'browser.navigator.clipboard.writeText') UncaughtClientError > TypeError Uncaught Javascript Error > undefined is not an object (evaluating 'browser.navigator.clipboard.writeText')

After restarting and trying to add a product url images odoo hangs for a while and shows this in the log file:

2024-01-24 14:50:13,613 607 ERROR tester odoo.http: Exception during request handling. Traceback (most recent call last): File "/odoo/odoo-server/addons/bus/websocket.py", line 836, in open_connection socket = request.httprequest.environ['socket'] KeyError: 'socket'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/odoo/odoo-server/odoo/http.py", line 2150, in call response = request._serve_db() File "/odoo/odoo-server/odoo/http.py", line 1722, in _serve_db return service_model.retrying(self._serve_ir_http, self.env) File "/odoo/odoo-server/odoo/service/model.py", line 133, in retrying result = func() File "/odoo/odoo-server/odoo/http.py", line 1749, in _serve_ir_http response = self.dispatcher.dispatch(rule.endpoint, args) File "/odoo/odoo-server/odoo/http.py", line 1866, in dispatch return self.request.registry['ir.http']._dispatch(endpoint) File "/odoo/odoo-server/addons/website/models/ir_http.py", line 235, in _dispatch response = super()._dispatch(endpoint) File "/odoo/odoo-server/odoo/addons/base/models/ir_http.py", line 222, in _dispatch result = endpoint(*request.params) File "/odoo/odoo-server/odoo/http.py", line 722, in route_wrapper result = endpoint(self, args, **params_ok) File "/odoo/odoo-server/addons/bus/controllers/websocket.py", line 18, in websocket return WebsocketConnectionHandler.open_connection(request) File "/odoo/odoo-server/addons/bus/websocket.py", line 848, in open_connection raise RuntimeError( RuntimeError: Couldn't bind the websocket. Is the connection opened on the evented port (8072)?

The supplier of the app file assures me that this is a odoo installation error and not an error in their app. I am not technical and have no way of solving this issue and need help.

cliffkujala commented 10 months ago

Are you running Odoo through NGINX Proxy, and have you tuned the config file so that it correctly uses Workers to enable gevent functions.

You can see more about this here https://www.odoo.com/documentation/17.0/administration/install/deploy.html#id8

czambrano1997 commented 7 months ago

@the-boxer i have the same issue, maybe do you have the solution to fix that?

czambrano1997 commented 7 months ago

Screenshot from 2024-05-01 11-42-22

cliffkujala commented 7 months ago

@czambrano1997 post your NGINX server block and your odoo-server.conf file contents here (make sure to remove any passwords or private address info.

czambrano1997 commented 7 months ago

Odoo.conf

[options] ; This is the password that allows database operations: admin_passwd = ** csv_internal_sep = , data_dir = /var/lib/odoo db_host = serverhost db_port = 5432 db_user = odoo db_password = odoo db_name = False addons_path = /mnt/oca-addons/.... http_port = 8069 logfile = /var/log/odoo/odoo.log list_db = True xmlrpc_port = 8069

xmlrpc_interface = 0.0.0.0

gevent_port = 8072

http_enable = True

proxy_mode = True workers = 4 limit_memory_soft = 2147483648 limit_memory_hard = 4294967296 limit_request = 8192 limit_time_cpu = 600 limit_time_real = 1200 max_cron_threads = 1

And my nginx file config

odoo server

upstream odoo { server 127.0.0.1:8066 weight=1 fail_timeout=300s; } upstream odoochat { server 127.0.0.1:8077 weight=1 fail_timeout=300s; } map $http_upgrade $connection_upgrade { default upgrade; '' close; }

http -> https

server { listen 80; server_name subdomain1.domain.com; rewrite ^(.*) https://$host$1 permanent; }

server { listen 443 ssl; server_name subdomain1.domain.com; proxy_read_timeout 720s; proxy_connect_timeout 720s; proxy_send_timeout 720s;

SSL parameters

ssl_certificate /etc/ssl/certificate.crt; ssl_certificate_key /etc/ssl/certificate.key; ssl_session_timeout 30m; ssl_protocols TLSv1.2; ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; ssl_prefer_server_ciphers off;

log

access_log /var/log/nginx/subdomain1.access.log; error_log /var/log/nginx/subdomain1.error.log;

Redirect requests to odoo backend server

location / {

proxy_redirect off;

proxy_set_header X-Real-IP  $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_pass http://odoo;

}

Redirect websocket requests to odoo gevent port

location /websocket { proxy_redirect off; proxy_pass http://odoochat; }

common gzip

gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript; gzip on; }

cliffkujala commented 7 months ago

Try without both of these in your odoo config

http_port = 8069
xmlrpc_port = 8069

I am using only http_port = 8069 and the rest of my stuff looks similar to yours.

czambrano1997 commented 7 months ago

I enable http_port = 8069

But the is same result => RuntimeError: Couldn't bind the websocket. Is the connection opened on the evented port (8072)?

Maybe the problem is located about i have configure 2 odoo instances with docker. The first intance (odoo v15) configure has enable proxy_mode = True and don't have any error But the second intances (odoo v17) is which has the problem about websocket

cliffkujala commented 7 months ago

Do you have the two instances on docker listening to the same outside ports. If one has already claimed 8072>8072 then you have to build the other docker container to listen to different outside ports, IE

8169>8069 for http 8172>8072 for gevent

czambrano1997 commented 7 months ago

No, both containers have distinc bind ports Odoo 1 (v15) => 8069:8069 8072:8072 - nginx file has /longpolling Odoo 2 (v17) => 8066:8069 8077:8072 - nginx file has /websocket

the-boxer commented 7 months ago

As far as I know the issue was never solved. At the time I found a website with information to install odoo 17 on Debian. This worked straight off the bat. Recently I found several install tutorials for Ubuntu 22 and even 24 that work without any problems.

Good luck Regards Boxer

From: czambrano1997 @.> Date: Wednesday, 1 May 2024 at 18:33 To: Yenthe666/InstallScript @.> Cc: the boxer @.>, Mention @.> Subject: Re: [Yenthe666/InstallScript] Odoo17 on ubuntu 22.04 error (Issue #408)

@the-boxerhttps://github.com/the-boxer i have the same issue, maybe do you have the solution to fix that?

— Reply to this email directly, view it on GitHubhttps://github.com/Yenthe666/InstallScript/issues/408#issuecomment-2088733000, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIQC43YATYLMMJMO67W6XF3ZAEKMJAVCNFSM6AAAAABCI5DQF2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBYG4ZTGMBQGA. You are receiving this because you were mentioned.Message ID: @.***>

AlexanderIgorovych commented 6 months ago

In my case problem with web socket appeared in next case: 1) I have removed the module (in a hard way). I just remove the folder with source code, and than restart the Odoo17. Module was still present in Odoo17. 2) I have added next settings. limit_memory_hard = 20132659200 limit_memory_soft = 1677721600 limit_request = 8192 limit_time_cpu = 3600 limt_time_real = 7200 limit_time_real_cron = -1 max_cron_threads = 1 workers = 25

to fix this warning: Skipping database because of modules to install/upgrade/remove,

as a result I have seen the web socket problem.

Solution was: 1) Remove the settings, maybe I can keep some of them, but It is not the case for me, I have removed everyting. limit_memory_hard = 20132659200 limit_memory_soft = 1677721600 limit_request = 8192 limit_time_cpu = 3600 limt_time_real = 7200 limit_time_real_cron = -1 max_cron_threads = 1 workers = 25

2) and I have removed broken module from Odoo: Changed view to list , select the module, choose the Actions and hit delete. After that I don't see problem with websocket.

But I am doing it on my MacBook, not on Linux.

IgorSantRocha commented 6 months ago

Aqui o erro também estava dando por causa das configurações de:

limit_memory_hard = 20132659200 limit_memory_soft = 1677721600 limit_request = 8192 limit_time_cpu = 3600 limt_time_real = 7200 limit_time_real_cron = -1 max_cron_threads = 1 workers = 25

Resetei elas e voltou a funcionar

ale900522 commented 2 months ago

As far as I know the issue was never solved. At the time I found a website with information to install odoo 17 on Debian. This worked straight off the bat. Recently I found several install tutorials for Ubuntu 22 and even 24 that work without any problems. Good luck Regards Boxer From: czambrano1997 @.> Date: Wednesday, 1 May 2024 at 18:33 To: Yenthe666/InstallScript @.> Cc: the boxer @.>, Mention @.> Subject: Re: [Yenthe666/InstallScript] Odoo17 on ubuntu 22.04 error (Issue #408) @the-boxerhttps://github.com/the-boxer i have the same issue, maybe do you have the solution to fix that? — Reply to this email directly, view it on GitHub<#408 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIQC43YATYLMMJMO67W6XF3ZAEKMJAVCNFSM6AAAAABCI5DQF2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBYG4ZTGMBQGA. You are receiving this because you were mentioned.Message ID: @.***>

I have the solution for docker-compose, docker swarm, if you want this I can send you, but I have the issue now on kubernetes.

czambrano1997 commented 2 months ago

hi @ale900522, of course pls can you send me to my email or post the docker-compose to fix that problem?

ale900522 commented 2 months ago

With this compose and odoo.con worker>0 and enable gevent_port=8072 comment longpolling_port. version: "3.9" services: odoo: image: ${IMAGE_APP}:${IMAGE_TAG} networks:

volumes: data: external: true conf: external: true addons: external: true

networks: traefik-swarm: external: true databases-swarm: external: true

El vie, 4 oct 2024 a las 16:58, czambrano1997 @.***>) escribió:

hi @ale900522 https://github.com/ale900522, of course pls can you send me to my email or post the docker-compose to fix that problem?

— Reply to this email directly, view it on GitHub https://github.com/Yenthe666/InstallScript/issues/408#issuecomment-2393904250, or unsubscribe https://github.com/notifications/unsubscribe-auth/APTCHNXKDDBYSVIAOUNMCUTZZ2UIHAVCNFSM6AAAAABCI5DQF2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJTHEYDIMRVGA . You are receiving this because you were mentioned.Message ID: @.***>

nihal-infiniarc commented 1 month ago

Hi I am facing the same issue. Previously i was using odoo15 with complete worker configuration. But now i migrated the V15 to V17 on same server. I have stopped the odoo15 service as well. Also I checked the 8072 port (which is listening to python3.10 (for odoo17)).

But still getting the same error.

socket = request.httprequest._HTTPRequest__environ['socket'] KeyError: 'socket'

RuntimeError: Couldn't bind the websocket. Is the connection opened on the evented port (8072)?

Any solution?

ale900522 commented 1 month ago

Yes Of course I have the solution for docker-swarm with docker-compose and kibernetes with ingressroute all solution is using traefik.

El El mié, 23 oct 2024 a las 9:35, nihal-infiniarc @.***> escribió:

Hi I am facing the same issue. Previously i was using odoo15 with complete worker configuration. But now i migrated the V15 to V17 on same server. I have stopped the odoo15 service as well. Also I checked the 8072 port (which is listening to python3.10 (for odoo17)).

But still getting the same error.

socket = request.httprequest._HTTPRequest__environ['socket'] KeyError: 'socket'

RuntimeError: Couldn't bind the websocket. Is the connection opened on the evented port (8072)?

Any solution?

— Reply to this email directly, view it on GitHub https://github.com/Yenthe666/InstallScript/issues/408#issuecomment-2431153435, or unsubscribe https://github.com/notifications/unsubscribe-auth/APTCHNRUQJRQWKYHKY2VVR3Z45GSVAVCNFSM6AAAAABCI5DQF2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZRGE2TGNBTGU . You are receiving this because you were mentioned.Message ID: @.***>

ngocnv1712 commented 1 month ago

anyone have solution?

ale900522 commented 1 month ago

anyone have solution? using docker-swarm with this compose are solution:


version: "3.9"
services:
odoo:
image: ${IMAGE_APP}:${IMAGE_TAG}
networks:
- traefik-swarm
- databases-swarm
volumes:
- data:/var/lib/odoo
- conf:/etc/odoo
- addons:/mnt/extra-addons
deploy:
labels:
# # global config       
- "traefik.enable=true"
- "traefik.docker.network=traefik-swarm"
# # main routers 8069 web rule "/*"
- "traefik.http.routers.odoo.tls=true"
- "traefik.http.routers.odoo.entrypoints=https"
- "traefik.http.routers.odoo.tls.certresolver=myresolver"
- "traefik.http.routers.odoo.rule=Host(`${URL_DEPLOY}`)"               ## || Host(`${URL_SUBDOMAIN_DEPLOY}`)"
- "traefik.http.routers.odoo.service=odoo@docker"
- "traefik.http.routers.odoo.middlewares=gzip"
- "traefik.http.services.odoo.loadbalancer.server.port=8069"
# # main routers 8072 websocket rule "/websocket"
- "traefik.http.routers.backend-websock.tls=true"
- "traefik.http.routers.backend-websock.entrypoints=https"
- "traefik.http.routers.backend-websock.tls.certresolver=myresolver"
- "traefik.http.routers.backend-websock.rule=Path(`/websocket`) && Host(`${URL_DEPLOY}`)"
- "traefik.http.routers.backend-websock.middlewares=upgradeheader,sslheader,gzip"
- "traefik.http.routers.backend-websock.service=backend-websock@docker"
- "traefik.http.services.backend-websock.loadbalancer.server.port=8072"
#middleware database restrict study and fix#
# - "traefik.http.routers.databases-access.tls=true"
# - "traefik.http.routers.databases-access.entrypoints=https"
# - "traefik.http.routers.databases-access.tls.certresolver=myresolver"
# - "traefik.http.routers.databases-access.rule=Path(`/web/database`) && Host(`${URL_DEPLOY}`)"
# - "traefik.http.routers.databases-access.service=databases-access@docker"
# - "traefik.http.routers.databases-access.middlewares=gzip"
# - "traefik.http.services.databases-access.loadbalancer.server.port=8069"
# - "traefik.http.middlewares.allow_only.ipallowlist.sourceRange=5.5.5.5/32"
# - "traefik.http.routers.databases-access.middlewares=allow_only"
#middleware database restrict#
# # upgrade headers 
- "traefik.http.middlewares.upgradeheader.headers.customRequestHeaders.Upgrade=websocket"
- "traefik.http.middlewares.upgradeheader.headers.customRequestHeaders.Connection=upgrade"
- "traefik.http.middlewares.upgradeheader.headers.hostsproxyheaders=websocket,Upgrade"
- "traefik.http.middlewares.upgradeheader.headers.forcestsheader=true"
- "traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https"
# # gzip compress
- "traefik.http.middlewares.gzip.compress=true"
placement:
constraints: [node.role == worker]

volumes: data: external: true conf: external: true addons: external: true

networks: traefik-swarm: external: true databases-swarm: external: true


Remember in odoo.conf: gevent_port:8072 longpulling: disable http_port: 8069  I use this compose for my deployment in docker-swarm cluster and solve websocket error connection. 
ngocnv1712 commented 1 month ago

I'm using kubernetes deploy and istio for gateway but when have request /websocket?version=17.0-1 HTTP/1.1, throw error: RuntimeError: Couldn't bind the websocket. Is the connection opened on the evented port (8072)?

ale900522 commented 1 month ago

I'm using kubernetes deploy and istio for gateway but when have request /websocket?version=17.0-1 HTTP/1.1, throw error: RuntimeError: Couldn't bind the websocket. Is the connection opened on the evented port (8072)?

Ohh my friend for kubernetes the solution its different but the logic is same. I use traefikCRD like ingresscontroller and you need create ingressroute with this configuration, if you use only traefik for kubernetes with ingress class only adapt the ingressroute for ingress: I create two ingressroute one for https and one for websocket I send my solutions:

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  annotations:
    meta.helm.sh/release-name: demo-example
    meta.helm.sh/release-namespace: demo-example
  generation: 3
  labels:
    app.kubernetes.io/managed-by: Helm
    helm.toolkit.fluxcd.io/name: demo-example
    helm.toolkit.fluxcd.io/namespace: demo-example
  name: demo-example-https
  namespace: infra-example
spec:
  entryPoints:
  - websecure
  routes:
  - kind: Rule
    match: Host(`demo.example.com`)
    middlewares:
    - name: gzip-compress
    services:
    - name: demo-example-service
      namespace: demo-example
      port: 8069
  tls:
    certResolver: myresolver
    options:
      name: api-supertls
      namespace: infra-example
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  annotations:
    meta.helm.sh/release-name: demo-example
    meta.helm.sh/release-namespace: demo-example
  generation: 1
  labels:
    app.kubernetes.io/managed-by: Helm
    helm.toolkit.fluxcd.io/name: demo-example
    helm.toolkit.fluxcd.io/namespace: demo-example
  name: demo-example-websocket
  namespace: infra-example
spec:
  entryPoints:
  - websecure
  routes:
  - kind: Rule
    match: Host(`demo.example.com`) && Path(`/websocket`)
    middlewares:
    - name: upgradeheader
    - name: gzip-compress
    - name: sslheader
    services:
    - name: demo-example-websocket
      namespace: demo-example
      port: 8069
  tls:
    certResolver: myresolver
    options:
      name: api-supertls
      namespace: infra-example

and you need create middleware:

apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  generation: 1
  labels:
    kustomize.toolkit.fluxcd.io/name: kscommonapp
    kustomize.toolkit.fluxcd.io/namespace: flux-system
  name: sslheader
  namespace: infra-example
spec:
  headers:
    customRequestHeaders:
      X-Forwarded-Proto: https
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  generation: 1
  labels:
    kustomize.toolkit.fluxcd.io/name: kscommonapp
    kustomize.toolkit.fluxcd.io/namespace: flux-system
  name: upgradeheader
  namespace: infra-example
spec:
  headers:
    customRequestHeaders:
      Connection: upgrade
      Upgrade: websocket
    forceSTSHeader: true
    hostsProxyHeaders:
    - websocket
    - Upgrade
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  generation: 1
  labels:
    kustomize.toolkit.fluxcd.io/name: kscommonapp
    kustomize.toolkit.fluxcd.io/namespace: flux-system
  name: gzip-compress
  namespace: infra-example
spec:
  compress: {}
ngocnv1712 commented 1 month ago

` apiVersion: networking.istio.io/v1alpha3 kind: Gateway metadata: name: dth-crm-fe-gateway namespace: topsim spec: selector: istio: ingressgateway servers:


apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: dth-crm-fe-virtualservice spec: hosts:

` my gateway content, but not work

ale900522 commented 1 month ago

` apiVersion: networking.istio.io/v1alpha3 kind: Gateway metadata: name: dth-crm-fe-gateway namespace: topsim spec: selector: istio: ingressgateway servers:

* port:
  number: 80
  name: http
  protocol: HTTP2
  hosts:

  * crm.test.com
    tls:
    httpsRedirect: true

* port:
  number: 443
  name: https
  protocol: HTTPS
  hosts:

  * crm.test.com
    tls:
    mode: SIMPLE
    credentialName: dth-crm-fe-cert-secret  # Use the certificate secret created by Cert-Manager
    minProtocolVersion: TLSV1_2
    maxProtocolVersion: TLSV1_3
    cipherSuites:

    * "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"
    * "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"
    * "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"
    * "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"

* port:
  number: 8072
  name: websocket
  protocol: TCP
  hosts:

  * crm.test.com

apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: dth-crm-fe-virtualservice spec: hosts:

* crm.test.com
  gateways:

* dth-crm-fe-gateway
  http:

* match:

  * uri:
    prefix: /
    route:

    * destination:
      host: dth-crm-fe-svc.topsim.svc.cluster.local
      port:
      number: 8069

* match:

  * uri:
    prefix: /websocket
    headers:
    Upgrade:
    exact: websocket
    route:

    * destination:
      host: dth-crm-fe-svc.topsim.svc.cluster.local
      port:
      number: 8072
      timeout: 600s
      tcp:

* match:

  * port: 8072
    route:
  * destination:
    host: dth-crm-fe-svc.topsim.svc.cluster.local
    port:
    number: 8072

` my gateway content, but not work

Look odoo services not resolve websocket from internet odoo resolve this port internal, then your main endpoint always is port 8069 and target port for http://example.com/websocket is 8072 but your main endpoint is 8069 odoo internal do the redirection job.