Please Help. Thanks in Advance.
Please note: we are using the GitHub - primeroIMS/primero: Primero is an application designed to help child protection workers and social workers in humanitarian and development contexts manage data on vulnerable children and survivors of violence. Please carefully read our LICENSE. If you would like access to the CPIMS+ and GBVIMS+ configurations, please contact: childprotectioninnovation@gmail.com [master branch]
Our DNS records are pointing to this Ubuntu server public IP. And if we install a webserver on the host itself, we were able to reach and was able to run lets encrypt to make it https. But for Primero communication to the docker instance is not happening. And we are getting Connection refused error.
When running the last command ansible-playbook certbot.yml.
Following documentation was referred for doing the install on the Ubuntu server 20.04
We are getting following errors:
PLAY [protect.kinshipunited.org] *****************************************************************************************************************************************************************************************************
TASK [Gathering Facts] ***************************************************************************************************************************************************************************************************************
ok: [protect.kinshipunited.org]
TASK [primero-certbot : create the /srv/primero/bin directory] ***********************************************************************************************************************************************************************
ok: [protect.kinshipunited.org]
TASK [primero-certbot : copy the certbot binary to /srv/primero/bin/certbot] *********************************************************************************************************************************************************
ok: [protect.kinshipunited.org]
TASK [primero-certbot : create the /srv/primero/bin/run-certbot.sh script] ***********************************************************************************************************************************************************
ok: [protect.kinshipunited.org]
TASK [primero-certbot : run certbot] *************************************************************************************************************************************************************************************************
fatal: [protect.kinshipunited.org]: FAILED! => changed=true
cmd:
- /srv/primero/bin/run-certbot.sh
delta: â0:00:04.039422â
end: â2023-03-01 21:15:07.741754â
msg: non-zero return code
rc: 1
start: â2023-03-01 21:15:03.702332â
stderr: |-- exec /srv/primero/bin/certbot -d protect.kinshipunited.org --cert-name primero -m @.org -p primero
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Performing the following challenges:
http-01 challenge for protect.kinshipunited.org
Using the webroot path /usr/share/nginx/html for all unmatched domains.
Waiting for verificationâŚ
Challenge failed for domain protect.kinshipunited.org
http-01 challenge for protect.kinshipunited.org
Cleaning up challenges
Some challenges have failed.
Traceback (most recent call last):
File â/srv/primero/bin/certbotâ, line 141, in
code = _main(sys.argv)
File â/srv/primero/bin/certbotâ, line 128, in _main
_check_call(command)
File â/srv/primero/bin/certbotâ, line 26, in _check_call
subprocess.check_call(args, *popenargs, **kwargs)
File â/usr/lib/python3.8/subprocess.pyâ, line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command â[âdockerâ, ârunâ, âârmâ, ââinteractiveâ, ââvolumeâ, âprimero_certbot_certificates:/etc/letsencryptâ, ââvolumeâ, âprimero_certbot_challenges:/usr/share/nginx/html/.well-known/acme-challengeâ, ââvolumeâ, â/tmp/tmpruuwzzdp:/tmp/deploy-hook-dirâ, âcertbot/certbot:v1.11.0â, âcertonlyâ, âânon-interactiveâ, ââdomainâ, âprotect.kinshipunited.orgâ, ââcert-nameâ, âprimeroâ, ââemailâ, â@.orgâ, ââagree-tosâ, âârsa-key-sizeâ, â2048â, ââdeploy-hookâ, âtouch /tmp/deploy-hook-dir/renewed && chmod a+r -R /etc/letsencrypt/live && chmod a+r -R /etc/letsencrypt/archiveâ, ââwebrootâ, ââwebroot-pathâ, â/usr/share/nginx/htmlâ]â returned non-zero exit status 1.
stderr_lines:
stdout: |-
Requesting a certificate for protect.kinshipunited.org
IMPORTANT NOTES:
-
The following errors were reported by the server:
Domain: protect.kinshipunited.org
Type: connection
Detail: 44.213.232.134: Fetching
http://protect.kinshipunited.org/.well-known/acme-challenge/jKdGBJqIKQcvT6KHg-qs9VMMg3_B6ytfP1ipKWAwT1E:
Error getting validation dataTo fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address. Additionally, please check that
your computer has a publicly routable IP address and that no
firewalls are preventing the server from communicating with the
client. If youâre using the webroot plugin, you should also verify
that you are serving files from the webroot path you provided.
- docker run --rm --interactive --volume primero_certbot_certificates:/etc/letsencrypt --volume primero_certbot_challenges:/usr/share/nginx/html/.well-known/acme-challenge --volume /tmp/tmpruuwzzdp:/tmp/deploy-hook-dir certbot/certbot:v1.11.0 certonly --non-interactive --domain protect.kinshipunited.org --cert-name primero --email @.org --agree-tos --rsa-key-size 2048 --deploy-hook âtouch /tmp/deploy-hook-dir/renewed && chmod a+r -R /etc/letsencrypt/live && chmod a+r -R /etc/letsencrypt/archiveâ --webroot --webroot-path /usr/share/nginx/html
stdout_lines:
- exec /srv/primero/bin/certbot -d protect.kinshipunited.org --cert-name primero -m @.org -p primero
PLAY RECAP ***************************************************************************************************************************************************************************************************************************
protect.kinshipunited.org : ok=4 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
providing config details:
/primero/ansible/inventory/inventory.yml
all:
hosts:
protect.kinshipunited.org:
ansible_user: âkinshipâ
primero_host: âprotect.kinshipunited.orgâ
primero_tag: âlatestâ
As of Primero v2.5, the default Docker deployed PostgreSQL is 10.22.
If you want to run Primero with a different version of PostgreSQL,
set primero_postgres_version to either â11â or â14â.
NOTE: YOU NEED TO PERFORM A DATA MIGRATION BEFORE CHANGING POSTGRES VERSIONS!!!
primero_postgres_version: â14â
locale_all: âen,fr,arâ
always_pull: true,
These 3 variables are used to drive the build task.
Can be omitted if pulling images from Dockerhub
primero_repo_branch: âmasterâ
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: âmasterâ
primero_configuration_path: âdirectory/of/config/loader/scriptâ
use_lets_encrypt: âtrueâ
use_external_certs: âfalseâ
The other certbot/lets_encrypt variables are optional. Include only if using Letâs Encrypt
certbot_domain:
- â{{ primero_host }}â
certbot_email: âremoved@actual-domain-removedâ
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â
nginx_ssl_cert_path: â/home/kinship/my-external-certs/kust.crtâ
nginx_ssl_key_path: â/home/kinship/my-external-certs/kupr.keyâ
Optionally parametrize Primero containers with other environment attributes.
Do not use this dictionary for secrets!!!
environment_variables:
PRIMERO_DEFAULT_USERS: âtrueâ # Seed default users when using the managed Primero SaaS configs
LOCALE_DEFAULT: âarâ # Optionally override English as the default locale.
/primero/ansible/secrets.yml
primero_secret_key_base: â---------dummy-value01-----------â
primero_message_secret: â---------dummy-value02-----------â
postgres_password: â---------dummy-value03-----------â
devise_secret_key: â---------dummy-value04-----------â
devise_jwt_secret_key: â---------dummy-value05-----------â