ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
836 stars 1.53k forks source link

proxmox_template upload timeout=5s can't be changed and too short #9153

Open elelayan opened 1 week ago

elelayan commented 1 week ago

Summary

When I upload an iso to my cluster it takes ~20s.

See is the upload task.

Here is the error I get:

msg: 'Uploading template files/isos/myhost.iso failed with error: (''Connection aborted.'', TimeoutError(''The write operation timed out''))'

I think the timeout needs to be specified when creating the ProxmoxAPI object in proxmox.py.

At least it works for me when I change to return ProxmoxAPI(api_host, verify_ssl=validate_certs, timeout=42, **auth_args). And I see the effect when logging the timeout value in ProxmoxHttpSession in proxmoxer/backend/https.py line 232.

Issue Type

Bug Report

Component Name

proxmox_template

Ansible Version

$ ansible --version
ansible [core 2.14.17]
  config file = /home/xxx/.../ansible.cfg
  configured module search path = ['/home/xxx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/xxx/.tox/py3-ansible/lib/python3.11/site-packages/ansible
  ansible collection location = /home/xxxxx/collections-dependencies:/home/xxxxx/collections
  executable location = /home/xxxx/.tox/py3-ansible/bin/ansible
  python version = 3.11.2 (main, Aug 26 2024, 07:20:54) [GCC 12.2.0] (/home/xxxxx/.tox/py3-ansible/bin/python)
  jinja version = 3.1.4
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general

# /home/xxxx/collections-dependencies/ansible_collections
Collection        Version
----------------- -------
community.general 8.6.7  

Configuration

$ ansible-config dump --only-changed

OS / Environment

Debian 12

Steps to Reproduce

    - name: Upload CDROM
      community.general.proxmox_template: "{{ pve_api | combine(task_params) }}"
      delegate_to: localhost
      vars:
        task_params:
          content_type: iso
          src: "files/isos/{{ inventory_hostname }}.iso"
          storage: "{{ pve_iso_storage }}"
          force: true

Expected Results

I expected the upload to succeed.

Actual Results

msg: 'Uploading template files/isos/myhost.iso failed with error: (''Connection aborted.'', TimeoutError(''The write operation timed out''))'

Code of Conduct

elelayan commented 1 week ago

by adding logging into proxmoxer I'm able to see the request timeout = 5s.

ansibullbot commented 1 week ago

cc @Ajpantuso @Thulium-Drake @UnderGreen @joshainglis @karmab @krauthosting click here for bot help