bitnami / vms

Bitnami VMs
https://bitnami.com
Other
200 stars 44 forks source link

[bitnami/odoo] Odoo 17 Bitnami-GCP Discus Not Realtime Error #1357

Open Cristianfllc3 opened 5 months ago

Cristianfllc3 commented 5 months ago

Name and Version

bitname/odoo17

What architecture are you using?

None

What steps will reproduce the bug?

I installed the latest version of odoo bitnami in GCP (17), after the base configurations, the internal chat communication is not updated in real time, you have to refresh the page for the messages to load.

What is the expected behavior?

That communication in the disk module is carried out in real time and does not have to refresh the browser to see the messages.

What do you see instead?

I get the browser notification but the message is not displayed in the discuss module.

Additional information

I have invented several parameter settings in odoo.config and bitnami.confg but I still get the same error.

javsalgar commented 5 months ago

Hi!

Could you confirm that you are using the Bitnami Odoo Helm chart or a Bitnami Odoo Cloud Image?

Cristianfllc3 commented 5 months ago

Hi, Im using Bitnami odoo cloud image ! thanks

carrodher commented 5 months ago

Support for VMs/Cloud Images is provided at https://github.com/bitnami/vms. We'll transfer this issue there so the proper team can check it

Cristianfllc3 commented 5 months ago

I execute ( sudo /opt/bitnami/bndiagnostic-tool ) Thanks

Press [Enter] to continue: The diagnostic bundle was uploaded successfully to the Bitnami servers. Please copy the following code:

f7b6093e-c371-50fd-e1a8-3195bb89d55b

And paste it in your Bitnami Support ticket.

gongomgra commented 5 months ago

Hi @Cristianfllc3,

Thanks for using Bitnami. All I can see in the bndiagnostic bundle is that your virtual machine is running out of free memory, which can affect the real time service you mentioned.

Your instance has little available RAM memory.

               total        used        free      shared  buff/cache   available
Mem:             975         737          74          27         164          72
Swap:            634         258         376

Can you try to increase the memory available as explained in the next guide?

https://docs.bitnami.com/virtual-machine/faq/administration/increase-memory/

Cristianfllc3 commented 5 months ago

Thanks for the support, I increased the RAM to 4GB and I still have the scenario where there is no real-time communication. I see that in the tool report it comments on two possible errors in Apache and connectivity.

Thank you very much in advance.

===== Begin of bndiagnostic tool output ===== ✓ Processes: No issues found ? Apache: Found possible issues ? Connectivity: Found possible issues ✓ Resources: No issues found

[Apache] Found recent error or warning messages in the Apache error log.

[Tue Jan 16 02:55:56.340555 2024] [proxy_http:error] [pid 248791:tid 
140301742106368] [client **ip_address**:59702] AH01114: HTTP: failed to make 
connection to backend: 127.0.0.1
 [Tue Jan 16 02:55:57.500701 2024] [proxy:error] [pid 248792:tid 
140301674964736] (111)Connection refused: AH00957: http: attempt to connect to 
**ip_address**:8069 (127.0.0.1:8069) failed
 [Tue Jan 16 02:55:57.500748 2024] [proxy_http:error] [pid 248792:tid 
140301674964736] [client **ip_address**:51750] AH01114: HTTP: failed to make 
Press [Enter] to continue:
connection to backend: 127.0.0.1

Please check the following guide to troubleshoot server issues: https://docs.bitnami.com/general/apps/wordpress/troubleshooting/debug-erro rs-apache/ [Connectivity] Server ports 22, 80 and/or 443 are not publicly accessible. Please check the following guide to open server ports for remote access: https://docs.bitnami.com/general/faq/administration/use-firewall/ ===== End of bndiagnostic tool output =====

Press [Enter] to continue: The diagnostic bundle was uploaded successfully to the Bitnami servers. Please copy the following code:

cf0b72fb-f2c9-8f7a-b074-79a53d3dac39

