bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
8.78k stars 9.08k forks source link

[bitnami/odoo] Multiple databases on db_name parameter #27922

Closed jaoa12or closed 3 weeks ago

jaoa12or commented 1 month ago

Name and Version

bitnami/odoo 26.2.10

What architecture are you using?

arm64

What steps will reproduce the bug?

Trying to set more than one database on database parameter

Are you using any custom parameters or values?

global:
            storageClass: "efs-sc"
          image:
            repository: "rudecoding/odoo"
            tag: "17.0.20240705-debian-12-r0"
          resources:
            requests:
              memory: "1200Mi"
              cpu: "512m"
          pushgateway:
            enabled: false
          postgresql:
            enabled: false
          externalDatabase:
            host: "rude-rds-postgresql.xxxxxxxxxxxxx"
            user: "user"
            database: "demo,demo2"
            port: 5432
            create: true
            postgresqlPostgresUser: "db_user"
            existingSecret: "external-db"
            existingSecretPasswordKey: "password"
            existingSecretPostgresPasswordKey: "postgresqlPostgresPassword"
          extraEnvVars:
            - name: "BITNAMI_DEBUG"
              value: "true"
            - name: "NAMI_DEBUG"
              value: "true"
            - name: "NAMI_LOG_LEVEL"
              value: "trace8"
          persistence:
            enabled: true
            existingClaim: "pvc"
          service:
            type: "ClusterIP"
            extraPorts:
              - name: "websocket"
                port: 8072
          extraContainerPorts:
            - name: "websocket"
              containerPort: 8072
          loadDemoData: false
      parameters:
        - name: autoscaling.enabled
          value: 'true'
        - name: autoscaling.minReplicas
          value: '1'
        - name: autoscaling.maxReplicas
          value: '1'
        - name: readinessProbe.enabled
          value: 'true'
        - name: persistence.accessMode
          value: ReadWriteMany
        - name: 'persistence.accessModes[0]'
          value: ReadWriteMany
        - name: autoscaling.targetMemory
          value: '95'
        - name: autoscaling.targetCPU
          value: '50'

What is the expected behavior?

All the databases most been included on db_name parameter in .conf in order for the cron job scheduler to work in all of them.

What do you see instead?

Page 1 (Lines 1 to 32)
32
odoo 02:14:42.09 INFO  ==>
31
odoo 02:14:42.09 INFO  ==> Welcome to the Bitnami odoo container
30
odoo 02:14:42.09 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
29
odoo 02:14:42.10 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
28
odoo 02:14:42.10 INFO  ==> Upgrade to Tanzu Application Catalog for production environments to access custom-configured and pre-packaged software components. Gain enhanced features, including Software Bill of Materials (SBOM), CVE scan result reports, and VEX documents. To learn more, visit https://bitnami.com/enterprise
27
odoo 02:14:42.10 INFO  ==>
26
odoo 02:14:42.11 INFO  ==> Validating settings in POSTGRESQL_CLIENT_* env vars
25
odoo 02:14:42.12 INFO  ==> Trying to connect to the database server
24
 ?column?
23
----------
22
        1
21
(1 row)
20
19
odoo 02:14:42.25 INFO  ==> Creating database user user
18
DO
17
odoo 02:14:42.31 INFO  ==> Creating database demo
16
odoo 02:14:42.38 DEBUG ==> Providing privileges to username user on database demo
15
GRANT
14
ALTER DATABASE
13
odoo 02:14:42.44 INFO  ==> Creating database demo2
12
odoo 02:14:42.49 DEBUG ==> Providing privileges to username user on database demo2
11
GRANT
10
ALTER DATABASE
9
odoo 02:14:42.56 DEBUG ==> Validating settings in ODOO_* environment variables...
8
odoo 02:14:42.59 INFO  ==> Restoring persisted Odoo installation
7
odoo 02:14:42.62 INFO  ==> Trying to connect to the database server
6
odoo 02:14:42.62 DEBUG ==> Getting db_host from Odoo configuration
5
odoo 02:14:42.63 DEBUG ==> Getting db_port from Odoo configuration
4
odoo 02:14:42.65 DEBUG ==> Getting db_name from Odoo configuration
3
odoo 02:14:42.66 DEBUG ==> Getting db_user from Odoo configuration
2
odoo 02:14:42.67 DEBUG ==> Getting db_password from Odoo configuration
1
psql: error: connection to server at "rude-rds-postgresql.xxxxxxxxxxxx" (64:ff9b::a00:), port 5432 failed: FATAL:  database "demo,demo2" does not exist

Additional information

No response

javsalgar commented 1 month ago

Hi!

Could you add more details about the use case? In principle Odoo is configured to work on one database

jaoa12or commented 1 month ago

Hello. Yes, of course. Odoo has the possibility to implement a multi tenancy environment (https://www.odoo.com/documentation/17.0/administration/on_premise/deploy.html) a single Odoo system may run and serve a number of database instances. With the current customizations options, when you implement this kind of environment for your odoo implementation, the Cron jobs, for example are executed just for the one database on db_name parameter. One solution for this is to list all the databases that the instance owns on this parameter in order to tell the scheduler system that has this databases in account. I will share with you a .conf example for this use case.

db_host = 
db db_port = 5432 
db_name = demo1,demo2,demo3
dbfilter = ^%d$
list_db = True 
proxy_mode = True 
smtp_server = smtp 
smtp_port = 25 
smtp_user = false 
smtp_password = false 
smtp_ssl = false
email_from =
without_demo = all
geoip_database = /opt/odoo/auto/geoip/GeoLite2-City.mmdb
server_wide _modules = base,web
receive _catchall _mails = True
limit _time_cpu = 6000
limit_time_real = 120000
db_maxconn = 200
workers =6
max_cron_threads = 2
limit_memory hard = 4684354560 limit_memory soft = 4147483648 send sri documents = True
validate_authorization _sri = False
javsalgar commented 1 month ago

Hi,

Thanks for letting us know. Right now this would require modifications in the bitnami/odoo container. I will forward this to the team but as it is not a critical feature we cannot guarantee an ETA. However, if you want to speed up the process, you can submit a PR modifying the Odoo bash logic and we will review it. https://github.com/bitnami/containers/blob/main/bitnami/odoo/17/debian-12/rootfs/opt/bitnami/scripts/libodoo.sh

github-actions[bot] commented 4 weeks ago

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

github-actions[bot] commented 3 weeks ago

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.