Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network "odoo-13_default" needs to be recreated - option "encrypted" has changed #307

Closed
manuelcalerosolis opened this issue May 17, 2020 · 12 comments

Comments

@manuelcalerosolis
Copy link

Following all the steps indicated in the new doodba-copier manual, I put the docker containers into operation without problems. But when trying to start production mode with the following command, I get this error.

$ docker-compose -f prod.yaml up

WARNING: The SMTP_REAL_NON_CANONICAL_DEFAULT variable is not set. Defaulting to a blank string.

ERROR: Network "odoo-13_default" needs to be recreated - option "encrypted" has changed

What I can do?

Thank you

@pedrobaeza
Copy link
Member

pedrobaeza commented May 18, 2020

docker-compose down --remove-orphans
docker-compose up -d

@pleirb
Copy link

pleirb commented May 25, 2023

This happened to me after executing the docker-compose -f prod.yaml up -d command with the intention of switching to production mode, since changing the symbolic link with ln -sf prod.yaml docker-compose.yml did not Has it worked for me or am I not using it as it should. With docker ps I no longer see what port is exposed with in development mode. Until now I had focused on understanding the development mode and I have worked well with it, but now I need to see how it is used in production and I should definitely study or review in the documentation how is the procedure to change from one mode to another. Or be able to test it .

@ssaid
Copy link

ssaid commented May 25, 2023

You have to recreate the network, either by doing what Pedro has descripted or using docker network commands (docker network ls and docker network rm)

@pedrobaeza
Copy link
Member

I have refined my commands for assuring everything is recreated.

@pleirb
Copy link

pleirb commented May 25, 2023

You have to recreate the network, either by doing what Pedro has descripted or using docker network commands (docker network ls and docker network rm)

I've made an effort so far to study docker and understand some networking, but not enough to realize why you have to make changes to the network. You may also need to study Traefik and understand the difference between a development and production environment. I must continue studying! Maybe what I want cannot be done, I want to stop using development mode and go to production with the same copier project

@pleirb
Copy link

pleirb commented May 25, 2023

He refinado mis comandos para asegurar que todo se recree.

Sorry, I did not understand the message

@pedrobaeza
Copy link
Member

Check my edited original commands

@pleirb
Copy link

pleirb commented May 26, 2023

Check my edited original commands

Great, I got it, just that I was late and ran other commands that maybe damaged something and now when I run
docker-compose down --remove-orphans
I get this error:

yaml.scanner.ScannerError: mapping values ​​are not allowed here
  in "./prod.yaml", line 28, column 41

and I don't know why...

In theory, it should be possible to switch between the 3 types of environment, right? Development, test and production, right? I still can't make use of a suitable recipe for this purpose

@ssaid
Copy link

ssaid commented May 26, 2023 via email

@pleirb
Copy link

pleirb commented May 26, 2023

Thanks for answering
git checkout prod.yaml It returns the following error:
specified path 'prod.yaml' did not match any file known to git
My prod.yaml file contains the following:

version: "2.4"

