Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sddc_crud.py samples throws exception when waiting for task to complete. #76

Open
3 tasks done
tianhao64 opened this issue Jun 15, 2018 · 1 comment
Open
3 tasks done
Assignees
Labels

Comments

@tianhao64
Copy link
Contributor

  • I am using the latest SDK version
  • This API is compatible with my vCenter version (You can get the info from 'vcenter_version' in each sample)
  • I have searched existing issues

Environment

  • sdk package version:

pyvmomi (6.7.0)
service-identity (17.0.0)
vapi-client-bindings (1.3.0)
vapi-common-client (2.9.0)
vapi-runtime (2.9.0)
vapi-vmc-client (2.9.0)
vmc-app-python-sdk (2.2.0.0.0.15184434)
vmc-client-bindings (1.2.0)

  • python version:

Python 3.6.3

  • vSphere version:
    VMware cloud on AWS

Steps or code snippet to reproduce

(py3) het-m03:vsphere-automation-sdk-python het$ python samples/vmc/sddc/sddc_crud.py -r $TOKEN -o $ORG -cs

Example: Create a SDDC (Sample SDDC 31) in org 058f47c4-92aa-417f-8747-87f3ed61cb45:

Wait for task 5f10f0e2-fa6e-49a1-a98d-0dd15ade56ad to finish
Checking task status every 60 seconds
Estimated time remaining: 108 minutes
Traceback (most recent call last):
File "/Users/het/envs/py3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/Users/het/envs/py3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 384, in _make_request
six.raise_from(e, None)
File "", line 2, in raise_from
File "/Users/het/envs/py3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 380, in _make_request
httplib_response = conn.getresponse()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1331, in getresponse
response.begin()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/het/envs/py3/lib/python3.6/site-packages/requests/adapters.py", line 445, in send
timeout=timeout
File "/Users/het/envs/py3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/Users/het/envs/py3/lib/python3.6/site-packages/urllib3/util/retry.py", line 367, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/Users/het/envs/py3/lib/python3.6/site-packages/urllib3/packages/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/Users/het/envs/py3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/Users/het/envs/py3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 384, in _make_request
six.raise_from(e, None)
File "", line 2, in raise_from
File "/Users/het/envs/py3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 380, in _make_request
httplib_response = conn.getresponse()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1331, in getresponse
response.begin()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "samples/vmc/sddc/sddc_crud.py", line 200, in
main()
File "samples/vmc/sddc/sddc_crud.py", line 192, in main
sddc_operations.create_sddc()
File "samples/vmc/sddc/sddc_crud.py", line 137, in create_sddc
interval_sec=self.interval_sec)
File "/Users/het/github/vsphere-automation-sdk-python/samples/vmc/helpers/vmc_task_helper.py", line 35, in wait_for_task
task = task_client.get(org_id, task_id)
File "/Users/het/envs/py3/lib/python3.6/site-packages/com/vmware/vmc/orgs_client.py", line 521, in get
'task': task,
File "/Users/het/envs/py3/lib/python3.6/site-packages/vmware/vapi/bindings/stub.py", line 317, in _invoke
return self._api_interface.native_invoke(ctx, _method_name, kwargs)
File "/Users/het/envs/py3/lib/python3.6/site-packages/vmware/vapi/bindings/stub.py", line 243, in native_invoke
method_result = self.invoke(ctx, method_id, data_val)
File "/Users/het/envs/py3/lib/python3.6/site-packages/vmware/vapi/bindings/stub.py", line 179, in invoke
ctx)
File "/Users/het/envs/py3/lib/python3.6/site-packages/vmware/vapi/security/client/security_context_filter.py", line 99, in invoke
self, service_id, operation_id, input_value, new_ctx)
File "/Users/het/envs/py3/lib/python3.6/site-packages/vmware/vapi/provider/filter.py", line 76, in invoke
service_id, operation_id, input_value, ctx)
File "/Users/het/envs/py3/lib/python3.6/site-packages/vmware/vapi/protocol/client/msg/rest_connector.py", line 95, in invoke
operation_rest_metadata, self._is_vapi_rest)
File "/Users/het/envs/py3/lib/python3.6/site-packages/vmware/vapi/protocol/client/msg/rest_connector.py", line 146, in _invoke
http_response = self._http_provider.do_request(http_request)
File "/Users/het/envs/py3/lib/python3.6/site-packages/vmware/vapi/protocol/client/rpc/requests_provider.py", line 98, in do_request
cookies=http_request.cookies, timeout=timeout)
File "/Users/het/envs/py3/lib/python3.6/site-packages/requests/sessions.py", line 512, in request
resp = self.send(prep, **send_kwargs)
File "/Users/het/envs/py3/lib/python3.6/site-packages/requests/sessions.py", line 622, in send
r = adapter.send(request, **kwargs)
File "/Users/het/envs/py3/lib/python3.6/site-packages/requests/adapters.py", line 495, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

Expected behavior

Pull task every 1min until the task is finished.

@tianhao64 tianhao64 added the bug label Jun 15, 2018
@tianhao64 tianhao64 self-assigned this Jun 15, 2018
@tgelter
Copy link

tgelter commented Sep 11, 2019

I'm also seeing this issue when testing the sample code found here: vmware/pyvmomi-community-samples#247
To work around the issue, I'm decorating my method with https://github.com/jd/tenacity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants