ERPNext Updating from 13.22.1 to 13.25.1

Hi All,
I’ve been trying updating my installation from 13.22.1 to 13.25.1
but i receive the below, i am running on docker v20.10.12.

Any Ideas !

erp5_redis-queue_1 is up-to-date
erp5_mariadb_1 is up-to-date
Recreating erp5_erpnext-nginx_1 …
erp5_redis-socketio_1 is up-to-date
Recreating erp5_erpnext-nginx_1 … done
erp5_redis-cache_1 is up-to-date
Recreating erp5_frappe-socketio_1 … done
Recreating erp5_erpnext-worker-default_1 …
Recreating erp5_erpnext-python_1 … done
Recreating erp5_erpnext-schedule_1 … error
Recreating erp5_erpnext-worker-default_1 … error

ERROR: for erp5_erpnext-schedule_1 Cannot start service erpnext-schedule: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: “schedule”: executable file not found in $PATH: unknown
Recreating erp5_site-creator_1 …

ERROR: for erp5_erpnext-worker-default_1 Cannot start service erpnext-worker-default: OCI runtime create failed:Recreating erp5_erpnext-worker-short_1 … errornknown
Recreating erp5_erpnext-worker-long_1 … error
ERROR: for erp5_erpnext-worker-short_1 Cannot start service erpnext-worker-short: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: “worker”: executable file not found in $PATH: unknown

ERROR: for erp5_erpnext-worker-long_1 Cannot start service erpnext-worker-long: OCI runtime create failed: contaRecreating erp5_site-creator_1 … error

ERROR: for erp5_site-creator_1 Cannot start service site-creator: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: “new”: executable file not found in $PATH: unknown

ERROR: for erpnext-schedule Cannot start service erpnext-schedule: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: “schedule”: executable file not found in $PATH: unknown

ERROR: for erpnext-worker-default Cannot start service erpnext-worker-default: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: “worker”: executable file not found in $PATH: unknown

ERROR: for erpnext-worker-short Cannot start service erpnext-worker-short: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: “worker”: executable file not found in $PATH: unknown

ERROR: for erpnext-worker-long Cannot start service erpnext-worker-long: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: “worker”: executable file not found in $PATH: unknown

ERROR: for site-creator Cannot start service site-creator: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: “new”: executable file not found in $PATH: unknown
ERROR: Encountered errors while bringing up the project.

there was a refactor with images

to continue with old setup, use the compat branch of frappe_docker repo.

to use new compose files check https://github.com/frappe/frappe_docker/blob/main/docs/single-server-example.md

Hi @revant_one

I have a problem too to upgrade from 13.22.0 to any higher version.

logs in nginx
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration,
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/,
/docker-entrypoint.sh: Launching /docker-entrypoint.d/frappe-entrypoint.sh,
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh,
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf,
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version,
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh,
20-envsubst-on-templates.sh: Running envsubst on /etc/nginx/templates/default.conf.template to /etc/nginx/conf.d/default.conf,
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh,
/docker-entrypoint.sh: Configuration complete; ready for start up,
2022/04/08 11:42:28 [emerg] 1#1: host not found in upstream “${BACKEND}” in /etc/nginx/conf.d/default.conf:2,
nginx: [emerg] host not found in upstream “${BACKEND}” in /etc/nginx/conf.d/default.conf:2

I used your old script for Dockerswarm deployment - Multi Sites.

Am I missing something?

there was a refactor with images

to continue with old setup, use the compat branch of frappe_docker repo.

to use new compose files check frappe_docker/docs/single-server-example.md at main · frappe/frappe_docker · GitHub

I used your old script for Dockerswarm deployment - Multi Sites.

refer frappe_docker/pwd.yml at main · frappe/frappe_docker · GitHub simple setup that contains everything. Make changes to your compose yamls accordingly

use $$host here instead of frontend

How to use this (after changing frontend to $$host) from Portainer ? from a container console or I login to the server and run a command in the Frappe_Docker folder?

My Docker version is
# docker -v
Docker version 20.10.6, build 370c289

I deployed the server using

So, I used the dockerswarm.rocks guide to setup Docker swarm, Traefik and Portainer. Then used Portainer for the rest of the installation as suggested.

Now I don’t know where to make this fix.

Thanks,

have you used portainer? if you’ve used it you’ll know it is used to control the swarm, manage, update stacks, edit env variables etc.

