Red Hat Quay Debug Mode
Environment
- Red Hat Quay
- 3
Issue
- Red Hat Quay provides verbose logging to help administrators find more information about issues.
Enabling debug mode can speed up the process to reproduce an error and validate a solution.
Resolution
Red Hat Quay standalone installation
podman/docker
-
Add env var to the
podman/docker runcommand:$ sudo podman/docker run -p 443:8443 -p 80:8080 -e DEBUGLOG=true -v /config:/conf/stack -v /storage:/datastorage -d registry.redhat.io/quay/quay-rhel8:v3.6.6Replace
v3.6.6in the command above with the release you're using. Note that Quay versions prior tov3.4.0are hosted on Quay.io underquay.io/redhat/quay:v3.x.xbut these versions are no longer supported.
Red Hat Quay installation with the Quay Operator
Red Hat Quay 3.7 and above
-
Edit
QuayRegistryCRD as follows:$ oc edit quayregistry <quay-registry-name> -n <quay-namespace> ... spec: components: - kind: quay managed: true overrides: env: - name: DEBUGLOG value: "true"
Red Hat Quay 3.6 and lower
-
Scale down Quay operator deployment
$ oc scale deployment quay-operator.v3.x.x --replicas=0 -n openshift-operatorsReplace the version with the operator version you're using in your environment. The operator by default installs in
openshift-operatorsnamespace. If you have the operator installed in a different namespace, please replace this value with the correct one. -
Edit the Quay deployment:
$ oc edit deployment quay-app -n quay containers: - name: quay-app image: quay.io/redhat/quay:v3.6.x env: - name: DEBUGLOG value: true
Enabling debug mode for Clair
Update your Clair config.yaml file to enable debugging:
http_listen_addr: :8081
introspection_addr: :8088
log_level: debug
LDAP Logs
WARNING
WARNING: Enabling LDAP debug logs could cause Quay to store passwords in the log in clean text format while running. We would highly recommend that LDAP debugging be turned off as soon as possible.
LDAP debug logs can be sent to stdout by passing the env varUSERS_DEBUG=1 to the Quay container:
$ sudo podman/docker run -p 443:8443 -p 80:8080 -e DEBUGLOG=true -e USERS_DEBUG=1 -v /config:/conf/stack -v /storage:/datastorage -d registry.redhat.io/quay/quay-rhel8:v3.x.x
Replace the version with the exact version of Quay you want to start. For operator driven deployments, the env. variable is added via the override, just like in DEBUGLOG case:
$ oc edit quayregistry <quay-registry-name> -n <quay-namespace>
...
spec:
components:
- kind: quay
managed: true
overrides:
env:
- name: DEBUGLOG
value: "true"
- name: USERS_DEBUG
value: "1"
OpenShift Mirror Registry
Debugging can be enabled for an OpenShift Mirror Registry as well as it is still Quay underneath:
-
Stop the registry via the
systemctlcommand:$ sudo systemctl stop quay-app.service -
Edit the
quay-app.serviceand add theDEBUGLOG=trueenv. variable to the startup command:$ sudo vi/nano /etc/systemd/system/quay-app.service ... ExecStart=/usr/bin/podman run \ --name quay-app \ -e DEBUGLOG=true \ # <--- add this line ... -
Save the file, reload the daemons and restart Quay:
$ sudo systemctl daemon-reload $ sudo systemctl start quay-app.service
You can dump the logs at any time afterwards by running:
$ sudo journalctl -u quay-app.service --no-pager > quay-app.log
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.