Primero selfhosting deployment failed

Hi. we are trying to deploy Primero locally and encounter error when run ansible-playbook application-primero.yml --tags configure,start -i inventory/inventory.yml -l demo.ai4ertong.cn . Appreciate if anyone can help on this. thanks, Jim

(venv) ubuntu@VM-16-14-ubuntu:~/primero/ansible$ ansible-playbook bootstrap.yml -i inventory/inventory.yml -l demo.ai4ertong.cn
[WARNING]: Could not match supplied host pattern, ignoring: vpc
[WARNING]: Could not match supplied host pattern, ignoring: first_run

PLAY [!vpc:!first_run] ******************************************************************************************************************

TASK [quoin.infrastructure.install_python3 : install Python version 3] ******************************************************************
changed: [demo.ai4ertong.cn]

PLAY [all:!first_run] *******************************************************************************************************************

TASK [Gathering Facts] ******************************************************************************************************************
ok: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.install_sudo : install sudo] *********************************************************************************
ok: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.become_no_password : include_tasks] **************************************************************************
included: /home/ubuntu/primero/ansible/ansible_collections/quoin/infrastructure/roles/become_no_password/tasks/family-debian.yml for demo.ai4ertong.cn

TASK [quoin.infrastructure.become_no_password : Debian :: add ubuntu to the sudo group] *************************************************
ok: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.become_no_password : Debian :: disable the password requirement for sudo] ************************************
ok: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.become_no_password : include_tasks] **************************************************************************
skipping: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.become_no_password : include_tasks] **************************************************************************
skipping: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.openssh_passwordauthentication_no : disable PasswordAuthentication] ******************************************
ok: [demo.ai4ertong.cn]

PLAY RECAP ******************************************************************************************************************************
demo.ai4ertong.cn : ok=7 changed=1 unreachable=0 failed=0 skipped=2 rescued=0 ignored=0

(venv) ubuntu@VM-16-14-ubuntu:~/primero/ansible$ ansible-playbook install-docker.yml -i inventory/inventory.yml -l demo.ai4ertong.cn

PLAY [all] ******************************************************************************************************************************

TASK [Gathering Facts] ******************************************************************************************************************
ok: [demo.ai4ertong.cn]

TASK [manage-users : Ensure group primero exists] ***************************************************************************************
ok: [demo.ai4ertong.cn]

TASK [manage-users : create application container user] *********************************************************************************
ok: [demo.ai4ertong.cn]

TASK [manage-users : Ensure group nginx exists] *****************************************************************************************
ok: [demo.ai4ertong.cn]

TASK [manage-users : create nginx container user] ***************************************************************************************
ok: [demo.ai4ertong.cn]

TASK [manage-users : Remove primero from /etc/subuid] ***********************************************************************************
changed: [demo.ai4ertong.cn]

TASK [manage-users : Remove primero from /etc/subgid] ***********************************************************************************
changed: [demo.ai4ertong.cn]

TASK [manage-users : edit /etc/subuid for primero user mapping for docker containers] ***************************************************
changed: [demo.ai4ertong.cn]

TASK [manage-users : edit /etc/subuid for primero user mapping for docker containers] ***************************************************
changed: [demo.ai4ertong.cn]

TASK [manage-users : edit /etc/subgid for primero user mapping for docker containers] ***************************************************
changed: [demo.ai4ertong.cn]

TASK [manage-users : edit /etc/subgid for primero user mapping for docker containers] ***************************************************
changed: [demo.ai4ertong.cn]

TASK [manage-users : Adding existing ansible user ubuntu to application group] **********************************************************
ok: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.configure_journald : Create journal directory] ***************************************************************
skipping: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.configure_journald : Set journal directory permissions] ******************************************************
skipping: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.install_python3_virtualenv : include_tasks] ******************************************************************
included: /home/ubuntu/primero/ansible/ansible_collections/quoin/infrastructure/roles/install_python3_virtualenv/tasks/family-debian.yml for demo.ai4ertong.cn