if you added your ERPNext as stack through portainer then edit it through portainer.

Yes this is what I did.

I created a stack “frappe-bench-v13” as follows

version: "3.7"

services:
  redis-cache:
image: redis:latest
volumes:
  - redis-cache-vol:/data
deploy:
  restart_policy:
    condition: on-failure
networks:
  - frappe-network

  redis-queue:
image: redis:latest
volumes:
  - redis-queue-vol:/data
deploy:
  restart_policy:
    condition: on-failure
networks:
  - frappe-network

  redis-socketio:
image: redis:latest
volumes:
  - redis-socketio-vol:/data
deploy:
  restart_policy:
    condition: on-failure
networks:
  - frappe-network
  
  erpnext-nginx:
image: frappe/erpnext-nginx:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
environment:
  - UPSTREAM_REAL_IP_ADDRESS=10.0.0.0/8
  - FRAPPE_PY=erpnext-python
  - FRAPPE_PY_PORT=8000
  - FRAPPE_SOCKETIO=frappe-socketio
  - SOCKETIO_PORT=9000
volumes:
  - sites-vol:/var/www/html/sites:rw
  - assets-vol:/assets:rw
networks:
  - frappe-network
  - traefik-public
deploy:
  restart_policy:
    condition: on-failure
  labels:
    - "traefik.docker.network=traefik-public"
    - "traefik.enable=true"
    - "traefik.constraint-label=traefik-public"
    - "traefik.http.routers.erpnext-nginx.rule=Host(${SITES?Variable SITES not set})"
    - "traefik.http.routers.erpnext-nginx.entrypoints=http"
    - "traefik.http.routers.erpnext-nginx.middlewares=https-redirect"
    - "traefik.http.routers.erpnext-nginx-https.rule=Host(${SITES?Variable SITES not set})"
    - "traefik.http.routers.erpnext-nginx-https.entrypoints=https"
    - "traefik.http.routers.erpnext-nginx-https.tls=true"
    - "traefik.http.routers.erpnext-nginx-https.tls.certresolver=le"
    - "traefik.http.services.erpnext-nginx.loadbalancer.server.port=8080"

  erpnext-python:
image: frappe/erpnext-worker:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
deploy:
  restart_policy:
    condition: on-failure
environment:
  - MARIADB_HOST=${MARIADB_HOST?Variable MARIADB_HOST not set}
  - REDIS_CACHE=redis-cache:6379
  - REDIS_QUEUE=redis-queue:6379
  - REDIS_SOCKETIO=redis-socketio:6379
  - SOCKETIO_PORT=9000
  - AUTO_MIGRATE=1
volumes:
  - sites-vol:/home/frappe/frappe-bench/sites:rw
  - assets-vol:/home/frappe/frappe-bench/sites/assets:rw
networks:
  - frappe-network

  frappe-socketio:
image: frappe/frappe-socketio:${FRAPPE_VERSION?Variable FRAPPE_VERSION not set}
deploy:
  restart_policy:
    condition: on-failure
volumes:
  - sites-vol:/home/frappe/frappe-bench/sites:rw
  - logs-vol:/home/frappe/frappe-bench/logs:rw
networks:
  - frappe-network

  erpnext-worker-default:
image: frappe/erpnext-worker:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
deploy:
  restart_policy:
    condition: on-failure
command: worker
volumes:
  - sites-vol:/home/frappe/frappe-bench/sites:rw
  - logs-vol:/home/frappe/frappe-bench/logs:rw
networks:
  - frappe-network

  erpnext-worker-short:
image: frappe/erpnext-worker:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
deploy:
  restart_policy:
    condition: on-failure
command: worker
environment:
  - WORKER_TYPE=short
volumes:
  - sites-vol:/home/frappe/frappe-bench/sites:rw
  - logs-vol:/home/frappe/frappe-bench/logs:rw
networks:
  - frappe-network

  erpnext-worker-long:
image: frappe/erpnext-worker:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
deploy:
  restart_policy:
    condition: on-failure
command: worker
environment:
  - WORKER_TYPE=long
volumes:
  - sites-vol:/home/frappe/frappe-bench/sites:rw
networks:
  - frappe-network

  frappe-schedule:
image: frappe/erpnext-worker:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
deploy:
  restart_policy:
    condition: on-failure
command: schedule
volumes:
  - sites-vol:/home/frappe/frappe-bench/sites:rw
  - logs-vol:/home/frappe/frappe-bench/logs:rw
      
