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

Socket.timeout occurs in TEEM and module processing fails.

Open kane8n opened this issue 10 months ago • 4 comments

COMPONENT NAME

Environment

ANSIBLE VERSION

BIGIP VERSION

CONFIGURATION
OS / ENVIRONMENT

N/A

SUMMARY

I use f5_module to operate BIG-IP with aws-operator. Yesterday, the job suddenly started failing, and upon investigation, I found that an exception was raised by socket.timeout when sending TEEM. I avoided the problem by setting the no_f5_teem option, but I don't think it is desirable to have the module process fail with a TEEM error. Since socket.timeout is a subclass of OSError, I would like to see OSError added to the exception handling target.

STEPS TO REPRODUCE

EXPECTED RESULTS
ACTUAL RESULTS
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: socket.timeout: The read operation timed out
fatal: [XXXXXX -> localhost({{ inventory_hostname }}.{{ host_domain }})]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):
  File \\"/root/.ansible/tmp/ansible-tmp-1744800535.145826-32-105060651175105/AnsiballZ_bigip_pool_member.py\\", line 107, in <module>
    _ansiballz_main()
  File \\"/root/.ansible/tmp/ansible-tmp-1744800535.145826-32-105060651175105/AnsiballZ_bigip_pool_member.py\\", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File \\"/root/.ansible/tmp/ansible-tmp-1744800535.145826-32-105060651175105/AnsiballZ_bigip_pool_member.py\\", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.f5networks.f5_modules.plugins.modules.bigip_pool_member', init_globals=dict(_module_fqn='ansible_collections.f5networks.f5_modules.plugins.modules.bigip_pool_member', _modlib_path=modlib_path),
  File \\"/usr/lib64/python3.9/runpy.py\\", line 225, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File \\"/usr/lib64/python3.9/runpy.py\\", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File \\"/usr/lib64/python3.9/runpy.py\\", line 87, in _run_code
    exec(code, run_globals)
  File \\"/tmp/ansible_bigip_pool_member_payload_38szm472/ansible_bigip_pool_member_payload.zip/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_pool_member.py\\", line 1826, in <module>
  File \\"/tmp/ansible_bigip_pool_member_payload_38szm472/ansible_bigip_pool_member_payload.zip/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_pool_member.py\\", line 1819, in main
  File \\"/tmp/ansible_bigip_pool_member_payload_38szm472/ansible_bigip_pool_member_payload.zip/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_pool_member.py\\", line 1223, in exec_module
  File \\"/tmp/ansible_bigip_pool_member_payload_38szm472/ansible_bigip_pool_member_payload.zip/ansible_collections/f5networks/f5_modules/plugins/module_utils/teem.py\\", line 166, in send_teem
  File \\"/tmp/ansible_bigip_pool_member_payload_38szm472/ansible_bigip_pool_member_payload.zip/ansible_collections/f5networks/f5_modules/plugins/module_utils/teem.py\\", line 77, in send
  File \\"/tmp/ansible_bigip_pool_member_payload_38szm472/ansible_bigip_pool_member_payload.zip/ansible/module_utils/urls.py\\", line 1686, in open_url
  File \\"/tmp/ansible_bigip_pool_member_payload_38szm472/ansible_bigip_pool_member_payload.zip/ansible/module_utils/urls.py\\", line 1578, in open
  File \\"/usr/lib64/python3.9/urllib/request.py\\", line 214, in urlopen
    return opener.open(url, data, timeout)
  File \\"/usr/lib64/python3.9/urllib/request.py\\", line 517, in open
    response = self._open(req, data)
  File \\"/usr/lib64/python3.9/urllib/request.py\\", line 534, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File \\"/usr/lib64/python3.9/urllib/request.py\\", line 494, in _call_chain
    result = func(*args)
  File \\"/tmp/ansible_bigip_pool_member_payload_38szm472/ansible_bigip_pool_member_payload.zip/ansible/module_utils/urls.py\\", line 605, in https_open
  File \\"/usr/lib64/python3.9/urllib/request.py\\", line 1350, in do_open
    r = h.getresponse()
  File \\"/usr/lib64/python3.9/http/client.py\\", line 1377, in getresponse
    response.begin()
  File \\"/usr/lib64/python3.9/http/client.py\\", line 320, in begin
    version, status, reason = self._read_status()
  File \\"/usr/lib64/python3.9/http/client.py\\", line 281, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), \\"iso-8859-1\\")
  File \\"/usr/lib64/python3.9/socket.py\\", line 704, in readinto
    return self._sock.recv_into(b)
  File \\"/usr/lib64/python3.9/ssl.py\\", line 1275, in recv_into
    return self.read(nbytes, buffer)
  File \\"/usr/lib64/python3.9/ssl.py\\", line 1133, in read
    return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
", "module_stdout": "", "msg": "MODULE FAILURE
See stdout/stderr for the exact error", "rc": 1}

kane8n avatar Apr 17 '25 07:04 kane8n

HI @kane8n,

Can you share the step to reproduce the error?

pgouband avatar Apr 17 '25 13:04 pgouband

@pgouband Thanks for your reply! It seems that awx-operator is running on an AWS EKS cluster and for some reason was experiencing unstable communication with product.apis.f5.com. It is difficult to reproduce as it is believed to be a network issue.

kane8n avatar Apr 18 '25 00:04 kane8n

As a side note, when this error occurs, the ansible job fails, but the BIG-IP operation (in this case, unloading the server from the pool) itself succeeds.

kane8n avatar Apr 18 '25 00:04 kane8n

Hi,

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

pgouband avatar Apr 22 '25 09:04 pgouband