I wanted to upload 12gb iso image using vsphere_copy

We are using community VMware collection version 5.7.1 and recently facing issue with uploading ISO remote host to data store. Nothing change from code level it is working 20 days back but now it is broken ….. error ……. module_stdout: "Traceback (most recent call last): \r\n File \°/ust/lib64/python3.6/urllib/request.py*. line 1349, in do_open|F\n \°/usI/1ib64/python3.6/http/client.py". line 1273, in request\I\n

self. endheaders(body, encode_chunked=encode_chunked) \r\n File */ust/lib64/python3.6/http/client.py". line 1268, in endheaders \r\n encode_chunked=req.has_header( ‘Transfer-encoding’))r\n File

self._send_request (method, url, body, headers, encode_chunked) \r\n File */us/Lib64/python3.6/http/client.py*, line 1319, in _send_request

\°/ust/lib64/python3.6/http/client.py". line 1083, in _send_output\r\n */usI/lib64/python3.6/ssl.py", line 968, in sendall\I\n

self._send_output (message_body, encode_chunked=encode_chunked) \n File

self. send (chunk) \r\n File */usr/lib64/python3.6/http/client.py*, line 1004, in send\r\n

\°/usI/lib64/python3.6/ssl.py". line 601, in write\r\n

v = self.send(byte_view[count:]) \r\n File \°/us/Lib64/python3.6/ssl.py*, line 937, in send\r\n

self.sock.sendall(data)\r\n File

occurred: \r\n\nTraceback (most recent call last): \r\n File

return self._sslobj.write(data) |7\n File

return self._sslobj write(data) \f\nConnectionResetError: [Errno 104] Connection reset by peer\f\n\r\nDuring handling of the above exception, another excep

*/tmp/ansible_community.vmware.vsphere_copy_payload_d3jab87l/ansible_community.vmware.vsphere_copy_payload.zip/ansible_collections/community/vmware/plugins/modules/vsphere_copy.pyl’. line 199, in main|ln File */tmp/ansible_community.vmware.vsphere_copy_payload_d3jab871/ansible_community.vmware.vsphere_copy_payload.zip/ansible/module_utils/urls.py'. line 1692, in open_urlIn File

\°/tmp/ansible_community.vmware.vsphere_copy_payload_d3jab871/ansible_community.vmware.vsphere_copy_payload.zip/ansible/module_utils/urls.py*, line 1578, in open|r\n File \°/usI/lib64/python3.6/urllib/request.pyl*.

line 223, in urlopen\r\n return opener open(url, data, timeout) \r\n File \°/usr/lib64/python3.6/urllib/request.py*, line 526, in open\r\n

*/usr/Lib64/python3.6/urllib/request.py*, line 544, in _open\r\n

'_open, req) \e\n File "/ust/lib64/python3.6/urllib/request.py|*. line 504, in _call_chain\r\n

response = self._open(req, data) |I|n File

*/tmp/ansible_community.vmware.vsphere_copy_payload_d3jab871/ansible_community.vmware.vsphere_copy_payload.zip/anstble/module_utils/urls.pyl. line 605, in https_open|r\n File

result = func(*args)|r\n File

\°/usI/1ib64/python3.6/urllib/request.py*. line 1351, in do_open\r\n raise URLError(err) \r\nurllib.error.URLError: < urlopen error [Errno 104] Connection reset by peer›|\n\nDuring handling of the above

exception, another exception occurred: \r\n\nTraceback (most recent call last): \r\n ‹ module>\r\n _ansiballz_main() \e\n

File */home/ansible/.ansible/tmp/ansible-tmp-1753705508.8187895-112-120904110469227/AnstballZ_vsphere_copy.pyl’. line 107, in

File */home/ansible/.ansible/tmp/ansible-tmp-1753705508.8187895-112-120904110469227/AnsiballZ_vsphere_copy.py', line 99, in _ansiballz_main\r\n

temp_path, ANSIBALLZ_PARAMS) \r\n File */home/ansible/.ansible/tmp/ansible-tmp-1753705508.8187895-112-120904110469227/AnstballZ_vsphere_copy-py*. line 48, in invoke_module\r\n

