ansible/awx-operator

when changing storage size for Postgres error in playbook causes loop

Open

#1,642 opened on Nov 17, 2023

View on GitHub
 (3 comments) (0 reactions) (0 assignees)Jinja (712 forks)auto 404
communitycomponent:operatorhelp wanted

Repository metrics

Stars
 (1,488 stars)
PR merge metrics
 (PR metrics pending)

Description

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that the AWX Operator is open source software provided for free and that I might not receive a timely response.

Bug Summary

If you change the value in postgres_storage_requirements it caused an error to occur. This is because the Statefulset isn't able to change that value. The task Create Database if no database is specified in database_configuration.yml fails. This drops it down to the rescue which scales down everything to 0.

Then on the task Remove PostgreSQL statefulset for upgrade (which in this case, should be run) it fails to evaluate to the when statement because create_statefulset_result.error does not exist. But in this case, removing the Statefulset is what is required.

AWX Operator version

2.7.2

AWX version

23.4.0

Kubernetes platform

kubernetes

Kubernetes/Platform version

1.26.7

Modifications

no

Steps to reproduce

Have a functioning AWX environment using a managed Postgres pod.

Change the kustomization for the AWX environment to change the value of postgres_storage_requirements. This can be done by either adding it where it wasn't previously used and setting the values to something other than the default, or by increasing the current allocation.

Expected results

The statefulset should be deleted and recreated with the new PVC size as defined.

Actual results

Playbook fails causing the AWX environment to be scaled to 0 for all pods and then getting stuck in a loop attempted to update the statefulset.

Additional information

Once you are stuck in this state, you can manually delete the statefulset and then allow the operator to see the statefulset is missing and have it re-create it. After that is done, the deployment continues and the environment is brought back up.

Operator Logs

The conditional check 'create_statefulset_result.error == 422' failed. The error was: error while evaluating conditional (create_statefulset_result.error == 422): 'dict object' has no attribute 'error'. 'dict object' has no attribute 'error'.

The error appears to be in '/opt/ansible/roles/installer/tasks/database_configuration.yml': line 175, column 7, but may be elsewhere in the file depending on the exact syntax problem.

Contributor guide