object.py AttributeError: 'NoneType' object has no attribute 'metadata' on successful object creation

Bug #2061604 reported by Brandon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ansible-collections-openstack
New
Undecided
Unassigned

Bug Description

Using openstack.cloud.object, target file is uploading successfully, but task is failing with the following traceback:

File \"/tmp/ansible_openstack.cloud.object_payload_xafp5fae/ansible_openstack.cloud.object_payload.zip/ansible_collections/openstack/cloud/plugins/modules/object.py\", line 253, in run\r\nAttributeError: 'NoneType' object has no attribute 'metadata'

Task:
- name: Push desired files to Object Store {{ container_name }}
  openstack.cloud.object:
    container: "{{ container_name }}"
    filename: "{{ item.path }}"
    name: "{{ item.path }}"
    state: present
  loop: "{{ fq_backup_list.files }}"
  loop_control:
    label: "Backing up {{ item.path }}"
  environment:
    OS_AUTH_URL: "{{ openstack_auth_url }}"
    OS_AUTH_TYPE: "{{ openstack_auth_type }}"
    OS_INTERFACE: "{{ openstack_interface }}"
    OS_REGION_NAME: "{{ openstack_region_name }}"
    OS_IDENTITY_API_VERSION: "{{ openstack_identity_app_version }}"
    OS_APPLICATION_CREDENTIAL_ID: "{{ openstack_application_credential_id }}"
    OS_APPLICATION_CREDENTIAL_SECRET: "{{ openstack_application_credential_secret }}"

Auth is passed via AWX Credential

OpenstackSDK ver on target host:
$ pip list installed | grep open
openstacksdk 3.0.0

Using AWX Execution Environment:
quay.io/ansible/awx-ee:latest

AWX Version: 23.9.0

Using Openstack Application Credentials and Openstack CLI, I can confirm the file is there:
 openstack object list coupa-k3s --long --all | grep config
| /backup/coupa-k3s-master-1/config.yaml | 329 | bbf08ba4e3309b31b405cbe71b0ebad4 | | 2024-04-15T17:13:26.248Z |
| /backup/coupa-k3s-master-2/config.yaml | 364 | 610adcc79fcd0171f2b4e537c513f8a3 | | 2024-04-15T17:13:51.262Z |
| /backup/coupa-k3s-master-3/config.yaml | 364 | 7cd451c60fe236613ac9ccaf74e6a440 | | 2024-04-15T17:14:16.855Z |

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.