And paste it in your Bitnami Support ticket. #################################################### tail -n 20 /opt/bitnami/apache/logs/error_log [Tue Jan 16 02:32:50.208025 2024] [proxy:error] [pid 247252:tid 139991144380160] (111)Connection refused: AH00957: http: attempt to connect to 127.0.0.1:8069 (127.0.0.1:8069) failed [Tue Jan 16 02:32:50.208101 2024] [proxy_http:error] [pid 247252:tid 139991144380160] [client 142.182.4.80:65249] AH01114: HTTP: failed to make connection to backend: 127.0.0.1 [Tue Jan 16 02:51:24.071635 2024] [mpm_event:notice] [pid 247248:tid 139991735553024] AH00491: caught SIGTERM, shutting down [Tue Jan 16 02:51:30.789682 2024] [mpm_event:notice] [pid 248060:tid 140403425983488] AH00489: Apache/2.4.58 (Unix) OpenSSL/1.1.1w mod_wsgi/4.9.4 Python/3.11 configured -- resuming normal operations [Tue Jan 16 02:51:30.789875 2024] [core:notice] [pid 248060:tid 140403425983488] AH00094: Command line: '/opt/bitnami/apache/bin/httpd -f /opt/bitnami/apache/conf/httpd.conf' [Tue Jan 16 02:55:37.466098 2024] [mpm_event:notice] [pid 248060:tid 140403425983488] AH00491: caught SIGTERM, shutting down [Tue Jan 16 02:55:44.482145 2024] [mpm_event:notice] [pid 248788:tid 140302424968192] AH00489: Apache/2.4.58 (Unix) OpenSSL/1.1.1w mod_wsgi/4.9.4 Python/3.11 configured -- resuming normal operations [Tue Jan 16 02:55:44.482380 2024] [core:notice] [pid 248788:tid 140302424968192] AH00094: Command line: '/opt/bitnami/apache/bin/httpd -f /opt/bitnami/apache/conf/httpd.conf' [Tue Jan 16 02:55:45.092769 2024] [proxy:error] [pid 248792:tid 140301691750144] (111)Connection refused: AH00957: http: attempt to connect to 127.0.0.1:8069 (127.0.0.1:8069) failed [Tue Jan 16 02:55:45.092836 2024] [proxy_http:error] [pid 248792:tid 140301691750144] [client 142.182.4.80:51726] AH01114: HTTP: failed to make connection to backend: 127.0.0.1 [Tue Jan 16 02:55:56.340482 2024] [proxy:error] [pid 248791:tid 140301742106368] (111)Connection refused: AH00957: http: attempt to connect to 127.0.0.1:8069 (127.0.0.1:8069) failed [Tue Jan 16 02:55:56.340555 2024] [proxy_http:error] [pid 248791:tid 140301742106368] [client 128.199.137.235:59702] AH01114: HTTP: failed to make connection to backend: 127.0.0.1 [Tue Jan 16 02:55:57.500701 2024] [proxy:error] [pid 248792:tid 140301674964736] (111)Connection refused: AH00957: http: attempt to connect to 127.0.0.1:8069 (127.0.0.1:8069) failed [Tue Jan 16 02:55:57.500748 2024] [proxy_http:error] [pid 248792:tid 140301674964736] [client 142.182.4.80:51750] AH01114: HTTP: failed to make connection to backend: 127.0.0.1 [Tue Jan 16 02:56:59.805075 2024] [mpm_event:notice] [pid 248788:tid 140302424968192] AH00491: caught SIGTERM, shutting down [Tue Jan 16 02:57:04.617701 2024] [mpm_event:notice] [pid 249473:tid 140677528116224] AH00489: Apache/2.4.58 (Unix) OpenSSL/1.1.1w mod_wsgi/4.9.4 Python/3.11 configured -- resuming normal operations [Tue Jan 16 02:57:04.617930 2024] [core:notice] [pid 249473:tid 140677528116224] AH00094: Command line: '/opt/bitnami/apache/bin/httpd -f /opt/bitnami/apache/conf/httpd.conf' [Tue Jan 16 17:09:21.322199 2024] [mpm_event:notice] [pid 249473:tid 140677528116224] AH00491: caught SIGTERM, shutting down [Tue Jan 16 17:15:05.248153 2024] [mpm_event:notice] [pid 814:tid 139765320727552] AH00489: Apache/2.4.58 (Unix) OpenSSL/1.1.1w mod_wsgi/4.9.4 Python/3.11 configured -- resuming normal operations [Tue Jan 16 17:15:05.250403 2024] [core:notice] [pid 814:tid 139765320727552] AH00094: Command line: '/opt/bitnami/apache/bin/httpd -f /opt/bitnami/apache/conf/httpd.conf'