networks:
  - frappe-network

#  fix-vol-permissions:
#    image: frappe/erpnext-worker:${ERPNEXT_VERSION}
#    user: root
#    command: chown -R 1000:1000 /sites /assets /logs
#    volumes:
#      - sites-vol:/sites
#      - assets-vol:/assets
#      - logs-vol:/logs

volumes:
  redis-cache-vol:
  redis-queue-vol:
  redis-socketio-vol:
  assets-vol:
  sites-vol:
  logs-vol:
  
networks:
  traefik-public:
external: true
  frappe-network:
external: true

I can’t find the “frontend” section you referred to.

Do you mean adding to the nginx part here: (under environment)

  erpnext-nginx:
    image: frappe/erpnext-nginx:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
    environment:
      - UPSTREAM_REAL_IP_ADDRESS=10.0.0.0/8
      - FRAPPE_PY=erpnext-python
      - FRAPPE_PY_PORT=8000
      - FRAPPE_SOCKETIO=frappe-socketio
      - SOCKETIO_PORT=9000

@revant_one
I tried many options but still getting the “Backend “ error. Any advice to change this from Portainer?

Also, do you suggest that I upgrade Docker to latest version? Any risk of loosing the data?
Thanks,

Recently I installed new images on docker swarm using this gist ERPNext on Docker Swarm · GitHub

Really I can’t help you much. I can just share my working configs, but those are not guaranteed to work for you anyways.

Note: I’m part of community. I just share what I find with others in community. If docker doesn’t work, It is not my fault.

Thank you so much for your help. We are all sharing in the community what can solve our problems. The issue of the image refactor may affect hundreds of deployments.

As a general advice, for community members who have followed the Docker Swarm with Portainer path, what do you suggest try to solve using Portainer or create a new fresh installation and migrate the current Sites to it?

Thanks,

@Ysedky your previous stack yaml looked like this:

Old YAML
version: "3.7"

services:
  redis-cache:
    image: redis:latest
    volumes:
      - redis-cache-vol:/data
    deploy:
      restart_policy:
        condition: on-failure
    networks:
      - frappe-network

  redis-queue:
    image: redis:latest
    volumes:
      - redis-queue-vol:/data
    deploy:
      restart_policy:
        condition: on-failure
    networks:
      - frappe-network

  redis-socketio:
    image: redis:latest
    volumes:
      - redis-socketio-vol:/data
    deploy:
      restart_policy:
        condition: on-failure
    networks:
      - frappe-network

  erpnext-nginx:
    image: frappe/erpnext-nginx:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
    environment:
