F5Networks / f5-ansible-next

Collection for managing BIG-IP NEXT devices
1 stars 0 forks source link

BIG-IP Next CM Backup Module Failing with Internal Server Error #6

Open VDI-Tech-Guy opened 1 month ago

VDI-Tech-Guy commented 1 month ago
COMPONENT NAME

f5networks.next.cm_next_backup_restore

Environment

ANSIBLE VERSION
Using Execution Engine - https://quay.io/repository/f5_business_development/f5_next_ee_test

Image: f5_next_ee_test:latest (primary) (Information about ansible and ansible collections)                                                                                                                                                                       
 0│---
 1│ansible:
 2│  collections:
 3│    details:
 4│      ansible.netcommon: 4.1.0
 5│      ansible.posix: 1.5.4
 6│      ansible.utils: 5.0.0
 7│      cloud.common: 3.0.0
 8│      community.docker: 3.11.0
 9│      community.general: 9.2.0
10│      community.library_inventory_filtering_v1: 1.0.1
11│      community.vmware: 4.5.0
12│      containers.podman: 1.15.4
13│      f5networks.f5_bigip: 3.5.1
14│      f5networks.f5_modules: 1.29.0
15│      f5networks.next: 1.2.0
16│      vmware.vmware_rest: 3.0.1
17│  version:
18│    details: ansible [core 2.15.12]
BIGIP NEXT VERSION
CM Version - BIG-IP-Next-CentralManager-20.2.1-0.3.25
Instance Version - 20.2.1-2.430.2+0.0.48
CONFIGURATION

Using Ansible Automation Platform Controller (This is a UDF Instance i can share)

OS / ENVIRONMENT

Using Ansible Automation Platform Controller (This is a UDF Instance i can share)

SUMMARY

When trying to run backup code getting an Internal Error { "msg": "{'status': 500, 'message': 'SHARED-00001: Internal server error'}", "invocation": { "module_args": { "device_ip": "10.1.1.8", "filename": "ansible.backup.tar.gz", "file_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "state": "backup", "timeout": 600, "force": false, "device_hostname": null }

I Tested in 20.2 and 20.3 with same issue, i can do manual backup within GUI of CM and successful however Automation code fails.

STEPS TO REPRODUCE
- name: Collect users and files information on CM device
  f5networks.next.cm_device_info:
    gather_subset:
      - all
  register: cm_info

- name: Debug CM-Info
  ansible.builtin.debug:
    var: cm_info

- name: Backup BIG-IP Next instance
  f5networks.next.cm_next_backup_restore:
    #device_hostname: "{{ item.hostname }}"
    device_ip: "{{ item.address }}"
    #filename: "{{ item.id }}.{{ lookup('pipe', 'date +%Y-%m-%d-%H-%M-%S') }}"
    filename: "ansible.backup.tar.gz"
    file_password: '{{ lookup("env", "ANSIBLE_NET_PASSWORD") }}'
    state: backup
    #force: true
    timeout: 600
  with_items: "{{ cm_info.managed_devices }}"

Github Repo - https://github.com/f5devcentral/f5-bd-ansible-labs/

https://github.com/f5devcentral/f5-bd-ansible-labs/blob/main/301-BIGIP-Next-Basics/AS3/00-Backup-Restore-Role/Backup-Role.yaml

EXPECTED RESULTS

Backup completed successfully without error

ACTUAL RESULTS
Read vars_file 'vars/f5_vars.yml'
TASK [f5_backup_data : Backup BIG-IP Next instance] ****************************
task path: /runner/project/301-BIGIP-Next-Basics/AS3/00-Backup-Restore-Role/roles/f5_backup_data/tasks/main.yml:3
redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
Loading collection ansible.netcommon from /usr/share/ansible/collections/ansible_collections/ansible/netcommon
<10.1.1.11> attempting to start connection
<10.1.1.11> using connection plugin ansible.netcommon.httpapi
Found ansible-connection at path /usr/bin/ansible-connection
<10.1.1.11> found existing local domain socket, using it!
<10.1.1.11> updating play_context for connection
<10.1.1.11> Loading collection ansible.builtin from 
<10.1.1.11> local domain socket path is /root/.ansible/pc/384067f042
<10.1.1.11> ESTABLISH LOCAL CONNECTION FOR USER: root
<10.1.1.11> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-local-10258m_bt0 `"&& mkdir "` echo /root/.ansible/tmp/ansible-local-10258m_bt0/ansible-tmp-1722892565.3876715-39-63674485292538 `" && echo ansible-tmp-1722892565.3876715-39-63674485292538="` echo /root/.ansible/tmp/ansible-local-10258m_bt0/ansible-tmp-1722892565.3876715-39-63674485292538 `" ) && sleep 0'
Using module file /usr/share/ansible/collections/ansible_collections/f5networks/next/plugins/modules/cm_next_backup_restore.py
<10.1.1.11> PUT /root/.ansible/tmp/ansible-local-10258m_bt0/tmp9keqpbwy TO /root/.ansible/tmp/ansible-local-10258m_bt0/ansible-tmp-1722892565.3876715-39-63674485292538/AnsiballZ_cm_next_backup_restore.py
<10.1.1.11> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-local-10258m_bt0/ansible-tmp-1722892565.3876715-39-63674485292538/ /root/.ansible/tmp/ansible-local-10258m_bt0/ansible-tmp-1722892565.3876715-39-63674485292538/AnsiballZ_cm_next_backup_restore.py && sleep 0'
<10.1.1.11> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-local-10258m_bt0/ansible-tmp-1722892565.3876715-39-63674485292538/AnsiballZ_cm_next_backup_restore.py && sleep 0'
<10.1.1.11> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-local-10258m_bt0/ansible-tmp-1722892565.3876715-39-63674485292538/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
  File "/tmp/ansible_f5networks.next.cm_next_backup_restore_payload_do5ht65n/ansible_f5networks.next.cm_next_backup_restore_payload.zip/ansible_collections/f5networks/next/plugins/modules/cm_next_backup_restore.py", line 482, in main
  File "/tmp/ansible_f5networks.next.cm_next_backup_restore_payload_do5ht65n/ansible_f5networks.next.cm_next_backup_restore_payload.zip/ansible_collections/f5networks/next/plugins/modules/cm_next_backup_restore.py", line 238, in exec_module
  File "/tmp/ansible_f5networks.next.cm_next_backup_restore_payload_do5ht65n/ansible_f5networks.next.cm_next_backup_restore_payload.zip/ansible_collections/f5networks/next/plugins/modules/cm_next_backup_restore.py", line 252, in backup
  File "/tmp/ansible_f5networks.next.cm_next_backup_restore_payload_do5ht65n/ansible_f5networks.next.cm_next_backup_restore_payload.zip/ansible_collections/f5networks/next/plugins/modules/cm_next_backup_restore.py", line 330, in exist…
PLAY RECAP *********************************************************************
central_manager            : ok=2    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0  
pgouband commented 1 month ago

Hi,

Thanks for reporting. Added to the backlog and internal tracking ID for this request is: INFRAANO-1643.

prateekramani commented 1 week ago

Hi @VDI-Tech-Guy ,

I found that when we attempt to check for the existence of a backup file that does not exist through the API call, we encounter this error. I have submitted a bug on Bugzilla regarding this issue. The Bug ID is 1636093, it can be tracked from there.

Thanks.