tail -n 20 /opt/bitnami/odoo/log/odoo-server.log 2024-01-16 17:42:56,896 1806 INFO bitnami_odoo werkzeug: 127.0.0.1 - - [16/Jan/2024 17:42:56] "GET /websocket HTTP/1.1" 400 - 1 0.000 0.002 2024-01-16 17:43:11,143 1808 INFO bitnami_odoo werkzeug: 127.0.0.1 - - [16/Jan/2024 17:43:11] "GET /websocket HTTP/1.1" 400 - 1 0.000 0.003 2024-01-16 17:43:14,614 1806 INFO bitnami_odoo werkzeug: 127.0.0.1 - - [16/Jan/2024 17:43:14] "GET /websocket HTTP/1.1" 400 - 1 0.000 0.002 2024-01-16 17:43:29,152 1811 INFO bitnami_odoo odoo.addons.base.models.ir_cron: Starting job Mail: Fetchmail Service. 2024-01-16 17:43:29,157 1811 INFO bitnami_odoo odoo.addons.mail.models.fetchmail: start checking for new emails on imap server smtp gmail 2024-01-16 17:43:30,291 1811 INFO bitnami_odoo odoo.addons.mail.models.fetchmail: Fetched 0 email(s) on imap server smtp gmail; 0 succeeded, 0 failed. 2024-01-16 17:43:30,519 1811 INFO bitnami_odoo odoo.addons.base.models.ir_cron: Job Mail: Fetchmail Service done. 2024-01-16 17:43:30,526 1811 INFO bitnami_odoo odoo.addons.base.models.ir_cron: Starting job Mail: Email Queue Manager. 2024-01-16 17:43:30,531 1811 INFO bitnami_odoo odoo.addons.base.models.ir_cron: Job Mail: Email Queue Manager done. 2024-01-16 17:43:35,880 1805 INFO bitnami_odoo werkzeug: 127.0.0.1 - - [16/Jan/2024 17:43:35] "GET /websocket HTTP/1.1" 400 - 1 0.000 0.002 2024-01-16 17:43:44,043 1808 INFO bitnami_odoo werkzeug: 127.0.0.1 - - [16/Jan/2024 17:43:44] "GET /websocket HTTP/1.1" 400 - 1 0.000 0.003 2024-01-16 17:43:57,182 1808 INFO bitnami_odoo werkzeug: 127.0.0.1 - - [16/Jan/2024 17:43:57] "GET /websocket HTTP/1.1" 400 - 1 0.000 0.003 2024-01-16 17:44:11,409 1806 INFO bitnami_odoo werkzeug: 127.0.0.1 - - [16/Jan/2024 17:44:11] "GET /websocket HTTP/1.1" 400 - 1 0.000 0.002 2024-01-16 17:44:15,251 1806 INFO bitnami_odoo werkzeug: 127.0.0.1 - - [16/Jan/2024 17:44:15] "GET /websocket HTTP/1.1" 400 - 1 0.000 0.002 2024-01-16 17:44:31,637 1811 INFO bitnami_odoo odoo.addons.base.models.ir_cron: Starting job Mail: Fetchmail Service. 2024-01-16 17:44:31,642 1811 INFO bitnami_odoo odoo.addons.mail.models.fetchmail: start checking for new emails on imap server smtp gmail 2024-01-16 17:44:32,705 1811 INFO bitnami_odoo odoo.addons.mail.models.fetchmail: Fetched 0 email(s) on imap server smtp gmail; 0 succeeded, 0 failed. 2024-01-16 17:44:32,918 1811 INFO bitnami_odoo odoo.addons.base.models.ir_cron: Job Mail: Fetchmail Service done. 2024-01-16 17:44:32,928 1811 INFO bitnami_odoo odoo.addons.base.models.ir_cron: Starting job Mail: Email Queue Manager. 2024-01-16 17:44:32,933 1811 INFO bitnami_odoo odoo.addons.base.models.ir_cron: Job Mail: Email Queue Manager done.

gongomgra commented 5 months ago

Hi @Cristianfllc3,

According to the latest bndiagnostic tool I'd say all services are running fine on your machine, but the bndiagnostic tool doesn't get any info from Odoo's logs nor config file. Can you check them?

Apart from the above, it seems to me this issue is more related to Odoo itself (to its config file probably) than to our installation, so I think it is a good idea to open a new question in the official support forums.

Cristianfllc3 commented 5 months ago

Hi,

In the previous message I attached the parts of the Odoo and Apache logs!, I also added several questions? I will add them again here in case they can be read better.

I don't think I should open another incident, it would be ideal to save the log history for reference, can you ask how to proceed !!, I would be grateful.

Cristianfllc3 commented 5 months ago

Hi,

Is there any response to this incident?

Thanks in advance

gongomgra commented 5 months ago

Hi @Cristianfllc3,

Sorry for the delay. There seems to be an issue in Odoo 17 itself with this realtime feature as mentioned in the following thread from the official forums. We recommend you to get more information on how to configure Odoo from there, as they are the experts in using the application. We would be glad to help you configure the required settings on the Bitnami machine if you have any questions.

https://www.odoo.com/forum/help-1/no-real-time-update-in-discuss-241137

Regarding your other questions, find my comments inline

Shouldn't these two errors be adjusted in the Odoo-bitnami image?

I suppose your question is related to these messages from Apache trying to connect with Odoo. Is that correct? If so, you don't have to worry, it is normal to get them while the Odoo app is starting and your web server is getting requests.

[Tue Jan 16 02:55:45.092769 2024] [proxy:error] [pid 248792:tid 140301691750144] (111)Connection refused: AH00957: http: attempt to connect to 127.0.0.1:8069 (127.0.0.1:8069) failed
[Tue Jan 16 02:55:45.092836 2024] [proxy_http:error] [pid 248792:tid 140301691750144] [client 142.182.4.80:51726] AH01114: HTTP: failed to make connection to backend: 127.0.0.1
[Tue Jan 16 02:55:56.340482 2024] [proxy:error] [pid 248791:tid 140301742106368] (111)Connection refused: AH00957: http: attempt to connect to 127.0.0.1:8069 (127.0.0.1:8069) failed

In my current case, I present the errors that could be solved, what would be the ideal configurations for the .conf files odoo- http-vhost.conf? bitnami-ssl.conf? or others?

I don't fully understand this question. Can you elaborate?

Cristianfllc3 commented 5 months ago

Hi, Thanks for the reply. I add 3 points.

1 - Before writing the incident, I have verified a few threads from forums and Odoo communities about the irregularity of communication in real time, and most remain at a conceptual level in the solution, like the one you refer to me and in another case the majority proposes a solution for ngixn and not in Apache.

2 - About my question > "In my current case, I present the errors that could be solved, what would be the ideal configurations for the .conf files odoo-http-vhost.conf? bitnami-ssl.conf? or others?"

It is related to the same solution proposal thread that is discussed in the link you sent me > https://www.odoo.com/forum/help-1/no-real-time-update-in-discuss-241137 "For Real-time Chat: Check if your server settings allow instant updates. It might be a setup issue with how your server communicates with Odoo."

I have verified several files and several configuration parameters without a solution.

Verified configuration files: odoo.conf tail -n 30 /opt/bitnami/apache/logs/error_log tail -n 30 /opt/bitnami/odoo/log/odoo-server.log /opt/bitnami/apache/conf/http.conf /opt/bitnami/apache/conf/bitnami/bitnami.conf .... bitnami-ssl.conf "/opt/bitnami/apache/conf/vhosts/*.conf" odoo-https-vhost.conf

3 - My premise, if I install a bitnami odoo image in GCP, all its modules should work since you are the one who configures that image, right?

And given my case that I already have installed when I see that it does not work, I should find instructions on their support page for scenarios that involve extra configuration.

I would be grateful if you could guide me on how to proceed, in case you can help define the correct configuration for the proper functioning of odoo's real-time communication.

THanks in advance

Cristianfllc3 commented 5 months ago

I add 2 points

I attach some of the solutions that I have been collecting in the forum threads, several comment that these configurations should be added to nginx and there is no detailed reference on how to adjust it to Apache, and I repeat in the case of the Bitnami configuration it is particular.

1 - They do not detail in which configuration file and in which these parameters should be adjusted.

# Comment to disable proxy

ProxyRequests Off ProxyPreserveHost On

ProxyPass / http://127.0.0.1:8069/ retry=0 ProxyPassReverse / http://127.0.0.1:8069/ retry=0

ProxyPass /longpolling/ http://localhost:8072/longpolling/ retry=0 ProxyPassReverse /longpolling/ http://localhost:8072/longpolling/ retry=0

ProxyPass /longpolling/poll/ wss://127.0.0.1:8072/longpolling/poll/ ProxyPassReverse /longpolling/poll/ wss://127.0.0.1:8072/longpolling/poll/

<Location /longpolling/poll/> ProxyPass "wss://127.0.0.1:8072/longpolling/poll/" ProxyPassReverse "wss://127.0.0.1:8072/longpolling/poll/"

Add these lines for WebSocket ProxyPass /websocket/ wss://127.0.0.1:8072/ ProxyPassReverse /websocket/ wss://127.0.0.1:8072/

2 - Verificando los workers y conection WebSocket
"chrome://inspect/#workers" adciionando este codico al navegador, ejecutando el odoo, se muestra
image

image

Cristianfllc3 commented 5 months ago

Hi,

Is there any response to this incident?

Thanks in advance

gongomgra commented 5 months ago

Hi @Cristianfllc3,

Thanks for your message. I understand you should add the mentioned config in both Odoo files under the vhosts/ folder. Remember to restart Apache for changes to take effect. We configure our applications with the default settings suggested by upstream projects. For customizations and other question related to the app itself, we recommend to ask in the official forums.

Cristianfllc3 commented 5 months ago

Thank you for the message,

If a module, in this case the communication module, does not work, it allows real-time communication, I assume that bitnami should propose a solution, right? I understand the added value of bitnami, since it has several shortcuts at other points.

In this case, what bitnami can do to find a solution to:

"When installing an instance of odoo-bitnami the communication module MUST be able to communicate in real time."

In the forums there are many messages that are not oriented to the bitnami architecture (GCP-Odoo-Apache) and I trust that you have the ability to provide a solution.

Thanks in advance,

gongomgra commented 5 months ago

Hi @Cristianfllc3,

We provide thirdparty applications in ready-to-use formats, but we configure those applications as per the official upstream recommendations. You can find the full Odoo application data under the /opt/bitnami/odoo folder, and the Apache configuration for it under /opt/bitnami/apache2/conf (isolated from other apps you may have on your system).

