From 6cbae08e4e3e5f47f41b7e3d8e391843478c82d1 Mon Sep 17 00:00:00 2001 From: kurokobo <2920259+kurokobo@users.noreply.github.com> Date: Sat, 25 Jun 2022 17:14:46 +0900 Subject: [PATCH] feat: add guide to reveal censored logs --- backup/awxbackup.yaml | 3 +++ base/awx.yaml | 3 +++ restore/awxrestore.yaml | 3 +++ tips/troubleshooting.md | 26 ++++++++++++++++++++++++++ 4 files changed, 35 insertions(+) diff --git a/backup/awxbackup.yaml b/backup/awxbackup.yaml index 79da93b..64ccb9a 100644 --- a/backup/awxbackup.yaml +++ b/backup/awxbackup.yaml @@ -7,3 +7,6 @@ metadata: spec: deployment_name: awx backup_pvc: awx-backup-claim + + # Uncomment to reveal "censored" logs + #no_log: "false" diff --git a/base/awx.yaml b/base/awx.yaml index 0a7a5d8..2656fcd 100644 --- a/base/awx.yaml +++ b/base/awx.yaml @@ -30,3 +30,6 @@ spec: web_resource_requirements: {} task_resource_requirements: {} ee_resource_requirements: {} + + # Uncomment to reveal "censored" logs + #no_log: "false" diff --git a/restore/awxrestore.yaml b/restore/awxrestore.yaml index 2498c5d..bdacf66 100644 --- a/restore/awxrestore.yaml +++ b/restore/awxrestore.yaml @@ -15,3 +15,6 @@ spec: #backup_pvc_namespace: awx #backup_pvc: awx-backup-claim #backup_dir: /backups/tower-openshift-backup-2021-06-06-10:51:49 + + # Uncomment to reveal "censored" logs + #no_log: "false" diff --git a/tips/troubleshooting.md b/tips/troubleshooting.md index f774328..2a2ac31 100644 --- a/tips/troubleshooting.md +++ b/tips/troubleshooting.md @@ -10,6 +10,7 @@ Some hints and guides for when you got stuck during deployment and daily use of - [First Step: Investigate your Situation](#first-step-investigate-your-situation) - [Investigate Status and Events of the Pods](#investigate-status-and-events-of-the-pods) - [Investigate Logs of the Containers inside the Pods](#investigate-logs-of-the-containers-inside-the-pods) + - [Reveal "censored" output in the AWX Operator's log](#reveal-censored-output-in-the-awx-operators-log) - [The Pod is `ErrImagePull` with "429 Too Many Requests"](#the-pod-is-errimagepull-with-429-too-many-requests) - [The Pod is `Pending` with "1 Insufficient cpu, 1 Insufficient memory." event](#the-pod-is-pending-with-1-insufficient-cpu-1-insufficient-memory-event) - [The Pod is `Pending` with "1 pod has unbound immediate PersistentVolumeClaims." event](#the-pod-is-pending-with-1-pod-has-unbound-immediate-persistentvolumeclaims-event) @@ -102,6 +103,31 @@ For AWX Operator and AWX, specifically, the following commands are helpful. - Logs of PostgreSQL - `kubectl -n awx logs -f statefulset/awx-postgres` +### Reveal "censored" output in the AWX Operator's log + +If you've found the `FAILED` tasks while investigating AWX Operator's log, sadly sometimes it's marked as `censored` and you can't get actual log. + +```bash +$ kubectl -n awx logs -f deployments/awx-operator-controller-manager -c awx-manager +... +TASK [Restore database dump to the new postgresql container] ******************************** +fatal: [localhost]: FAILED! => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": true} +... +``` + +AWX Operator 0.23.0 or later supports making this revealed. + +To achieve this, you can uncomment `no_log: "false"` manually under `spec` for your `awx.yaml`, `awxbackup.yaml`, or `awxrestore.yaml`, and then re-run your deployment, backup, or restoration. + +```yaml +... +spec: + ... + # Uncomment to reveal "censored" logs + no_log: "false" 👈👈👈 + ... +``` + ### The Pod is `ErrImagePull` with "429 Too Many Requests" If your Pod for PostgreSQL is in `ErrImagePull` and its `Events` shows following events, this is due to [the rate limit on Docker Hub](https://docs.docker.com/docker-hub/download-rate-limit/).