invoke_module(zipped_mod,

alter_sys-True) \r\n File \°/us/lib64/python3.6/runpy-py*. line 205, in run_module\r\n _run_module_code\r\n

return _run_module_code(code, init_globals, run_name,

run_name='-main.

mod_name, mod_spec, pkg_name, script_name) \r\n File \°/usr/Lib64/python3.6/runpy.py*. line 85, in _run_code\r\n-

mod_spec) \r\n File "/usr/lib64/python3.6/runpy.py", line 96, in

exec (code, run_globals)\n File

*/tmp/ansible_community.vmware.vsphere_copy_payload_d3jab871/ansible_communtty.vmware.vsphere_copy_payload.zip/ansible_collections/community/vmware/plugtns/modules/vsphere_copy.pyl*. line 238, in ‹module>|r\n File \°/tmp/ansible_community.vmware.vsphere_copy_payload_d3jab871/ansible_community.vmware.vsphere_copy_payload.zip/ansible_collections/communtty/vmware/plugins/modules/vsphere_copy.py', line 203, in main\r\nTypeError:

•URLETTOT"

object does not support indexing\r\n*

module_stderr:

“Shared connection to sandeep@freehost.com closed.\F\n”

exception: "Traceback (most recent call last): \r\n

File '/usr/lib64/python3.6/urllib/request.py". line 1349, in do_open\r\n

*/usI/lib64/python3.6/http/client.py*, line 1273, in request\r\n

encode_chunked-req.has_header(‘Transfer-encoding’))\r\n File

self._send _request (method, url, body, headers, encode_chunked) lein File \°/ust/Lib64/python3.6/http/cUtent.py*. Line 1319, in _send request |2\n

self. endheaders(body, encode_chunked=encode_chunked)\r\n File */ust/Lib64/python3.6/http/client.py*. line 1268, in endheaders \r\n self._send_output(message_body, encode_chunked=encode_chunked)\r\n File

*/ust/lib64/python3.6/http/client.py*, line 1083, in _send_output \r\n self. send(chunk) \r\n File */us/lib64/python3.6/http/client.py", line 1004, in send\r\n

"/usI/Lib64/python3.6/ssl.py*. Line 968, in sendall\r\n

v = self. send(byte_view[count: ])\r\n File */ust/lib64/python3.6/ssl.py*. Line 937, in send\r\n

self.sock.sendall(data)\r\n File

return self._sslobj.write(data) |z\n File

*/usI/lib64/python3.6/ssl.py*. line 601, in write\r\n return self._sslobj write(data) \r\nConnectionResetError: [Errno 104] Connection reset by peer|r\n\z\nDuring handling of the above exception, another exception

occurred: \r\n\nTraceback (most recent call last): \r\n File

\°/tmp/ansible_community.vmware.vsphere_copy_payload_d3jab871/ansible_community.vmware.vsphere_copy_payload.zip/ansible_collections/communtty/vmware/plugins/modules/vsphere_copy-py*. line 199, in main\r\n File */tmp/ansible_community.vmware.vsphere_copy_payload_d3jab87l/ansible_community.vmware.vsphere_copy_payload.zip/ansible/module_uttls/urls.py*. Line 1692,

in open_url\z\n File

zin

end_o

Vº/tmp/ansible_community.vmware.vsphere_copy_payload_d3jab871/ansible_community.vmware.vsphere_copy_payload.zip/ansible/module_utils/urls.py*. Line 1578, in open\r\n File '/ust/L(b64/python3.6/urlltb/request.pyl*

line 223, in urlopen\r\n return opener, open(url, data, timeout) \r\n File '/usr/lib64/python3.6/urllib/request.py*. Line 526, in open\r\n response " self._open(req. data)\r\n File

*/usI/lib64/python3.6/urllib/request.py*, Line 544, in _open\r\n

‘_open’, req) \r\n File */ust/lib64/python3.6/urllib/request.py", line 504, in _call_chain\r\n

result = func(*args) \r\n File