Regarding your issue, and according to official forums mentioned in previous messages, there seems to be a bug or a misconfiguration in the Odoo application itself not related to our installation. Because of that, you will have to check the official forums for help on how to solve that issue and apply the required changes in your server. All we can do here is to help you update the Apache or Odoo configuration in case you have any questions, but we can't provide you with the required changes for the fix because we don't have enough knowledge on how Odoo works internally (that's why we recommend you to ask the official developers, as they are the experts here).

Sorry for the inconveniences you are facing. I really hope you can find a fix for those issues.

Cristianfllc3 commented 5 months ago

Hi @gongomgra

Thanks for all the detailed explanation.

I understand that you are not experts in every tool you support. The Odoo error of lack of real-time communication is discussed in several forums, videos, etc., as I have mentioned in other messages as well, I have tried several solutions myself.

What I do not agree with is that it says that it is a particular bad configuration, if I am using by DEFAULT the image that BITNAMI created or is it that this error comes by default! I incorporate the incident that you can verify providing a better service/product, because you provide tools that facilitate technical support.

It may be that I misunderstand Bitnami's service/support, 1 - In the event that I use a tool that you provide and it has a bug since the installation, what should the client do in this case? 2 – Bitnami offers WYSWYG service.

More than an incident, it is a process issue. Is it that in the image they should clarify that in version 17 the communication module does not work correctly?, and thus the client, me in this case, is prepared and knows that he is going to use Odoo with that irregularity.

I hope it is not seen as a negative debate, I repeat, I like Bitnami's tools, which surprises me that something does not work correctly by default without prior notice.

I imagine they can close the incident if there is no proposed solution to have an image that does not have that Odoo bug.

Thanks for the support!

gongomgra commented 4 months ago

Hi @Cristianfllc3,

Thanks for your message. As mentioned previously, we offer upstream applications configured with the official instructions and recommendations from its developers without further modifications.

In case there is an issue in an upstream application or a plugin, we can only wait for them to publish a new version solving the problem by default, and/or wait for them to provide end users with instructions on how to remediate it in their currently published versions. However, it looks like the application has an issue not related to Bitnami, but no official instructions on how to fix it are provided from upstream project yet, so I'm afraid there's nothing we can do here at this moment. We recommend you to keep asking for help in the official forums.

Sorry for the inconveniences.

Cristianfllc3 commented 4 months ago

Hello @gongomgra ,

I ended up installing a version of odoo17 with the Nginx server and after several configurations, the messaging system works real time.

There is some hope!, that given the Nginx parameters, Bitnami can make the adaptations (AS YOU MAKE IT FROM NGINX TO APACHE IN YOUR IMAGE) and identify where its need to adjust these parameters in the Odoo bitnami Apache configuration!

To fix this chat real time in your image!

Thanks in advance Good day


https://github.com/odoo/odoo/issues/106339

odoo server

upstream odoo { server 127.0.0.1:8069; } upstream odoochat { server 127.0.0.1:8072; }

map $http_upgrade $connection_upgrade { default upgrade; '' close; }

server { listen 80 default_server; server_name DOMAIN;

proxy_read_timeout 720s; proxy_connect_timeout 720s; proxy_send_timeout 720s;

log

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

Redirect requests to odoo backend server

location / { proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr; proxy_redirect off; proxy_pass http://odoo; }

location /websocket { proxy_pass http://odoochat; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade;

proxy_set_header Upgrade "websocket";

# proxy_set_header Connection "Upgrade";
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;

}

common gzip

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

client_body_in_file_only clean; client_body_buffer_size 32K; client_max_body_size 500M; sendfile on; send_timeout 600s; keepalive_timeout 300; }

gongomgra commented 4 months ago

Hi @Cristianfllc3,

Sorry for the delay. I have been checking the Odoo 17 official configuration and I think I know what's happening. By default, we configure our Odoo instances in multi-threaded mode, while the LiveChat module seems to need Odoo running in multi-process mode. We enable multi-thread by default for simplicity and testing purposes, but you can configure multi-process on your side by following the official Odoo guides on this. Regarding the LiveChat module, we recommend you to check the official docs for further configuration requirements.

About the NGINX configuration you shared, I found it in the Odoo docs as well, although they do not mention Apache web server is not supported. Checking the recommended setup, I understand the only change required in our Apache configuration is to add similar ProxyPass and ProxyPassReverse lines in both Odoo's vhost files pointing to the service at port 8072. You can get more information on how to use and configure Apache's mod_proxy module in the official docs. However, we highly recommend you to ask the official Odoo developers for the Apache configuration for this, just in case any other directive is required to be provided for the LiveChat module to work properly.

Cristianfllc3 commented 4 months ago

Hi @gongomgra

Thanks for the message and the support. I will check the documentation that iu send me, and with the community .

Have a nice day.

Nextcom-NC commented 2 months ago

Hello, here is how I proceeded to make the websocket service work correctly with Apache on Odoo 16 and Odoo 17. This solution works 100% on Odoo 16. On Odoo 17, the websocket service works correctly except with OdooBot onboard (there seems to be an issue with the CSRF token).

Installation of the Bitnami Odoo image on an EC2 instance T3 small (2vCPU + 2GB RAM + 30GB HDD). choose the AMI for your AWS zone : https://bitnami.com/stack/odoo/cloud/aws/amis

Security group with these inbound rules:

HTTPS TCP 443 0.0.0.0/0 HTTP TCP 80 0.0.0.0/0 SSH TCP 22 (My IP)

Create an Elastic IP address Create DNS records type A for www. et non www. with your fixed IPv4 address. —-----------------------------------------------------------------------------------------

1- Verify if a swap is activated :

sudo swapon --show

If result is empty, swap is not enabled, create a swap (e.g., 2GB)

sudo fallocate -l 2G /swapfile

sudo chmod 600 /swapfile

sudo mkswap /swapfile

sudo swapon /swapfile

Verify if a swap is activated :

sudo swapon --show

Permanent swap configuration:

sudo vi /etc/fstab

Add the following line at the end of the file and then save:

/swapfile none swap sw 0 0

2- Update your system : sudo apt-get update sudo apt-get upgrade

Update your server timezone : e.g Europe/Paris sudo timedatectl set-timezone Europe/Paris

httpd.conf configuration : sudo vi /opt/bitnami/apache/conf/httpd.conf remove the # at the line 131: LoadModule proxy_wstunnel_module module/mod_proxy_wstunnel.so

Update this lines with your info (on lines 196 and 205):

ServerAdmin email@mydomain.com ServerName www.mydomain.com:80

sudo vi /opt/bitnami/apache/conf/vhosts/odoo-vhost.conf

Update your domain on line 2:

ServerName www.mydomain.com

sudo vi /opt/bitnami/apache/conf/vhosts/odoo-https-vhost.conf Update your domain on line 2:

ServerName www.mydomain.com

sudo /opt/bitnami/ctlscript.sh restart apache

3- Install letsencrypt SSL certificate :

sudo /opt/bitnami/bncert-tool

4- Modify your odoo.conf

sudo vi /opt/bitnami/odoo/conf/odoo.conf

modify your email on line 17 :

email@mydomain.com

disabled longpolling line 30 with ;

;longpolling_port = 8072

_and add a line 31 for geventport :

gevent_port = 8072

change workers on line 46 end remove the ; :

workers = 2

5- Modify your odoo-https-vhost.conf

sudo vi /opt/bitnami/apache/conf/vhosts/odoo-https-vhost.conf

Add the following lines like this :

<VirtualHost 127.0.0.1:443 _default_:443>
  ServerName www.mydomain.com
  ServerAlias *
  SSLEngine on
  SSLCertificateFile "/opt/bitnami/apache/conf/www.mydomain.com.crt"
  SSLCertificateKeyFile "/opt/bitnami/apache/conf/www.mydomain.com.key"
  # BEGIN: Configuration for letsencrypt
  Include "/opt/bitnami/apps/letsencrypt/conf/httpd-prefix.conf"
  # END: Configuration for letsencrypt
  # Set forwarded headers
  RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
  RequestHeader set "X-Forwarded-SSL" expr=%{HTTPS}
  # BEGIN: Support domain renewal when using mod_proxy without Location
  <IfModule mod_proxy.c>
    ProxyPass /.well-known !
  </IfModule>
  # END: Support domain renewal when using mod_proxy without Location
  # BEGIN: Enable www to non-www redirection
  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
  RewriteCond %{HTTP_HOST} !^localhost
  RewriteCond %{HTTP_HOST} !^[0-9]+.[0-9]+.[0-9]+.[0-9]+(:[0-9]+)?$
  RewriteCond %{REQUEST_URI} !^/\.well-known
  RewriteRule ^(.*)$ https://%1$1 [R=permanent,L]
  # END: Enable www to non-www redirection
  ProxyPreserveHost On
  Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
  Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure;SameSite=Lax
  ProxyPass / http://127.0.0.1:8069/
  ProxyPassReverse / http://127.0.0.1:8069/
   # WebSockets rules for Odoo
  RewriteCond %{HTTP:Upgrade} =websocket [NC]
  RewriteRule /(.*) ws://127.0.0.1:8072/$1 [P,L]
  ProxyPass /websocket ws://127.0.0.1:8072/websocket
  ProxyPassReverse /websocket ws://127.0.0.1:8072/websocket
  # BEGIN: Support domain renewal when using mod_proxy within Location
  <Location /.well-known>
    <IfModule mod_proxy.c>
      ProxyPass !
    </IfModule>
  </Location>
  # END: Support domain renewal when using mod_proxy within Location
</VirtualHost>

6- Allow traffic from websocket port 8072 :

sudo iptables -A INPUT -p tcp --dport 8072 -j ACCEPT sudo iptables -A OUTPUT -p tcp --sport 8072 -j ACCEPT

7- Connect to Odoo at your URL with your account user@example.com and your password

(to see your password use this command) sudo cat /home/bitnami/bitnami_credentials

8- Go to Apps menu and activate discuss module

9- Modify your web.base.url Go to Settings Menu and activate the developer mode (with assets) Go to Settings Menu / Technical / System Parameters

At the key web.base.url change http to https://

10- Restart all services sudo /opt/bitnami/ctlscript.sh restart —----------------------------------------------------------------------------------------------------------------------- Enjoy real-time discussions with apache. 🙂

Cristianfllc3 commented 2 months ago

@Nextcom-NC, Thank you very much for your time and your contribution.

Without a doubt, the solution proposal is better documented than on the official bitanmi page 🪬

gongomgra commented 1 month ago

Hi @Cristianfllc3, @Nextcom-NC,

Thanks for your message and for sharing your solution. We have an internal task open to update the longpolling_port with gevent_port setting in our assets. I will update it to also include the Apache configuration you shared to solve the realtime error. I'm also adding the on-hold tag to avoid the ticket gets automatically closed by the stale bot. We will keep you posted.