#      - FRAPPE_SITE_NAME_HEADER=$$host
      - UPSTREAM_REAL_IP_ADDRESS=10.0.0.0/8
      - FRAPPE_PY=erpnext-python
      - FRAPPE_PY_PORT=8000
      - FRAPPE_SOCKETIO=frappe-socketio
      - SOCKETIO_PORT=9000
    volumes:
      - sites-vol:/var/www/html/sites:rw
      - assets-vol:/assets:rw
    networks:
      - frappe-network
      - traefik-public
    deploy:
      restart_policy:
        condition: on-failure
      labels:
        - "traefik.docker.network=traefik-public"
        - "traefik.enable=true"
        - "traefik.constraint-label=traefik-public"
        - "traefik.http.routers.erpnext-nginx.rule=Host(${SITES?Variable SITES not set})"
        - "traefik.http.routers.erpnext-nginx.entrypoints=http"
        - "traefik.http.routers.erpnext-nginx.middlewares=https-redirect"
        - "traefik.http.routers.erpnext-nginx-https.rule=Host(${SITES?Variable SITES not set})"
        - "traefik.http.routers.erpnext-nginx-https.entrypoints=https"
        - "traefik.http.routers.erpnext-nginx-https.tls=true"
        - "traefik.http.routers.erpnext-nginx-https.tls.certresolver=le"
        - "traefik.http.services.erpnext-nginx.loadbalancer.server.port=8080"

  erpnext-python:
    image: frappe/erpnext-worker:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
    deploy:
      restart_policy:
        condition: on-failure
    environment:
      - MARIADB_HOST=${MARIADB_HOST?Variable MARIADB_HOST not set}
      - REDIS_CACHE=redis-cache:6379
      - REDIS_QUEUE=redis-queue:6379
      - REDIS_SOCKETIO=redis-socketio:6379
      - SOCKETIO_PORT=9000
      - AUTO_MIGRATE=1
    volumes:
      - sites-vol:/home/frappe/frappe-bench/sites:rw
      - assets-vol:/home/frappe/frappe-bench/sites/assets:rw
    networks:
      - frappe-network

  frappe-socketio:
    image: frappe/frappe-socketio:${FRAPPE_VERSION?Variable FRAPPE_VERSION not set}
    deploy:
      restart_policy:
        condition: on-failure
    volumes:
      - sites-vol:/home/frappe/frappe-bench/sites:rw
      - logs-vol:/home/frappe/frappe-bench/logs:rw
    networks:
      - frappe-network

  erpnext-worker-default:
    image: frappe/erpnext-worker:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
    deploy:
      restart_policy:
        condition: on-failure
    command: worker
    volumes:
      - sites-vol:/home/frappe/frappe-bench/sites:rw
      - logs-vol:/home/frappe/frappe-bench/logs:rw
    networks:
      - frappe-network

  erpnext-worker-short:
    image: frappe/erpnext-worker:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
    deploy:
      restart_policy:
        condition: on-failure
    command: worker
    environment:
      - WORKER_TYPE=short
    volumes:
      - sites-vol:/home/frappe/frappe-bench/sites:rw
      - logs-vol:/home/frappe/frappe-bench/logs:rw
    networks:
      - frappe-network

  erpnext-worker-long:
    image: frappe/erpnext-worker:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
    deploy:
      restart_policy:
        condition: on-failure
    command: worker
    environment:
      - WORKER_TYPE=long
    volumes:
      - sites-vol:/home/frappe/frappe-bench/sites:rw
    networks:
      - frappe-network

  frappe-schedule:
    image: frappe/erpnext-worker:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
    deploy:
      restart_policy:
        condition: on-failure
    command: schedule
    volumes:
      - sites-vol:/home/frappe/frappe-bench/sites:rw
      - logs-vol:/home/frappe/frappe-bench/logs:rw

    networks:
      - frappe-network

#  fix-vol-permissions:
#    image: frappe/erpnext-worker:${ERPNEXT_VERSION}
#    user: root
#    command: chown -R 1000:1000 /sites /assets /logs
#    volumes:
#      - sites-vol:/sites
#      - assets-vol:/assets
#      - logs-vol:/logs

volumes:
  redis-cache-vol:
  redis-queue-vol:
  redis-socketio-vol:
  assets-vol:
  sites-vol:
  logs-vol:

networks:
  traefik-public:
    external: true
  frappe-network:
    external: true

Updated YAML:

version: "3.7"