*/tmp/ansible_community.vmware.vsphere_copy_payload_d3jab87l/ansible_community.vmware.vsphere_copy_payload.zip/ansible/module_uttls/urls.py'. Line 605, in https_open\r\n Ftle

\°/usr/Lib64/python3,6/urllib/request.py*, line 1351, in do_open\r\n raise URLError(err) \r\nurllib.error.URLError: ‹urlopen error [Errno 104] Connection reset by peer›(r\n\F\nDuring handling of the above

exception, another exception occurred:\r\n\r\nTraceback (most recent call last): \r\n File */home/ansible/.ansible/tmp/ansible-tmp-1753705508.8187895-112-120904110469227/AnstballZ_vsphere_copy-py*. line 107, tn

5/urlItb)

chunked

‹ module>\r\n

_ansiballz_main(\r\n File \°/home/ansible/,ansible/tmp/ansible-tmp-1753705508.8187895-112-120904110469227/Anstbal1Z_vsphere_copy-py*

line 99, in _anstballz_matn\r\n tnvoke_module(zipped_mod,

temp_path, ANSIBALLZ_PARAMS)\z\n

File */home/ansible/.ansible/tmp/ansible-tmp-1753705508,8187895-112-120904110469227/Anstbal1Z_vsphere_copy-py*. Line 48, in invoke_modute|r\n-

run_name-'_main

alter_sys-True) \r\n File */us/Lib64/python3,6/runpy-py", line 205, in run_module\r\n return _run_module_code(code,

init_globals, run_name, mod_spec)(F\n

File V°/usr/ltb64/python3.6/runpy-py", line 96, in

_run_module_code\r\n

mod_name, mod_spec, pkg_name, script_name) \r\n File \°/ust/lib64/python3.6/runpy-py*. line 85, in _run_code \r\n exec (code,

LUNC<00043758

File

*/tmp/ansible_community.vmware.vsphere_copy_payload_d3jabB71/anstble_community.vmware.vsphere_copy_payload.zip/ansible_collecttons/communtty/vmware/plugtns/modules/vsphere_copy.py*. Utne 238, in ‹module>\rn File

*/tmp/ansible_community.vmware.vsphere_copy_payload_d3jab871/ansible_community.vmware.vsphere_copy_payload.zip/ansible_collections/communtty/vmware/plugins/modules/vsphere_copy-py\

, Line 203, in main|r\nTypeError:

URLEITOr object does not support tndexingn

MODULE FAILURE

See stdout/stderr for the exact error

_ansible_no_log: false

chan@ed as0

Hey Sandeep,

Man, I can imagine how frustrating that must be—especially if nothing in the code changed and it was working just fine a few weeks ago.

From what I see, it looks like the server (maybe vSphere or something in between) is cutting the connection during the upload. That sometimes happens with large files (12GB is quite a lot), especially if there’s some timeout or size limit happening behind the scenes. Have you tried uploading a smaller ISO, just to rule that out?

Also, I noticed that TypeError: 'URLError' object does not support indexing — it seems like the vsphere_copy module isn’t handling the connection error properly. Might be worth checking if there’s a newer version of the collection where this is already fixed.

I don’t have a magic fix, but if you want me to test something on my end or compare versions, happy to help however I can.

Best of luck with it,
Oriori

Is the file size same from 20 days ago, if it is then it doesn’t look like client side issue.

@IAM-NEYE I’m not really with you there. Could be an update on the client side to a Python lib the collection uses.

However, if it worked with community.vmware 5.7.1 20 days ago but not today, something has to have happened somewhere. If you’re interested, I’ve mentioned the possible places for further investigation here. Might even be in another place that I’ve overlooked.

Ultimately the issue is:

ConnectionResetError: [Errno 104] Connection reset by peer

This indicates that the server is resetting the connection for some reason. There are many reasons why this could be.

The module isn’t handling that scenario very well, and causing a traceback which could be considered a bug in itself, but ultimately not something that can really be remediated on the client side other than “try again”.

You may need to do investigation at the server or the network links between you and the server to determine why the connection is being reset.

1 Like

@Mario Lenz,yeah it is a possibility but i still not support that it would be the cause.