bitnami / containers

Bitnami container images
https://bitnami.com
Other
3.43k stars 4.89k forks source link

[bitnami/odoo] Odoo Addons #69248

Closed moctarjallo closed 1 month ago

moctarjallo commented 4 months ago

Describe your issue as much as you can

how to configure adding extra-addons on the odoo image ?

rafariossaa commented 4 months ago

Hi, Not sure what you want to achieve. Do you mean adding an addon to a running Odoo, or do yo mean adding an addon and creating a new image with the addon added ?

moctarjallo commented 4 months ago

Hi, Exactly i mean both.

First i want to mount a directory of addons as a volume for development purposes. Then i want to deploy the addons in the image and build it.

The latter is probably less possible, but i am more interested on the first one.

I have a momentary solution: get into the pod itself by connecting vscode to it, navigate to the /opt/bitnami/odoo/addons folder and edit my modules in there. But that doesn't feel natural and also updating module doesn't work. It should exist a way, probably using values.yaml, to mount a local repo directly into the image of the pod. I did see entries like "extraVolumes" or things like that.. but not sure if that helps.

I wanted to ask directly you guys if you have anticipated on that: a way to deploy a custom module in the odoo image because i couldn't see it mentionned in any of your docs.

Thanks.

moctarjallo commented 4 months ago

I suspect that the solution lies under the extraVolumes and extraVolumesMounts but we probably need more documentation on how to use those variables, maybe with a commented example at least ?

rafariossaa commented 3 months ago

For the chart you would need to provide in the extraVolumes a volume declaration as indicated here. Specific sintax chages depending on the kind of volume you use. Then, you would need where to mount that volume using extraVolumesMounts', the sintax will be the same as in any othervolumeMount` section.

For the container you could use -v docker parameter, or the service's volume section and in general section, if you use docker compose.

moctarjallo commented 3 months ago

Hello thanks for your response and time.

Here's what i have done so far: (in the values.yaml file)

## @param extraVolumes Optionally specify extra list of additional volumes for Odoo pods
  ##
  extraVolumes:
    - name: odoo-addons
      hostPath:
        path: /data/odoo/addons
  ## @param extraVolumeMounts Optionally specify extra list of additional volumeMounts for Odoo container(s)
  ##
  extraVolumeMounts:
    - name: odoo-addons
      mountPath: /opt/bitnami/odoo/addons

And this is the result after running helm install ...:

NAME                    READY   STATUS             RESTARTS      AGE
odoo-5f948b98b4-jjzs6   0/1     CrashLoopBackOff   5 (35s ago)   11m
odoo-postgresql-0       1/1     Running            0             11m

I don't know if people have used this chart before, but i think the most important thing in using Odoo is to be able to add custom modules quickly and so there should have been a clear and concise example on how to do that after building this chart. Otherwise it is just a standalone software, very less useful. On the other hand, this chart would be very powerful if we had that at least !

rafariossaa commented 3 months ago

Hi, Please, Could you enable debug and provide the logs of the crashing pod ?

moctarjallo commented 3 months ago

Hi Rafael,

Here's the logs:

odoo 10:32:20.89 INFO  ==> 
odoo 10:32:20.89 INFO  ==> Welcome to the Bitnami odoo container
odoo 10:32:20.89 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
odoo 10:32:20.89 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
odoo 10:32:20.89 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
odoo 10:32:20.89 INFO  ==>
odoo 10:32:20.90 INFO  ==> Validating settings in POSTGRESQL_CLIENT_* env vars
odoo 10:32:20.91 DEBUG ==> Validating settings in ODOO_* environment variables...
odoo 10:32:20.92 INFO  ==> Ensuring Odoo directories exist
odoo 10:32:20.92 INFO  ==> Trying to connect to the database server
psql: error: connection to server at "odoo-postgresql" (10.97.110.20), port 5432 failed: FATAL:  password authentication failed for user "bn_odoo"
psql: error: connection to server at "odoo-postgresql" (10.97.110.20), port 5432 failed: FATAL:  password authentication failed for user "bn_odoo"
psql: error: connection to server at "odoo-postgresql" (10.97.110.20), port 5432 failed: FATAL:  password authentication failed for user "bn_odoo"

This only occurs after i have made the previous modifications.

rafariossaa commented 3 months ago

If you delete the deployment and try deploy it again without removing the previous PVC, you would need to pass the previous passwords. Are you providing them ?

moctarjallo commented 3 months ago

Actually i deleted everything (even the minikube cluster) and start from scratch with the added lines of code above and that's what i still get.

But are you telling me that my syntax should be correct ?

fmulero commented 3 months ago

Hi @moctarjallo

I think I've just reproduced your issue. If we try to install the odoo chart with the configuration above, the odoo pod starts doing the initialization but it tries to persist the data exisiting in the /opt/bitnami/odoo/addons into /bitnami/data/addons. As final step, it transforms /opt/bitnami/odoo/addons to a symlink pointing to /bitnami/data/addons but it fails because is a mounted volume. After this failure, the pod will be restarted and you could see the databases errors becuase the configuration is not fully stored in the persistent volume.

To be perfectly blunt I don't see right now an easy way to develop new addons using the chart as it is right now without changing the container logic. I can give you some ideas but I didn't test them:

moctarjallo commented 3 months ago

Hello @fmulero thank you so much for taking the time to reproduce and explain the error. As for the solutions, the first doesn't sound useful if we have to reinstall the chart everytime (it means it is not development-wise friendly). For the second solution i am afraid i am going to be lost again in the variables/values to set, but if you have any snippet idea i would be very grateful.

I think the developers of this chart should have thought about including addon development logic beforehand because i don't think the chart would be useful then. Hope they're going to think about this at their next versions..

github-actions[bot] commented 2 months 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.

moctarjallo commented 2 months ago

Hello. Does anyone has a working solution to this? Thank you!

github-actions[bot] commented 2 months 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.

moctarjallo commented 2 months ago

Hello. Does anyone has a working solution to this? Thank you!

github-actions[bot] commented 1 month 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 1 month 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.