services:
  redis-cache:
    image: redis:latest
    volumes:
      - redis-cache-vol:/data
    deploy:
      restart_policy:
        condition: on-failure
    networks:
      - frappe-network

  redis-queue:
    image: redis:latest
    volumes:
      - redis-queue-vol:/data
    deploy:
      restart_policy:
        condition: on-failure
    networks:
      - frappe-network

  redis-socketio:
    image: redis:latest
    volumes:
      - redis-socketio-vol:/data
    deploy:
      restart_policy:
        condition: on-failure
    networks:
      - frappe-network

  erpnext-nginx:
    image: frappe/erpnext-nginx:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
    environment:
      - BACKEND=erpnext-python:8000
      - FRAPPE_SITE_NAME_HEADER=$$host
      - SOCKETIO=frappe-socketio:9000
      - UPSTREAM_REAL_IP_ADDRESS=127.0.0.1
      - UPSTREAM_REAL_IP_HEADER=X-Forwarded-For
      - UPSTREAM_REAL_IP_RECURSIVE=off
    volumes:
      - sites-vol:/usr/share/nginx/html/sites:rw
      - assets-vol:/usr/share/nginx/html/assets:rw
    networks:
      - frappe-network
      - traefik-public
    deploy:
      restart_policy:
        condition: on-failure
      labels:
        - "traefik.docker.network=traefik-public"
        - "traefik.enable=true"
        - "traefik.constraint-label=traefik-public"
        - "traefik.http.routers.erpnext-nginx.rule=Host(${SITES?Variable SITES not set})"
        - "traefik.http.routers.erpnext-nginx.entrypoints=http"
        - "traefik.http.routers.erpnext-nginx.middlewares=https-redirect"
        - "traefik.http.routers.erpnext-nginx-https.rule=Host(${SITES?Variable SITES not set})"
        - "traefik.http.routers.erpnext-nginx-https.entrypoints=https"
        - "traefik.http.routers.erpnext-nginx-https.tls=true"
        - "traefik.http.routers.erpnext-nginx-https.tls.certresolver=le"
        - "traefik.http.services.erpnext-nginx.loadbalancer.server.port=8080"

  erpnext-python:
    image: frappe/erpnext-worker:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
    deploy:
      restart_policy:
        condition: on-failure
    volumes:
      - sites-vol:/home/frappe/frappe-bench/sites:rw
      - assets-vol:/home/frappe/frappe-bench/sites/assets:rw
    networks:
      - frappe-network

  frappe-socketio:
    image: frappe/frappe-socketio:${FRAPPE_VERSION?Variable FRAPPE_VERSION not set}
    deploy:
      restart_policy:
        condition: on-failure
    volumes:
      - sites-vol:/home/frappe/frappe-bench/sites:rw
      - logs-vol:/home/frappe/frappe-bench/logs:rw
    networks:
      - frappe-network

  erpnext-worker-default:
    image: frappe/erpnext-worker:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
    deploy:
      restart_policy:
        condition: on-failure
    command:
      - bench
      - worker
      - --queue
      - default
    volumes:
      - sites-vol:/home/frappe/frappe-bench/sites:rw
      - logs-vol:/home/frappe/frappe-bench/logs:rw
    networks:
      - frappe-network

  erpnext-worker-short:
    image: frappe/erpnext-worker:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
    deploy:
      restart_policy:
        condition: on-failure
    command:
      - bench
      - worker
      - --queue
      - short
    volumes:
      - sites-vol:/home/frappe/frappe-bench/sites:rw
      - logs-vol:/home/frappe/frappe-bench/logs:rw
    networks:
      - frappe-network

  erpnext-worker-long:
    image: frappe/erpnext-worker:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
    deploy:
      restart_policy:
        condition: on-failure
    command:
      - bench
      - worker
      - --queue
      - long
    volumes:
      - sites-vol:/home/frappe/frappe-bench/sites:rw
    networks:
      - frappe-network

  frappe-schedule:
    image: frappe/erpnext-worker:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
    deploy:
      restart_policy:
        condition: on-failure
    command:
      - bench
      - schedule
    volumes:
      - sites-vol:/home/frappe/frappe-bench/sites:rw
      - logs-vol:/home/frappe/frappe-bench/logs:rw
    networks:
      - frappe-network

  # migrate:
  #   image: frappe/erpnext-worker:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
  #   deploy:
  #     restart_policy:
  #       condition: on-failure
  #   entrypoint: ["bash", "-c"]
  #   command: ["/opt/scripts/migrate.sh"]
  #   volumes:
  #     - sites-vol:/home/frappe/frappe-bench/sites:rw
  #     - logs-vol:/home/frappe/frappe-bench/logs:rw
  #   configs:
  #     - source: migration-script
  #       target: /opt/scripts/migrate.sh
  #       uid: '1000'
  #       gid: '1000'
  #       mode: 0550
  #   networks:
  #     - frappe-network

volumes:
  redis-cache-vol:
  redis-queue-vol:
  redis-socketio-vol:
  assets-vol:
  sites-vol:
  logs-vol:

networks:
  traefik-public:
    external: true
  frappe-network:
    external: true

# configs:
#   migration-script:
#     external: true
  • Changed version from v13.22.0 to v13.26.0
  • Create migration-script config and uncomment the migrate service and configs sections to enable auto migration on re-deployment.
1 Like

Hi Revant, and thanks for the help,

As I am trying the compat fork, as fresh installation, I wasn’t able to get it going,

TRAEFIK wasn’t able to communicate with erpnext-nginx container

"time="2022-04-15T11:57:06Z" level=error msg="service \"erpnext-nginx\" error: unable to find the IP address for the container \"/erp6_erpnext-nginx_1\": the server is ignored" providerName=docker container=erpnext-nginx-erp6-9b37c936562219c079dc43d68b20e28d7f755affe06f427d1ea61540efeba0f9"

so I checked the erpnext-nginx container, and it was not able to communicate with socketio containner