services:
  odoo:
    extends:
      file: common.yaml
      service: odoo
    restart: unless-stopped
    env_file:
      - .docker/odoo.env
      - .docker/db-access.env
    environment:
      DB_FILTER: "^web.prueba.com"
      DOODBA_ENVIRONMENT: "${DOODBA_ENVIRONMENT-prod}"
      INITIAL_LANG: "es_ES"
    depends_on:
      - db
    networks:
      default:
      inverseproxy_shared:
    labels:
      doodba.domain.main: ""
      traefik.enable: "true"
      traefik.domain: ""
      traefik.forbiddenCrawlers-0.frontend.headers.customResponseHeaders:
        "X-Robots-Tag:noindex, nofollow"
      traefik.forbiddenCrawlers-0.frontend.rule: Host:;Path:/web,/web/{anything:.*},/website/info,/website/info/{anything:.*}
      traefik.main-0.frontend.rule: Host:
      traefik.longpolling-0.frontend.rule: Host:;Path:/longpolling/{anything:.*}
      traefik.longpolling-0.port: 8072
      traefik.http.middlewares.odoo12-12-0-prod-buffering.buffering.retryExpression:
        IsNetworkError() && Attempts() < 5
      traefik.http.middlewares.odoo12-12-0-prod-compress.compress: "true"
      ? traefik.http.middlewares.odoo12-12-0-prod-forbid-crawlers.headers.customResponseHeaders.X-Robots-Tag
      : "noindex, nofollow"
      traefik.http.middlewares.odoo12-12-0-prod-addSTS.headers.forceSTSHeader: "true"
      traefik.http.middlewares.odoo12-12-0-prod-forceSecure.redirectScheme.scheme: https
      traefik.http.middlewares.odoo12-12-0-prod-forceSecure.redirectScheme.permanent: "true"
      traefik.http.services.odoo12-12-0-prod-main.loadbalancer.server.port: 8069
      traefik.http.services.odoo12-12-0-prod-longpolling.loadbalancer.server.port: 8072
      traefik.http.routers.odoo12-12-0-prod-main-0.rule:
        Host()
      traefik.http.routers.odoo12-12-0-prod-main-0.service:
        odoo12-12-0-prod-main
      traefik.http.routers.odoo12-12-0-prod-main-0.middlewares:
        odoo12-12-0-prod-addSTS, odoo12-12-0-prod-buffering, odoo12-12-0-prod-compress, odoo12-12-0-prod-forceSecure
      traefik.http.routers.odoo12-12-0-prod-main-secure-0.rule:
        Host()
      traefik.http.routers.odoo12-12-0-prod-main-secure-0.service:
        odoo12-12-0-prod-main
      traefik.http.routers.odoo12-12-0-prod-main-secure-0.middlewares:
        odoo12-12-0-prod-addSTS, odoo12-12-0-prod-buffering, odoo12-12-0-prod-compress, odoo12-12-0-prod-forceSecure
      traefik.http.routers.odoo12-12-0-prod-main-secure-0.tls: "true"
      traefik.http.routers.odoo12-12-0-prod-main-secure-0.tls.certResolver:
        letsencrypt
      traefik.http.routers.odoo12-12-0-prod-longpolling-0.rule:
        Host() && PathPrefix(`/longpolling/`)
      traefik.http.routers.odoo12-12-0-prod-longpolling-0.service:
        odoo12-12-0-prod-longpolling
      traefik.http.routers.odoo12-12-0-prod-longpolling-0.middlewares:
        odoo12-12-0-prod-addSTS, odoo12-12-0-prod-forceSecure
      traefik.http.routers.odoo12-12-0-prod-longpolling-secure-0.rule:
        Host() && PathPrefix(`/longpolling/`)
      traefik.http.routers.odoo12-12-0-prod-longpolling-secure-0.service:
        odoo12-12-0-prod-longpolling
      traefik.http.routers.odoo12-12-0-prod-longpolling-secure-0.middlewares:
        odoo12-12-0-prod-addSTS, odoo12-12-0-prod-forceSecure
      traefik.http.routers.odoo12-12-0-prod-longpolling-secure-0.tls: "true"
      traefik.http.routers.odoo12-12-0-prod-longpolling-secure-0.tls.certResolver:
        letsencrypt
      traefik.http.routers.odoo12-12-0-prod-forbiddenCrawlers-0.rule:
        Host() && (PathPrefix(`/web/`, `/website/info/`) || Path(`/web`, `/website/info`))
      traefik.http.routers.odoo12-12-0-prod-forbiddenCrawlers-0.service:
        odoo12-12-0-prod-main
      traefik.http.routers.odoo12-12-0-prod-forbiddenCrawlers-0.middlewares:
        odoo12-12-0-prod-addSTS, odoo12-12-0-prod-buffering, odoo12-12-0-prod-compress, odoo12-12-0-prod-forbid-crawlers, odoo12-12-0-prod-forceSecure
      traefik.http.routers.odoo12-12-0-prod-forbiddenCrawlers-secure-0.rule:
        Host() && (PathPrefix(`/web/`, `/website/info/`) || Path(`/web`, `/website/info`))
      traefik.http.routers.odoo12-12-0-prod-forbiddenCrawlers-secure-0.service:
        odoo12-12-0-prod-main
      traefik.http.routers.odoo12-12-0-prod-forbiddenCrawlers-secure-0.middlewares:
        odoo12-12-0-prod-addSTS, odoo12-12-0-prod-buffering, odoo12-12-0-prod-compress, odoo12-12-0-prod-forbid-crawlers, odoo12-12-0-prod-forceSecure
      traefik.http.routers.odoo12-12-0-prod-forbiddenCrawlers-secure-0.tls: "true"
      traefik.http.routers.odoo12-12-0-prod-forbiddenCrawlers-secure-0.tls.certResolver:
        letsencrypt

  db:
    extends:
      file: common.yaml
      service: db
    env_file:
      - .docker/db-creation.env
    restart: unless-stopped

networks:
  default:
    driver_opts:
      encrypted: 1

  inverseproxy_shared:
    external: true

volumes:
  filestore:
  db:

@ssaid
Copy link

ssaid commented May 26, 2023

I'm using nginx as a reverse proxy, and use this prod.yaml to deploy in production

`version: "2.4"

services:
  odoo:
    extends:
      file: common.yaml
      service: odoo
    restart: unless-stopped
    env_file:
      - .docker/odoo.env
      - .docker/db-access.env
    environment:
      DB_FILTER: "^prod"
      DOODBA_ENVIRONMENT: "${DOODBA_ENVIRONMENT-prod}"
      INITIAL_LANG: "en_US"
    depends_on:
      - db
    networks:
      default:
    labels:
      doodba.domain.main: ""

  db:
    extends:
      file: common.yaml
      service: db
    env_file:
      - .docker/db-creation.env
    restart: unless-stopped

  backup:
    extends:
      file: common.yaml
      service: backup
    env_file:
      - .docker/backup.env
      - .docker/db-access.env
    restart: unless-stopped
    depends_on:
      - db

networks:
  default:
    driver_opts:
      encrypted: 1

volumes:
  backup_cache:
  filestore:
  db:

@pleirb
Copy link

pleirb commented May 29, 2023

Thank you all! In the end, this type of error and others occurred to me from trying to change the environment and luckily what was happening to me was nonsense, whoever is interested, what they comment here has helped me: #418

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants