mirror-registry icon indicating copy to clipboard operation
mirror-registry copied to clipboard

Failed to start PostgreSQL service

Open rchakode opened this issue 1 year ago • 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"}

rchakode avatar Mar 20 '23 16:03 rchakode

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

dmage avatar Mar 21 '23 08:03 dmage

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

rchakode avatar Mar 21 '23 08:03 rchakode

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

dmage avatar Mar 21 '23 13:03 dmage

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

rchakode avatar Mar 21 '23 13:03 rchakode

The same command with mirror-registry 1.2.9 works.

rchakode avatar Mar 21 '23 13:03 rchakode

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 avatar Mar 21 '23 13:03 dmage

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

dmage avatar Mar 21 '23 13:03 dmage

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/[email protected]](mailto:/user.slice/user-1001.slice/[email protected])
           └─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

rchakode avatar Mar 21 '23 14:03 rchakode