6장. Troubleshooting Red Hat Quay components
To troubleshoot specific {product-title} components and resolve component-related issues, you can use the procedures in this document. You can also run in debug mode, obtain logs and config, perform health checks, then search the Red Hat Knowledgebase or file a support ticket.
By using the following procedures, you are able to troubleshoot common component issues. Afterwards, you can search for solutions on the Red Hat Knowledgebase or file a support ticket with the Red Hat Support team.
6.1. Troubleshooting the Red Hat Quay database 링크 복사링크가 클립보드에 복사되었습니다!
To troubleshoot the {product-title} database and resolve connectivity, configuration, or resource issues, you can check deployment type, pod or container status, logs, connectivity, and configuration. You can also examine resource allocation and interact with the PostgreSQL database.
- Image Metadata. The database stores metadata associated with container images, such as image names, versions, creation timestamps, and the user or organization that owns the image. This information allows for easy identification and organization of container images within the registry.
- Image Tags. Red Hat Quay allows users to assign tags to container images, enabling convenient labeling and versioning. The PostgreSQL database maintains the mapping between image tags and their corresponding image manifests, allowing users to retrieve specific versions of container images based on the provided tags.
- Image Layers. Container images are composed of multiple layers, which are stored as individual objects. The database records information about these layers, including their order, checksums, and sizes. This data is crucial for efficient storage and retrieval of container images.
- User and Organization Data. Red Hat Quay supports user and organization management, allowing users to authenticate and manage access to container images. The PostgreSQL database stores user and organization information, including usernames, email addresses, authentication tokens, and access permissions.
- Repository Information. Red Hat Quay organizes container images into repositories, which act as logical units for grouping related images. The database maintains repository data, including names, descriptions, visibility settings, and access control information, enabling users to manage and share their repositories effectively.
- Event Logs. Red Hat Quay tracks various events and activities related to image management and repository operations. These event logs, including image pushes, pulls, deletions, and repository modifications, are stored in the PostgreSQL database, providing an audit trail and allowing administrators to monitor and analyze system activities.
The content in this section covers the following procedures:
- Checking the type of deployment: Determine if the database is deployed as a container on a virtual machine or as a pod on OpenShift Container Platform.
-
Checking the container or pod status: Verify the status of the
databasepod or container using specific commands based on the deployment type. - Examining the database container or pod logs: Access and examine the logs of the database pod or container, including commands for different deployment types.
-
Checking the connectivity between Red Hat Quay and the database pod: Check the connectivity between Red Hat Quay and the
databasepod using relevant commands. - Checking the database configuration: Check the database configuration at various levels (OpenShift Container Platform or PostgreSQL level) based on the deployment type.
- Checking resource allocation: Monitor resource allocation for the Red Hat Quay deployment, including disk usage and other resource usage.
- Interacting with the Red Hat Quay database: Learn how to interact with the PostgreSQL database, including commands to access and query databases.
6.1.1. Troubleshooting Red Hat Quay database issues 링크 복사링크가 클립보드에 복사되었습니다!
To troubleshoot Red Hat Quay database issues and resolve common errors like database connection refused or authentication failed, you can check the database logs, verify credentials, and ensure the database is running.
6.1.2. Resetting superuser passwords on Red Hat Quay standalone deployments 링크 복사링크가 클립보드에 복사되었습니다!
To reset the superuser password on your Red Hat Quay standalone deployment, you can generate a bcrypt-hashed password with Python, exec into the PostgreSQL container with podman exec, and update the user table with the new hashed password.
Prerequisites
- You have created a Red Hat Quay superuser.
- You have installed Python 3.9.
-
You have installed the
pippackage manager for Python. -
You have installed the
bcryptpackage forpip.
Procedure
Generate a secure, hashed password using the
bcryptpackage in Python 3.9 by entering the following command:$ python3.9 -c 'import bcrypt; print(bcrypt.hashpw(b"newpass1234", bcrypt.gensalt(12)).decode("utf-8"))'Example output
$2b$12$T8pkgtOoys3G5ut7FV1She6vXlYgU.6TeoGmbbAVQtN8X8ch4knKmEnter the following command to show the container ID of your Red Hat Quay container registry:
$ sudo podman ps -aExample output
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 70560beda7aa registry.redhat.io/rhel8/redis-5:1 run-redis 2 hours ago Up 2 hours ago 0.0.0.0:6379->6379/tcp redis 8012f4491d10 registry.redhat.io/quay/quay-rhel8:v3.8.2 registry 3 minutes ago Up 8 seconds ago 0.0.0.0:80->8080/tcp, 0.0.0.0:443->8443/tcp quay 8b35b493ac05 registry.redhat.io/rhel8/postgresql-10:1 run-postgresql 39 seconds ago Up 39 seconds ago 0.0.0.0:5432->5432/tcp postgresql-quayExecute an interactive shell for the
postgresqlcontainer image by entering the following command:$ sudo podman exec -it 8b35b493ac05 /bin/bashRe-enter the
quayPostgreSQL database server, specifying the database, username, and host address:bash-4.4$ psql -d quay -U quayuser -h 192.168.1.28 -WUpdate the
password_hashof the superuser admin who lost their password:quay=> UPDATE public.user SET password_hash = '$2b$12$T8pkgtOoys3G5ut7FV1She6vXlYgU.6TeoGmbbAVQtN8X8ch4knKm' where username = 'quayadmin';Example output
UPDATE 1Enter the following to command to ensure that the
password_hashhas been updated:quay=> select * from public.user;Example output
id | uuid | username | password_hash | email | verified | stripe_id | organization | robot | invoice_email | invalid_login_attempts | last_invalid_login |removed_tag_expiration_s | enabled | invoice_email_address | company | family_name | given_name | location | maximum_queued_builds_count | creation_date | last_accessed ----+--------------------------------------+-----------+--------------------------------------------------------------+-----------------------+--- -------+-----------+--------------+-------+---------------+------------------------+----------------------------+--------------------------+------ ---+-----------------------+---------+-------------+------------+----------+-----------------------------+----------------------------+----------- 1 | 73f04ef6-19ba-41d3-b14d-f2f1eed94a4a | quayadmin | $2b$12$T8pkgtOoys3G5ut7FV1She6vXlYgU.6TeoGmbbAVQtN8X8ch4knKm | quayadmin@example.com | t | | f | f | f | 0 | 2023-02-23 07:54:39.116485 | 1209600 | t | | | | | | | 2023-02-23 07:54:39.116492Log in to your Red Hat Quay deployment using the new password:
$ sudo podman login -u quayadmin -p newpass1234 http://quay-server.example.com --tls-verify=falseExample output
Login Succeeded!
6.1.3. Resetting superuser passwords on the Red Hat Quay Operator 링크 복사링크가 클립보드에 복사되었습니다!
To reset the superuser password on your Red Hat Quay Operator deployment, you can generate a bcrypt-hashed password with Python, log in to the PostgreSQL database with oc rsh and psql, and update the user table with the new hashed password.
Prerequisites
- You have created a Red Hat Quay superuser.
- You have installed Python 3.9.
-
You have installed the
pippackage manager for Python. -
You have installed the
bcryptpackage forpip.
Procedure
- Log in to your Red Hat Quay deployment.
-
On the OpenShift Container Platform UI, navigate to Workloads
Secrets. -
Select the namespace for your Red Hat Quay deployment, for example,
Project quay. - Locate and store the PostgreSQL database credentials.
Generate a secure, hashed password using the
bcryptpackage in Python 3.9 by entering the following command:$ python3.9 -c 'import bcrypt; print(bcrypt.hashpw(b"newpass1234", bcrypt.gensalt(12)).decode("utf-8"))'Example output
$2b$12$zoilcTG6XQeAoVuDuIZH0..UpvQEZcKh3V6puksQJaUQupHgJ4.4yOn the CLI, log in to the database, for example:
$ oc rsh quayuser-quay-quay-database-669c8998f-v9qslEnter the following command to open a connection to the
quayPostgreSQL database server, specifying the database, username, and host address:sh-4.4$ psql -U quayuser-quay-quay-database -d quayuser-quay-quay-database -WEnter the following command to connect to the default database for the current user:
quay=> \cUpdate the
password_hashof the superuser admin who lost their password:quay=> UPDATE public.user SET password_hash = '$2b$12$zoilcTG6XQeAoVuDuIZH0..UpvQEZcKh3V6puksQJaUQupHgJ4.4y' where username = 'quayadmin';Enter the following to command to ensure that the
password_hashhas been updated:quay=> select * from public.user;Example output
id | uuid | username | password_hash | email | verified | stripe_id | organization | robot | invoice_email | invalid_login_attempts | last_invalid_login |removed_tag_expiration_s | enabled | invoice_email_address | company | family_name | given_name | location | maximum_queued_builds_count | creation_date | last_accessed ----+--------------------------------------+-----------+--------------------------------------------------------------+-----------------------+--- -------+-----------+--------------+-------+---------------+------------------------+----------------------------+--------------------------+------ ---+-----------------------+---------+-------------+------------+----------+-----------------------------+----------------------------+----------- 1 | 73f04ef6-19ba-41d3-b14d-f2f1eed94a4a | quayadmin | $2b$12$zoilcTG6XQeAoVuDuIZH0..UpvQEZcKh3V6puksQJaUQupHgJ4.4y | quayadmin@example.com | t | | f | f | f | 0 | 2023-02-23 07:54:39.116485 | 1209600 | t | | | | | | | 2023-02-23 07:54:39.116492- Navigate to your Red Hat Quay UI on OpenShift Container Platform and log in using the new credentials.