f5-ansible-bigip icon indicating copy to clipboard operation
f5-ansible-bigip copied to clipboard

v16.1.x ucs_fetch urllib.error.URLError: <urlopen error timed out>

Open mwardbopp opened this issue 2 years ago • 4 comments

I've tried a number of playbooks ucs_fetch, bigip_qkview both imperative and declarative and I get errors. If I revert to 15.1.8 they work fine.

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: urllib.error.URLError: fatal: [f5 -> localhost]: FAILED! => changed=false module_stderr: |- Traceback (most recent call last): File "/usr/local/lib/python3.8/urllib/request.py", line 1354, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/usr/local/lib/python3.8/http/client.py", line 1256, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/local/lib/python3.8/http/client.py", line 1302, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.8/http/client.py", line 1251, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.8/http/client.py", line 1011, in _send_output self.send(msg) File "/usr/local/lib/python3.8/http/client.py", line 951, in send self.connect() File "/usr/local/lib/python3.8/http/client.py", line 1418, in connect super().connect() File "/usr/local/lib/python3.8/http/client.py", line 922, in connect self.sock = self._create_connection( File "/usr/local/lib/python3.8/socket.py", line 808, in create_connection raise err File "/usr/local/lib/python3.8/socket.py", line 796, in create_connection sock.connect(sa) socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/centos/.ansible/tmp/ansible-tmp-1669045074.1295142-18969-255249079795967/AnsiballZ_bigip_qkview.py", line 107, in <module>
    _ansiballz_main()
  File "/home/centos/.ansible/tmp/ansible-tmp-1669045074.1295142-18969-255249079795967/AnsiballZ_bigip_qkview.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/centos/.ansible/tmp/ansible-tmp-1669045074.1295142-18969-255249079795967/AnsiballZ_bigip_qkview.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.f5networks.f5_modules.plugins.modules.bigip_qkview', init_globals=dict(_module_fqn='ansible_collections.f5networks.f5_modules.plugins.modules.bigip_qkview', _modlib_path=modlib_path),
  File "/usr/local/lib/python3.8/runpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/local/lib/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_bigip_qkview_payload_swf1ab3w/ansible_bigip_qkview_payload.zip/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_qkview.py", line 607, in <module>
  File "/tmp/ansible_bigip_qkview_payload_swf1ab3w/ansible_bigip_qkview_payload.zip/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_qkview.py", line 600, in main
  File "/tmp/ansible_bigip_qkview_payload_swf1ab3w/ansible_bigip_qkview_payload.zip/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_qkview.py", line 224, in exec_module
  File "/tmp/ansible_bigip_qkview_payload_swf1ab3w/ansible_bigip_qkview_payload.zip/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_qkview.py", line 237, in is_version_less_than_14
  File "/tmp/ansible_bigip_qkview_payload_swf1ab3w/ansible_bigip_qkview_payload.zip/ansible_collections/f5networks/f5_modules/plugins/module_utils/icontrol.py", line 551, in tmos_version
  File "/tmp/ansible_bigip_qkview_payload_swf1ab3w/ansible_bigip_qkview_payload.zip/ansible_collections/f5networks/f5_modules/plugins/module_utils/bigip.py", line 31, in api
  File "/tmp/ansible_bigip_qkview_payload_swf1ab3w/ansible_bigip_qkview_payload.zip/ansible_collections/f5networks/f5_modules/plugins/module_utils/bigip.py", line 52, in connect_via_token_auth
  File "/tmp/ansible_bigip_qkview_payload_swf1ab3w/ansible_bigip_qkview_payload.zip/ansible_collections/f5networks/f5_modules/plugins/module_utils/icontrol.py", line 239, in post
  File "/tmp/ansible_bigip_qkview_payload_swf1ab3w/ansible_bigip_qkview_payload.zip/ansible_collections/f5networks/f5_modules/plugins/module_utils/icontrol.py", line 194, in send
  File "/tmp/ansible_bigip_qkview_payload_swf1ab3w/ansible_bigip_qkview_payload.zip/ansible/module_utils/urls.py", line 1446, in open
  File "/usr/local/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.8/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/local/lib/python3.8/urllib/request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/local/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/tmp/ansible_bigip_qkview_payload_swf1ab3w/ansible_bigip_qkview_payload.zip/ansible/module_utils/urls.py", line 582, in https_open
  File "/usr/local/lib/python3.8/urllib/request.py", line 1357, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error timed out>

module_stdout: '' msg: |- MODULE FAILURE See stdout/stderr for the exact error rc: 1


  • name: Only create new UCS, no download hosts: f5 gather_facts: false connection: local

    vars: provider: password: "{{ ansible_ssh_pass }}" server: "{{ private_ip }}" user: "{{ ansible_user }}" validate_certs: "no" timeout: 1600 tasks:

    • name: Fetch a qkview from the remote device bigip_qkview: only_create_file: yes exclude: - audit - secure dest: /tmp/localhost.localdomain.qkview provider: "{{ provider }}" delegate_to: localhost

[centos@ansible networking-workshop]$ cat ucs_fetch_simple.yml

  • name: Only create new UCS, no download hosts: f5 gather_facts: false connection: local

    vars: provider: password: "{{ ansible_ssh_pass }}" server: "{{ private_ip }}" user: "{{ ansible_user }}" validate_certs: "no" timeout: 1600 tasks:

    • name: Fetch a qkview from the remote device bigip_qkview: only_create_file: yes exclude: - audit - secure dest: /tmp/localhost.localdomain.qkview provider: "{{ provider }}" delegate_to: localhost [centos@ansible networking-workshop]$ cat ucs_fetch.yml

  • name: Fetch BIG-IP UCS hosts: f5 connection: local gather_facts: False vars: provider: password: "{{ ansible_ssh_pass }}" server: "{{ private_ip }}" user: "{{ ansible_user }}" validate_certs: False

    tasks:

    • name: get current time on localhost command: date "+%H%M%S-%m%d%y" register: date delegate_to: localhost run_once: True

    • name: set filename var set_fact: ucs: "{{ 'test' + '-' + date.stdout + '-backup.ucs' }}"

    • name: Download a new UCS bigip_ucs_fetch: src: "{{ ucs }}" dest: "{{ '/tmp/ucs/' + ucs }}" provider: "{{ provider }}" delegate_to: localhost

mwardbopp avatar Nov 21 '22 17:11 mwardbopp

Hi, internal ID to track this item is: INFRAANO-976, thanks!

KrithikaChidambaram avatar Dec 07 '22 09:12 KrithikaChidambaram

any update on this bug?

tizianorosato-gr avatar Feb 06 '23 18:02 tizianorosato-gr

Can you tell us what version of TMOS are you using when this issue is being presented?

G-gonzalezjimenez avatar May 11 '23 15:05 G-gonzalezjimenez

Hi,

To troubleshoot the connection issue, could you do a tcpdump with decryption so that we can determine whether it's the BIG-IP or the Ansible client that's reseting the connection. If you need help, you can open a ticket at https://my.f5.com/.

pgouband avatar May 31 '23 10:05 pgouband