` /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration

/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/

/docker-entrypoint.sh: Launching /docker-entrypoint.d/frappe-entrypoint.sh

/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh

10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf

10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version

/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh

20-envsubst-on-templates.sh: Running envsubst on /etc/nginx/templates/default.conf.template to /etc/nginx/conf.d/default.conf

/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh

/docker-entrypoint.sh: Configuration complete; ready for start up

2022/04/15 12:07:43 [emerg] 1#1: host not found in upstream "frappe-socketio:9000" in /etc/nginx/conf.d/default.conf:6

nginx: [emerg] host not found in upstream "frappe-socketio:9000" in /etc/nginx/conf.d/default.conf:6 `

so i checked socketio container and found the below:

"listening on *: 3000 node:events:505 throw er; // Unhandled 'error' event ^ Error: connect ECONNREFUSED 127.0.0.1:12311 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) Emitted 'error' event on RedisClient instance at: at RedisClient.on_error (/home/frappe/frappe-bench/apps/frappe/node_modules/redis/index.js:342:14) at Socket.<anonymous> (/home/frappe/frappe-bench/apps/frappe/node_modules/redis/index.js:223:14) at Socket.emit (node:events:527:28) at emitErrorNT (node:internal/streams/destroy:164:8) at emitErrorCloseNT (node:internal/streams/destroy:129:3) at processTicksAndRejections (node:internal/process/task_queues:83:21) { errno: -111, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 12311 } Node.js v17.8.0

any ideas !

Thank you for this useful post, it will definitely help many of the community members here who made #docker-swarm installation using #portainer .

I noticed your changes mainly in erpnext-nginx environment
environment:
- BACKEND=erpnext-python:8000
- FRAPPE_SITE_NAME_HEADER=$$host
- SOCKETIO=frappe-socketio:9000
- UPSTREAM_REAL_IP_ADDRESS=127.0.0.1
- UPSTREAM_REAL_IP_HEADER=X-Forwarded-For
- UPSTREAM_REAL_IP_RECURSIVE=off
volumes:
- sites-vol:/usr/share/nginx/html/sites:rw
- assets-vol:/usr/share/nginx/html/assets:rw

and in erpnext-python you removed the environment:

environment:
  - MARIADB_HOST=${MARIADB_HOST?Variable MARIADB_HOST not set}
  - REDIS_CACHE=redis-cache:6379
  - REDIS_QUEUE=redis-queue:6379
  - REDIS_SOCKETIO=redis-socketio:6379
  - SOCKETIO_PORT=9000
  - AUTO_MIGRATE=1

In erpnext-worker-default you added to the command:

command:
- bench
- worker
- --queue
- default
In erpnext-worker-short you added to the command

command:
  - bench
  - worker
  - --queue
  - short

and same in erpnext-worker-long :

command:
  - bench
  - worker
  - --queue
  - long

in frappe-schedule you added in the command
command:
- bench
- schedule

Just wanted to highlight what I noticed.

Regarding the “migration” comment, does this means that every time I want to deploy a new feature which may contain reports or custom scripts or custom fields and wish to sync database then I will uncomment the migrate service (and the config section at the end) and “Update” the stack.

But, if I want to simply “upgrade” to a new version, I will just change the “ERPNEXT_VERSION” and “FRAPPE_VERSION” in the “Environment variables” section then run “Update” the stack.

In both option , we opt “Prune services”.

Please correct me if I’m wrong.

Again thank you so much :pray::pray::pray:

In this case uncomment the migrate service and related configs.

Whenever you update with version change, this service will run the migration and complete successfully.

Custom scripts, custom fields, custom reports have nothing to do with migration as long as we’re just adding them as custom entries in database and they are not part of any custom app.

1 Like

if you’re doing fresh installation don’t use compat. Use main branch : frappe_docker/docs/single-server-example.md at main · frappe/frappe_docker · GitHub

Hi Revant
Thank you so much for the advice, I went to clean installation and then manually restored the sites to the new installation with your valuable notes in here.
so happy to have fresh installation, since I went through most of the updates along the last year.

however i want to ask,
now i am receiving " Encryption key is invalid, Please check site_config.json " when i am trying to take a backup through the integration / S3 Screen, and whenever i request a report to be emailed.
i still have a backup of the old site_config.json files, shall update the new install configs with the encryption key from the backup ?!

another question is regarding the migrate flag, I didn’t do any migration during the restore process, is that Ok ? my old installation is v13.22.1

thanks again for your efforts

yes, copy the encryption_key from backup site config to in use site config.

you need to run migration for each site:

bench --site site.name migrate
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.