TASK [quoin.infrastructure.install_python3_virtualenv : Debian :: install Python 3 virtualenv] ******************************************
ok: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.install_python3_virtualenv : include_tasks] ******************************************************************
skipping: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.install_python3_docker : create and upgrade the Docker virtualenv] *******************************************
ok: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.install_python3_docker : install pip names into the Docker virtualenv] ***************************************
changed: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.install_python3_docker_compose : install the docker-compose package] *****************************************
changed: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.install_docker : include_tasks] ******************************************************************************
skipping: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.install_docker : include_tasks] ******************************************************************************
skipping: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.install_docker : include_tasks] ******************************************************************************
included: /home/ubuntu/primero/ansible/ansible_collections/quoin/infrastructure/roles/install_docker/tasks/distribution-ubuntu.yml for demo.ai4ertong.cn

TASK [quoin.infrastructure.install_docker : Ubuntu :: install apt-transport-https and ca-certificates] **********************************
ok: [demo.ai4ertong.cn] => (item=apt-transport-https)
ok: [demo.ai4ertong.cn] => (item=ca-certificates)

TASK [quoin.infrastructure.install_docker : Ubuntu :: install Docker APT key] ***********************************************************
ok: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.install_docker : Ubuntu :: install Docker APT repository] ****************************************************
ok: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.install_docker : install Docker] *****************************************************************************
ok: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.install_docker : create the /etc/docker directory] *********************************************************
ok: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.install_docker : create the /etc/docker/daemon.json file] ****************************************************
ok: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.install_docker : meta] ***************************************************************************************

TASK [quoin.infrastructure.install_docker : start Docker] *******************************************************************************
ok: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.install_docker : add ubuntu to the docker group] *********************************************************
ok: [demo.ai4ertong.cn]

TASK [quoin.infrastructure.install_docker : meta] ***************************************************************************************

PLAY RECAP ******************************************************************************************************************************
(venv) ubuntu@VM-16-14-ubuntu:~/primero/ansible$ ansible-playbook application-primero.yml --tags “build” -i inventory/inventory.yml -l demo.ai4ertong.cn

PLAY [all:localhost] ********************************************************************************************************************************************

TASK [Gathering Facts] ******************************************************************************************************************************************
ok: [demo.ai4ertong.cn]

TASK [application-primero : Copy Primero deployment private SSH key to remote host] *****************************************************************************
skipping: [demo.ai4ertong.cn]

TASK [application-primero : Checking for external certs on remote machine] **************************************************************************************
ok: [demo.ai4ertong.cn]

TASK [application-primero : Checking for external certs (key) on remote machine] ********************************************************************************
ok: [demo.ai4ertong.cn]

TASK [application-primero : Fail if no external certs on remote machine] ****************************************************************************************
skipping: [demo.ai4ertong.cn]

TASK [application-primero : Change primero folder owner] ********************************************************************************************************
changed: [demo.ai4ertong.cn]

TASK [application-primero : Pull Primero from Git] **************************************************************************************************************
ok: [demo.ai4ertong.cn]

TASK [application-primero : Change primero folder owner] ********************************************************************************************************
changed: [demo.ai4ertong.cn]

TASK [application-primero : build the Docker containers] ********************************************************************************************************
changed: [demo.ai4ertong.cn]

PLAY RECAP ******************************************************************************************************************************************************
demo.ai4ertong.cn : ok=7 changed=3 unreachable=0 failed=0 skipped=2 rescued=0 ignored=0

(venv) ubuntu@VM-16-14-ubuntu:~/primero/ansible$ ansible-playbook application-primero.yml --tags configure,start -i inventory/inventory.yml -l demo.ai4ertong.cn

PLAY [all:localhost] ********************************************************************************************************************************************

TASK [Gathering Facts] ******************************************************************************************************************************************
ok: [demo.ai4ertong.cn]

TASK [application-primero : Copy Primero deployment private SSH key to remote host] *****************************************************************************
skipping: [demo.ai4ertong.cn]

TASK [application-primero : Checking for external certs on remote machine] **************************************************************************************
ok: [demo.ai4ertong.cn]

TASK [application-primero : Checking for external certs (key) on remote machine] ********************************************************************************
ok: [demo.ai4ertong.cn]

