# Error when installing AWX Operator

**URL:** <https://forum.ansible.com/t/error-when-installing-awx-operator/4222>\
**Category:** Get Help\
**Tags:** kubernetes, awx-operator, awx, collections\
**Created:** [March 5, 2024, 4:20pm UTC](https://forum.ansible.com/t/error-when-installing-awx-operator/4222 "2024-03-05T16:20:57Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![virtualhobbit](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/virtualhobbit/32/2015_2.png) [@virtualhobbit](https://forum.ansible.com/u/virtualhobbit)\
**Post date:** [March 5, 2024, 4:20pm UTC](https://forum.ansible.com/t/error-when-installing-awx-operator/4222/1 "2024-03-05T16:20:57Z")

</div>

I am receiving an error when creating the AWX Operator. I’m getting the logs using:

`kubectl logs deployments/awx-operator-controller-manager -c awx-manager -f -n awx`

I get the following error:

TASK [installer : Set the resource pod name as a variable.] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\r\ntask path: /opt/ansible/roles/installer/tasks/migrate\_data.yml:31\nfatal: [localhost]: FAILED! =\> {"msg": "The task includes an option with an undefined variable. The error was: list object has no element 0. list object has no element 0\n\nThe error appears to be in ‘/opt/ansible/roles/installer/tasks/migrate\_data.yml’: line 31, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Set the resource pod name as a variable.\n ^ here\n"}\n\r\nPLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\r\nlocalhost : ok=54 changed=0 unreachable=0 failed=1 skipped=25 rescued=0 ignored=0

Here is the YAML I’m using:

apiVersion: [awx.ansible.com/v1beta1](http://awx.ansible.com/v1beta1)  
kind: AWX  
metadata:  
name: awx  
namespace: awx  
spec:  
old\_postgres\_configuration\_secret: awx-old-postgres-configuration  
postgres\_configuration\_secret: awx-old-postgres-configuration  
admin\_user: admin  
admin\_password\_secret: awx-admin-password  
secret\_key\_secret: awx-secret-key  
projects\_persistence: true  
projects\_existing\_claim: “awx-data”  
service\_type: NodePort  
replicas: 3  
hostname: [awx.nl.mdb-lab.com](http://awx.nl.mdb-lab.com)  
ingress\_type: ingress  
ingress\_class\_name: avi-lb  
ingress\_tls\_secret: [awx.nl.mdb-lab.com](http://awx.nl.mdb-lab.com)

Can anyone see what I’m missing?

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [March 5, 2024, 4:37pm UTC](https://forum.ansible.com/t/error-when-installing-awx-operator/4222/2 "2024-03-05T16:37:32Z")

</div>

Since you specified an old postgres configuration secret, the installer expects a postgres pod to be running, but none was found, so the data cannot be migrated. I suspect you should not define the new postgres configuration to use the old one. When you create the new instance to migrate from the old one, a new configuration will be created from the old one. You also need to specify the secret key that was used by the old instance or the data may be inaccessible.

Migration docs:  
[awx-operator/docs/migration/migration.md at devel · ansible/awx-operator (github.com)](https://github.com/ansible/awx-operator/blob/devel/docs/migration/migration.md)

Code where your error occurred:  
[awx-operator/roles/installer/tasks/migrate\_data.yml#L31 at devel · ansible/awx-operator (github.com)](https://github.com/ansible/awx-operator/blob/devel/roles/installer/tasks/migrate_data.yml#L31)

Edit: You also should only need to do this if you’re migrating from versions prior to 18 to versions afterwards. There is no need to specify an old configuration secret to do in-place upgrades, and migrations can re-use existing secrets.

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [March 5, 2024, 4:45pm UTC](https://forum.ansible.com/t/error-when-installing-awx-operator/4222/4 "2024-03-05T16:45:50Z")

</div>

In that case, you will need that line. You will also need make sure your new instance has the `secret_key_secret` as shown the migration doc. I would not define `postgres_configuration_secret:`, let the operator create that.

```yaml
---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  name: awx
  namespace: awx
spec:
  old_postgres_configuration_secret: awx-old-postgres-configuration
  # postgres_configuration_secret: awx-old-postgres-configuration
  admin_user: admin
  admin_password_secret: awx-admin-password
  secret_key_secret: awx-secret-key # create this ahead of time
  projects_persistence: true
  projects_existing_claim: “awx-data”
  service_type: NodePort
  replicas: 3
  hostname: awx.nl.mdb-lab.com
  ingress_type: ingress
  ingress_class_name: avi-lb
  ingress_tls_secret: awx.nl.mdb-lab.com

```

---

<div class="post-metadata">

**Author:** ![virtualhobbit](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/virtualhobbit/32/2015_2.png) [@virtualhobbit](https://forum.ansible.com/u/virtualhobbit)\
**Post date:** [March 5, 2024, 6:09pm UTC](https://forum.ansible.com/t/error-when-installing-awx-operator/4222/5 "2024-03-05T18:09:02Z")

</div>

Hi,

When I do this, it creates the awx-postgres-13-0 pods which I don’t want/need…

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [March 5, 2024, 6:43pm UTC](https://forum.ansible.com/t/error-when-installing-awx-operator/4222/6 "2024-03-05T18:43:04Z")

</div>

Are you using an external postgresql database?

Edit: if yes, what version are you running?

---

<div class="post-metadata">

**Author:** ![virtualhobbit](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/virtualhobbit/32/2015_2.png) [@virtualhobbit](https://forum.ansible.com/u/virtualhobbit)\
**Post date:** [March 5, 2024, 7:41pm UTC](https://forum.ansible.com/t/error-when-installing-awx-operator/4222/7 "2024-03-05T19:41:57Z")

</div>

Yes, I am using an external Postgres database, v14

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [March 5, 2024, 7:59pm UTC](https://forum.ansible.com/t/error-when-installing-awx-operator/4222/8 "2024-03-05T19:59:02Z")

</div>

In that case, the operator just appears to be doing a pg\_dump and pg\_restore from an old instance to a new instance when you define `old_postgres_configuration_secret`. So no special database operations are occurring. AWX requires a minimum of postgresql 13, so you’re good there as well.

Since your database is not being migrated as part of the upgrade, you do not need to define the old configuration secret. You will still need to pre-create the `secret_key_secret` using the old secret though.

```yaml
---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  name: awx
  namespace: awx
spec:
  postgres_configuration_secret: awx-old-postgres-configuration
  admin_user: admin
  admin_password_secret: awx-admin-password
  secret_key_secret: awx-old-secret-key
  projects_persistence: true
  projects_existing_claim: “awx-data”
  service_type: NodePort
  replicas: 3
  hostname: awx.nl.mdb-lab.com
  ingress_type: ingress
  ingress_class_name: avi-lb
  ingress_tls_secret: awx.nl.mdb-lab.com

```

---

<div class="post-metadata">

**Author:** ![virtualhobbit](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/virtualhobbit/32/2015_2.png) [@virtualhobbit](https://forum.ansible.com/u/virtualhobbit)\
**Post date:** [March 6, 2024, 12:04pm UTC](https://forum.ansible.com/t/error-when-installing-awx-operator/4222/9 "2024-03-06T12:04:09Z")

</div>

We were finally on our way but the deployment it just a mess:

 ![Screenshot 2024-03-06 at 12.01.57](https://us1.discourse-cdn.com/ansible/original/2X/f/f7eba5125ee9efba96cd9bcedec785368bab9828.png)

The common error is:

The node was low on resource: ephemeral-storage. Threshold quantity: 2094169733, available: 57212Ki. Container awx-task was using 240Ki, request is 0, has larger consumption of ephemeral-storage. Container awx-ee was using 60Ki, request is 0, has larger consumption of ephemeral-storage. Container awx-rsyslog was using 108Ki, request is 0, has larger consumption of ephemeral-storage. Container redis was using 40Ki, request is 0, has larger consumption of ephemeral-storage

Not having any other issues with any other application - just AWX ☹

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [March 6, 2024, 2:55pm UTC](https://forum.ansible.com/t/error-when-installing-awx-operator/4222/10 "2024-03-06T14:55:51Z")

</div>

That sounds like a kubernetes problem you need to address, but we might be able to alleviate the symptoms in AWX. You can tune the resource requests and limits for pretty much every container of AWX, including the ephemeral-storage.

```yaml
---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  name: awx
  namespace: awx
spec:
  postgres_configuration_secret: awx-old-postgres-configuration
  admin_user: admin
  admin_password_secret: awx-admin-password
  secret_key_secret: awx-old-secret-key
  projects_persistence: true
  projects_existing_claim: “awx-data”
  service_type: NodePort
  replicas: 3
  hostname: awx.nl.mdb-lab.com
  ingress_type: ingress
  ingress_class_name: avi-lb
  ingress_tls_secret: awx.nl.mdb-lab.com
  task_resource_requirements:
    requests:
      cpu: 100m
      memory: 128Mi
      ephemeral-storage: 100M
    limits:
      cpu: 2000m
      memory: 4Gi
      ephemeral-storage: 500M
  web_resource_requirements:
    requests:
      cpu: 100m
      memory: 128Mi
    limits:
      cpu: 1000m
      memory: 4Gi
  ee_resource_requirements:
    requests:
      cpu: 100m
      memory: 64Mi
    limits:
      cpu: 1000m
      memory: 4Gi
  redis_resource_requirements:
    requests:
      cpu: 50m
      memory: 64Mi
    limits:
      cpu: 1000m
      memory: 4Gi
  rsyslog_resource_requirements:
    requests:
      cpu: 100m
      memory: 128Mi
    limits:
      cpu: 1000m
      memory: 2Gi
  init_container_resource_requirements:
    requests:
      cpu: 100m
      memory: 128Mi
    limits:
      cpu: 1000m
      memory: 2Gi
  postgres_init_container_resource_requirements:
    requests:
      cpu: 10m
      memory: 64Mi
    limits:
      cpu: 1000m
      memory: 2Gi

```

That said, you probably should look into extending the underlying filesystem of your kubernetes nodes. Unfortunately, that gets outside my realm of expertise. If you could share some details about your platform, someone else here may be able to help. You might want to make a separate Get Help post about it.

---

<div class="post-metadata">

**Author:** ![virtualhobbit](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/virtualhobbit/32/2015_2.png) [@virtualhobbit](https://forum.ansible.com/u/virtualhobbit)\
**Post date:** [March 7, 2024, 1:59am UTC](https://forum.ansible.com/t/error-when-installing-awx-operator/4222/11 "2024-03-07T01:59:02Z")

</div>

You were absolutely right. I needed to extend the ephemeral-storage on the underlying cluster. Once I’d done that:

 ![Screenshot 2024-03-07 at 01.57.08](https://us1.discourse-cdn.com/ansible/original/2X/9/9f12a9f021a361809099a5fd87d008a205d7d021.png)

Massive thanks for all your help!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [July 9, 2024, 5:04pm UTC](https://forum.ansible.com/t/error-when-installing-awx-operator/4222/12 "2024-07-09T17:04:15Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
