quay/mirror-registry

Failed to start PostgreSQL service

rchakode opened this issue · 8 comments

It looks like there is a regression in mirror-registry 1.3.1, it's failing while starting PostgreSQL service (see details below).

It works with version 1.2.9.

My initial investigations by diving into generated manifests suggest that the service file has been renamed quay-postgres.service while the play is expecting posgres.service.

TASK [mirror_appliance : Set permissions on local storage directory] *************************************************************

skipping: [redhat@vmwftx-tobast1]

TASK [mirror_appliance : Copy Postgres systemd service file] *********************************************************************

ok: [redhat@vmwftx-tobast1]

TASK [mirror_appliance : Check if Postgres image is loaded] **********************************************************************

changed: [redhat@vmwftx-tobast1]

TASK [mirror_appliance : Pull Postgres image] ************************************************************************************

skipping: [redhat@vmwftx-tobast1]

TASK [mirror_appliance : Create Postgres Storage named volume] *******************************************************************

ok: [redhat@vmwftx-tobast1]

TASK [mirror_appliance : Start Postgres service] *********************************************************************************
fatal: [redhat@vmwftx-tobast1]: FAILED! => {"changed": false, "msg": "failure 1 during daemon-reload: Failed to connect to bus: Aucun fichier ou dossier de ce type\n"}
dmage commented

Is it a fresh installation? How do you run ./mirror-registry and what parameters do you use?

A fresh install with the following parameters (all the referenced TLS resources are available)

./mirror-registry install  \
   --initPassword mypasswd    \
   --initUser quayadmin    \
   --quayHostname myhost.ocp-domain:5000    \
   --sslKey /home/redhat/.redhat/ocp-bastion-mirror/ssl/myhost.key   \
   --sslCert /home/redhat/.redhat/ocp-bastion-mirror/ssl/myhost.cert    \
   --quayRoot /data-ocp-registry -v

Edit: change -vvv with -v

dmage commented

You can try --additionalArgs="-vvv" to have a more verbose output from Ansible

The -vvv option is not the root cause. I know it's actually -v.
Even without the verbose option, the issue is reproducible.

The same command with mirror-registry 1.2.9 works.

dmage commented

Right, but we need to see what exactly doesn't work. We have tested both v1.3.0 and v1.3.1 and they work in our environments.

Check if systemctl --user status works. If it doesn't work, perhaps something is wrong with environment variables for D-Bus.

dmage commented

Also, do you run it as root or as a user?

I'm using a regular user, who is a sudoer.

systemctl --user status

● myhost
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Tue 2023-03-21 09:17:43 CET; 5h 35min ago
   CGroup: [/user.slice/user-1001.slice/user@1001.service](mailto:/user.slice/user-1001.slice/user@1001.service)
           └─init.scope
             ├─63714 /usr/lib/systemd/systemd --user
             └─63718 (sd-pam)

As additional details, I found that the command that fails is the following:

podman run --rm --interactive --tty --workdir /runner/project \
	--net host -v /home/redhat/ocp-bin/image-archive.tar:/runner/image-archive.tar \
	-v /home/redhat/.redhat/ocp-bastion-mirror/ssl/myhost.cert:/runner/certs/quay.cert:Z \
	-v /home/redhat/.redhat/ocp-bastion-mirror/ssl/myhost.key:/runner/certs/quay.key:Z \
	-v /home/redhat/.ssh/quay_installer:/runner/env/ssh_key \
	-e RUNNER_OMIT_EVENTS=False -e RUNNER_ONLY_FAILED_EVENTS=False -e ANSIBLE_HOST_KEY_CHECKING=False \
	-e ANSIBLE_CONFIG=/runner/project/ansible.cfg -e ANSIBLE_NOCOLOR=false --quiet --name ansible_runner_instance \
	quay.io/quay/mirror-registry-ee:latest \
	ansible-playbook -i redhat@myhost, --private-key /runner/env/ssh_key \
	-e "init_user=quayadmin init_password=Nvn4suU.BvlbuNf quay_image=registry.redhat.io/quay/quay-rhel8:v3.8.3 \
	quay_version=v3.8.3 redis_image=registry.redhat.io/rhel8/redis-6:1-92.1669834635 postgres_image=registry.redhat.io/rhel8/postgresql-10:1-203.1669834630 \
	pause_image=registry.access.redhat.com/ubi8/pause:8.7-6 \
	quay_hostname=myhost.mydomainn:5000 local_install=true quay_root=/data-ocp-registry \
	quay_storage=quay-storage pg_storage=pg-storage" install_mirror_appliance.yml