TASK [application-primero : Fail if no external certs on remote machine] ****************************************************************************************
skipping: [demo.ai4ertong.cn]

TASK [application-primero : Change primero folder owner] ********************************************************************************************************
changed: [demo.ai4ertong.cn]

TASK [application-primero : Pull Primero from Git] **************************************************************************************************************
ok: [demo.ai4ertong.cn]

TASK [application-primero : Change primero folder owner] ********************************************************************************************************
changed: [demo.ai4ertong.cn]

TASK [application-primero : Pull Primero configuration from Git] ************************************************************************************************
skipping: [demo.ai4ertong.cn]

TASK [application-primero : configure Primero with a custom configuration] **************************************************************************************
changed: [demo.ai4ertong.cn]

TASK [application-primero : configure Primero with the default seeds] *******************************************************************************************
skipping: [demo.ai4ertong.cn]

TASK [application-primero : Pull docker images] *****************************************************************************************************************
skipping: [demo.ai4ertong.cn]

TASK [application-primero : (re)start the Docker containers] ****************************************************************************************************
fatal: [demo.ai4ertong.cn]: FAILED! => changed=true
cmd:

  • ./compose.prod.sh

  • up

  • -d

  • –force-recreate

  • –no-build
    delta: ‘0:00:02.484909’
    end: ‘2024-03-29 20:30:51.126920’
    msg: non-zero return code
    rc: 1
    start: ‘2024-03-29 20:30:48.642011’
    stderr: |-

    • [[ false == \f\a\l\s\e ]]
    • exec ./compose.sh -f docker-compose.prod.yml -f docker-compose.db.yml up -d --force-recreate --no-build
    • exec docker-compose -p primero --project-directory …/ -f docker-compose.yml -f docker-compose.prod.yml -f docker-compose.db.yml up -d --force-recreate --no-build
      Recreating 710ceb54cab4_primero_solr_1 …
      Recreating 787abaf99532_primero_postgres_1 …

    ERROR: for 787abaf99532_primero_postgres_1 ‘ContainerConfig’

    ERROR: for 710ceb54cab4_primero_solr_1 ‘ContainerConfig’

    ERROR: for postgres ‘ContainerConfig’

    ERROR: for solr ‘ContainerConfig’
    Traceback (most recent call last):
    File “/opt/docker/bin//docker-compose”, line 8, in
    sys.exit(main())
    File “/opt/docker/lib/python3.8/site-packages/compose/cli/main.py”, line 81, in main
    command_func()
    File “/opt/docker/lib/python3.8/site-packages/compose/cli/main.py”, line 203, in perform_command
    handler(command, command_options)
    File “/opt/docker/lib/python3.8/site-packages/compose/metrics/decorator.py”, line 18, in wrapper
    result = fn(*args, **kwargs)
    File “/opt/docker/lib/python3.8/site-packages/compose/cli/main.py”, line 1186, in up
    to_attach = up(False)
    File “/opt/docker/lib/python3.8/site-packages/compose/cli/main.py”, line 1166, in up
    return self.project.up(
    File “/opt/docker/lib/python3.8/site-packages/compose/project.py”, line 697, in up
    results, errors = parallel.parallel_execute(
    File “/opt/docker/lib/python3.8/site-packages/compose/parallel.py”, line 108, in parallel_execute
    raise error_to_reraise
    File “/opt/docker/lib/python3.8/site-packages/compose/parallel.py”, line 206, in producer
    result = func(obj)
    File “/opt/docker/lib/python3.8/site-packages/compose/project.py”, line 679, in do
    return service.execute_convergence_plan(
    File “/opt/docker/lib/python3.8/site-packages/compose/service.py”, line 579, in execute_convergence_plan
    return self._execute_convergence_recreate(
    File “/opt/docker/lib/python3.8/site-packages/compose/service.py”, line 499, in _execute_convergence_recreate
    containers, errors = parallel_execute(
    File “/opt/docker/lib/python3.8/site-packages/compose/parallel.py”, line 108, in parallel_execute
    raise error_to_reraise
    File “/opt/docker/lib/python3.8/site-packages/compose/parallel.py”, line 206, in producer
    result = func(obj)
    File “/opt/docker/lib/python3.8/site-packages/compose/service.py”, line 494, in recreate
    return self.recreate_container(
    File “/opt/docker/lib/python3.8/site-packages/compose/service.py”, line 612, in recreate_container
    new_container = self.create_container(
    File “/opt/docker/lib/python3.8/site-packages/compose/service.py”, line 330, in create_container
    container_options = self._get_container_create_options(
    File “/opt/docker/lib/python3.8/site-packages/compose/service.py”, line 921, in _get_container_create_options
    container_options, override_options = self._build_container_volume_options(
    File “/opt/docker/lib/python3.8/site-packages/compose/service.py”, line 960, in _build_container_volume_options
    binds, affinity = merge_volume_bindings(
    File “/opt/docker/lib/python3.8/site-packages/compose/service.py”, line 1548, in merge_volume_bindings
    old_volumes, old_mounts = get_container_data_volumes(
    File “/opt/docker/lib/python3.8/site-packages/compose/service.py”, line 1579, in get_container_data_volumes
    container.image_config[‘ContainerConfig’].get(‘Volumes’) or {}
    KeyError: ‘ContainerConfig’
    stderr_lines:
    stdout: |-
    allexport off
    braceexpand on
    emacs off
    errexit on
    errtrace off
    functrace off
    hashall on
    histexpand off
    history off
    ignoreeof off
    interactive-comments on
    keyword off
    monitor off
    noclobber off
    noexec off
    noglob off
    nolog off
    notify off
    nounset on
    onecmd off
    physical off
    pipefail off
    posix off
    privileged off
    verbose off
    vi off
    xtrace off
    Current option settings
    errexit on
    noglob off
    ignoreeof off
    interactive off
    monitor off
    noexec off
    stdin off
    xtrace off
    verbose off
    vi off
    emacs off
    noclobber off
    allexport off
    notify off
    nounset on
    priv off
    nolog off
    debug off
    stdout_lines:

PLAY RECAP ******************************************************************************************************************************************************
demo.ai4ertong.cn : ok=7 changed=3 unreachable=0 failed=1 skipped=5 rescued=0 ignored=0

the inventory.yml in development machine at below:

---
all:
  hosts:
    demo.ai4ertong.cn:
      ansible_user: 'ubuntu'
      primero_host: 'demo.ai4ertong.cn'
      locale_all: 'en,cmn'
      primero_tag: 'v2.10.1'
      primero_postgres_version: '15'

      # These 3 variables are used to drive the build task.
      # Can be omitted if pulling images from Dockerhub
      primero_repo: 'https://github.com/primeroIMS/primero.git'
      primero_repo_branch: 'v2.10.1'
      build_docker_tag: 'latest'
      build_docker_container_registry: ''
      # If you want to seed from a private configuration repo
      #primero_configuration_repo: 'git@bitbucket.org:quoin/primero-x-configuration.git'
      #primero_configuration_repo_branch: 'main'
      primero_configuration_path: ''
      use_lets_encrypt: 'false'
      use_external_certs: 'true'
      nginx_ssl_cert_path: '/external-certs/primero.crt'
      nginx_ssl_key_path: '/external-certs/primero.key'
      # The other certbot/lets_encrypt variables are optional. Include only if using Let's Encrypt
      ##certbot_domain:
      ##- '{{ primero_host }}'
      ##certbot_email: 'kanli@unicef.org'
      ##lets_encrypt_domain: '{{ primero_host }}'
      ##lets_encrypt_email: '{{ certbot_email }}'
      # Different for self-signed certs
      ##nginx_ssl_cert_path: '/etc/letsencrypt/live/primero/fullchain.pem'
      ##nginx_ssl_key_path: '/etc/letsencrypt/live/primero/privkey.pem'
      


      # Optionally parametrize Primero containers with other environment attributes.
      # Do not use this dictionary for secrets!!!
      environment_variables:
        #RUN_DEFAULT_PRIMERO_SEEDS: 'true' # Set to true if you want to run default seeds
        PRIMERO_DEFAULT_USERS: 'true' # Seed default users when using the managed Primero SaaS configs
        LOCALE_DEFAULT: 'en' # Optionally override English as the default locale.
        PRIMERO_CODE_OF_CONDUCT: 'true'
        PRIMERO_ONBOARDING_ADMIN_EMAIL: 'kanli@unicef.org'
        PRIMERO_ONBOARDING_ADMIN_AGENCY_CODE: 'UN'
        #PRIMERO_WEBPUSH: 'true'
        #PRIMERO_WEBPUSH_CONTACT: 'kanli@unicef.org'
        #PRIMERO_PROMOTE_CONFIG_PROD_HOST: "www.ai4ertong.cn"

but when i run the command

(venv) ubuntu@VM-16-14-ubuntu:~/primero/ansible$ ansible-playbook application-primero.yml 
--tags build,configure,start -i inventory/inventory.yml -l demo.ai4ertong.cn

i found the problem at below.

fatal: [demo.ai4ertong.cn]: FAILED! => changed=true 
  cmd:
  - ./compose.prod.sh
  - up
  - -d
  - --force-recreate
  - --no-build
  delta: '0:00:02.296790'
  end: '2024-03-29 14:31:46.150464'
  invocation:
    module_args:
      _raw_params: |-
        ./compose.prod.sh up -d --force-recreate --no-build
      _uses_shell: false
      argv: null
      chdir: /srv/primero/docker
      creates: null
      executable: null
      removes: null
      stdin: null
      stdin_add_newline: true
      strip_empty_ends: true
  msg: non-zero return code
  rc: 1
  start: '2024-03-29 14:31:43.853674'
  stderr: |-
    + [[ false == \f\a\l\s\e ]]
    + exec ./compose.sh -f docker-compose.prod.yml -f docker-compose.db.yml up -d --force-recreate --no-build
    + exec docker-compose -p primero --project-directory ../ -f docker-compose.yml -f docker-compose.prod.yml -f docker-compose.db.yml up -d --force-recreate --no-build
    Recreating f6492d21f564_primero_solr_1 ...
    Recreating a17eb1aeb08b_primero_postgres_1 ...
    ERROR: for a17eb1aeb08b_primero_postgres_1  'ContainerConfig'
    ERROR: for f6492d21f564_primero_solr_1  'ContainerConfig'
    ERROR: for postgres  'ContainerConfig'
    ERROR: for solr  'ContainerConfig'
    Traceback (most recent call last):
      File "/opt/docker/bin//docker-compose", line 8, in <module>
        sys.exit(main())
      File "/opt/docker/lib/python3.8/site-packages/compose/cli/main.py", line 81, in main
        command_func()
      File "/opt/docker/lib/python3.8/site-packages/compose/cli/main.py", line 203, in perform_command
        handler(command, command_options)
      File "/opt/docker/lib/python3.8/site-packages/compose/metrics/decorator.py", line 18, in wrapper
        result = fn(*args, **kwargs)
      File "/opt/docker/lib/python3.8/site-packages/compose/cli/main.py", line 1186, in up
        to_attach = up(False)
      File "/opt/docker/lib/python3.8/site-packages/compose/cli/main.py", line 1166, in up
        return self.project.up(
      File "/opt/docker/lib/python3.8/site-packages/compose/project.py", line 697, in up
        results, errors = parallel.parallel_execute(
      File "/opt/docker/lib/python3.8/site-packages/compose/parallel.py", line 108, in parallel_execute
        raise error_to_reraise
      File "/opt/docker/lib/python3.8/site-packages/compose/parallel.py", line 206, in producer
        result = func(obj)
      File "/opt/docker/lib/python3.8/site-packages/compose/project.py", line 679, in do
        return service.execute_convergence_plan(
      File "/opt/docker/lib/python3.8/site-packages/compose/service.py", line 579, in execute_convergence_plan
        return self._execute_convergence_recreate(
      File "/opt/docker/lib/python3.8/site-packages/compose/service.py", line 499, in _execute_convergence_recreate
        containers, errors = parallel_execute(
      File "/opt/docker/lib/python3.8/site-packages/compose/parallel.py", line 108, in parallel_execute
        raise error_to_reraise
      File "/opt/docker/lib/python3.8/site-packages/compose/parallel.py", line 206, in producer
        result = func(obj)
      File "/opt/docker/lib/python3.8/site-packages/compose/service.py", line 494, in recreate
        return self.recreate_container(
      File "/opt/docker/lib/python3.8/site-packages/compose/service.py", line 612, in recreate_container
        new_container = self.create_container(
      File "/opt/docker/lib/python3.8/site-packages/compose/service.py", line 330, in create_container
        container_options = self._get_container_create_options(
      File "/opt/docker/lib/python3.8/site-packages/compose/service.py", line 921, in _get_container_create_options
        container_options, override_options = self._build_container_volume_options(
      File "/opt/docker/lib/python3.8/site-packages/compose/service.py", line 960, in _build_container_volume_options
        binds, affinity = merge_volume_bindings(
      File "/opt/docker/lib/python3.8/site-packages/compose/service.py", line 1548, in merge_volume_bindings
        old_volumes, old_mounts = get_container_data_volumes(
      File "/opt/docker/lib/python3.8/site-packages/compose/service.py", line 1579, in get_container_data_volumes
        container.image_config['ContainerConfig'].get('Volumes') or {}
    KeyError: 'ContainerConfig'
  stderr_lines: <omitted>
  stdout: |-
    allexport       off
    braceexpand     on
    emacs           off
    errexit         on
    errtrace        off
    functrace       off
    hashall         on
    histexpand      off
    history         off
    ignoreeof       off
    interactive-comments    on
    keyword         off
    monitor         off
    noclobber       off
    noexec          off
    noglob          off
    nolog           off
    notify          off
    nounset         on
    onecmd          off
    physical        off
    pipefail        off
    posix           off
    privileged      off
    verbose         off
    vi              off
    xtrace          off
    Current option settings
    errexit         on
    noglob          off
    ignoreeof       off
    interactive     off
    monitor         off
    noexec          off
    stdin           off
    xtrace          off
    verbose         off
    vi              off
    emacs           off
    noclobber       off
    allexport       off
    notify          off
    nounset         on
    priv            off
    nolog           off
    debug           off
  stdout_lines: <omitted>
 
PLAY RECAP ********************************************************************************
demo.ai4ertong.cn          : ok=7    changed=3    unreachable=0    failed=1    skipped=2    rescued=0    ignored=0

and my local.env and default.env in my target machine at below:


1.local.env

PRIMERO_HOST=demo.ai4ertong.cn
PRIMERO_SECRET_KEY_BASE=UJLuArPOtlVLVUuJ9BuYSvWGIfbYtK5i
PRIMERO_MESSAGE_SECRET=wBPXuLcJjMSEzJfGca0nOh8yRiWy9pL8
POSTGRES_PASSWORD=oShwyULmws4OW9nJ7aBplFRnf0KWSEwv
DEVISE_SECRET_KEY=WuBWqRF8mgwIk9aOwIgYXs1xSPGVW2jY
DEVISE_JWT_SECRET_KEY=jS90qwCTrNwmIU6zYojKXe3bN5W6EV3H
LOCALE_ALL=en,cmn
LOCALE_DEFAULT=en
NGINX_SERVER_NAME=demo.ai4ertong.cn
NGINX_CERTIFICATE_NAME=primero
NGINX_SSL_CERT_PATH=/external-certs/primero.crt
NGINX_SSL_KEY_PATH=/external-certs/primero.key
USE_LETS_ENCRYPT=false
USE_EXTERNAL_CERTS=true
PRIMERO_DEFAULT_USERS=true
LOCALE_DEFAULT=en
PRIMERO_CODE_OF_CONDUCT=true
PRIMERO_WEBPUSH=true
PRIMERO_WEBPUSH_CONTACT=kanli@unicef.org

2.default.env

#!/bin/sh
# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# NOTE: all spaces must be escaped with backslash...also...you can't use quotes
# This needs to be 'posix compliant'

# TODO: have a single host variable
# shellcheck disable=SC2034

APP_ROOT=/srv/primero/application
APP_SHARE_DIR=/share/public
APP_SHARE_BUILD_ID_PATH=/share/public/build-id
LOCKFILE_PATH=/share/public/prim-lockfile
# NGINX_SSL_CLIENT_CA=/etc/cacert
# These paths are only used if USE_LETS_ENCRYPT = false

LOCALE_ALL=en,fr,ar
LOCALE_DEFAULT=en

NGINX_CLIENT_BODY_BUFFER_SIZE=256k
NGINX_CLIENT_MAX_BODY_SIZE=50M
NGINX_CURRENT_PATH=/srv/primero/application
NGINX_DH_PARAM=/certs/dhparam.pem
NGINX_HTTPS_PORT=443
NGINX_HTTP_PORT=80
NGINX_KEEPALIVE_TIMEOUT=60
NGINX_LOG_ACCESS=access.log
NGINX_LOG_DIR=/var/log/nginx
NGINX_LOG_ERROR=error.log
NGINX_PROXY_PASS_URL=http://application:3000
NGINX_SERVER_HOST=localhost
NGINX_SERVER_NAME=localhost
NGINX_SSL_CERT_PATH=/certs/cert.pem
NGINX_SSL_KEY_PATH=/certs/key.pem
NGINX_TIMER_RESOLUTION=500ms
NGINX_WORKER_CONNECTIONS=1536
NGINX_WORKER_PRIORITY=-10
NGINX_WORKER_PROCESSES=auto
NGINX_WORKER_RLIMIT_NOFILE=1536
NGINX_CERTIFICATE_NAME=primero

APP_UID=1000
APP_GID=1000
NGINX_UID=1001
NGINX_GID=1001

POSTGRES_DATABASE=primero_production
POSTGRES_HOSTNAME=postgres
POSTGRES_POOL_NUM=10
POSTGRES_USER=primero
POSTGRES_SSL_MODE=prefer

PROXY_CONNECT_TIMEOUT=30m
PROXY_READ_TIMEOUT=30m
PROXY_SEND_TIMEOUT=30m

RAILS_ENV=production
RAILS_LOG_PATH=/srv/primero/application/log/primero
RAILS_PUBLIC_FILE_SERVER=false

PRIMERO_CONFIGURATION_RUN_SCRIPTS=true

SOLR_HEAP_MEMORY=512m
SOLR_HOSTNAME=solr
SOLR_LOGS_DIR=/var/solr/logs
SOLR_LOG_LEVEL=ERROR
SOLR_PORT=8983
SOLR_AUTO_COMMIT_AFTER_REQUEST=true

PRIMERO_WORKER_MULTIPROCESS=false

USE_LETS_ENCRYPT=false
LOG_TO_STDOUT=true

Even though I re-executed the playbook script after removing docker containers, images, and volumes, I still ran into the same issues in

(venv) ubuntu@VM-16-14-ubuntu:~/primero/ansible$ ansible-playbook application-primero.yml --tags start -i inventory/inventory.yml -l demo.ai4ertong.cn

If you need me to provide you with other documents and their contents, please feel free to let me know.
Appreciate if anyone can help on this. Thx!

Just guessing but maybe this is the v1 docker syntax in this file
Try changing the line
exec docker-compose -p "${PROJECT_NAME}" --project-directory "../" -f "docker-compose.yml" "${@}"

to

exec docker compose -p "${PROJECT_NAME}" --project-directory "../" -f "docker-compose.yml" "${@}"

I have tried to change the line at my production machine

image

but same error at terminal of my development machine.
and after I retyped the command

(venv) ubuntu@VM-16-14-ubuntu:~/primero/ansible$ ansible-playbook application-primero.yml --tags start -i inventory/inventory.yml -l staging.ai4ertong.cn

this line reverts back to

exec docker-compose -p "${PROJECT_NAME}" --project-directory "../" -f "docker-compose.yml" "${@}"```

Maybe you should try to set up a local development environment to see if that builds the docker images correctly.

Try again now…this was fixed here Merged in docker-compose-v2 (pull request #6738) · primeroIMS/primero@e86d55e · GitHub