VMware Cloud Foundation Events

 View Only

 Upload ova file to vcenter content library fails - broken pipe

Ian Govett's profile image
Ian Govett posted Jun 30, 2025 02:54 PM

I need to automate ova upload / image to a content library. 

The following sample code from Broadcom provides a good example on how to upload small ova file, and this code is successfully uploading the ova to the content library.
Sample code at signedOvaWithCertWarning

But when I try to upload a much larger ova file, it fails with a message Broken Pipe after about 15 minutes.

The local library, library item are created, but the code fails while uploading the ova.


Only difference is the size of the ova.  The sample ova is about 6.8Mb,  whereas the failing ova is about 1.8Gb

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.12/3.12.9/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py", line 1344, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/opt/homebrew/Cellar/python@3.12/3.12.9/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1338, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/opt/homebrew/Cellar/python@3.12/3.12.9/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1384, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/opt/homebrew/Cellar/python@3.12/3.12.9/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1333, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/opt/homebrew/Cellar/python@3.12/3.12.9/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1132, in _send_output
    self.send(chunk)
  File "/opt/homebrew/Cellar/python@3.12/3.12.9/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1057, in send
    self.sock.sendall(data)
  File "/opt/homebrew/Cellar/python@3.12/3.12.9/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ssl.py", line 1210, in sendall
    v = self.send(byte_view[count:])
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.9/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ssl.py", line 1179, in send
    return self._sslobj.write(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
BrokenPipeError: [Errno 32] Broken pipe

Not sure if there is a server timeout.  Looking at the code, there is nothing to set a timeout for urllib.request


Appreciate any suggestions on how to resolve this.