vmware / vmware/pyvmomi

CurrentTime get empty exception

Open
#902 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs verification
Dominant language
Python
Stars
2.3k
Forks
763
PR merge metrics
No merged PRs in 30d

Description

My code as following.But I got exception empty and I think it's because that self.service_instance.CurrentTime get empty exception.So I can't figure out how it occurred and I wonder why CurrentTime get wrong.
`
def _keep_alive_config(self):
while True:
self._recollect("keep_alive_config",
self.service_instance.CurrentTime)
time.sleep(5)

def _recollect(self, entity_name, func, args=()):
i = 0
while True:
i += 1
try:
return func(*args)
except Exception as ex:
if len(ex.args) > 1 and ex.args[0] in [10053, 10054,
10060]:
self.logger.info(
"Collect %s failed.\n" % entity_name + str(ex.args[0]))
if i <= 3:
warning = 'A network exception occurred while '
'collecting %s, wait 30 seconds '
'and retry', entity_name
self.logger.warning(warning)
time.sleep(30)
else:
self.logger.error(
'Terminate collecting due to'
' network anomalies!!!!!!')
self.logger.error(ex)
else:
self.logger.error(
'Stop collect information of %s due to'
' error occurd.' % entity_name)
self.logger.error(ex) #Exception is empty?
break`

The log file shows error as following:
[2020-06-03 20:41:00,156] [_recollect:282] Stop collect information of keep_alive_config due to error occurd.
[2020-06-03 20:41:00,156] [_recollect:285]
[2020-06-03 20:41:05,655] [_recollect:282] Stop collect information of keep_alive_config due to error occurd.
[2020-06-03 20:41:05,655] [_recollect:285]
[2020-06-03 20:41:11,169] [_recollect:282] Stop collect information of keep_alive_config due to error occurd.
[2020-06-03 20:41:11,169] [_recollect:285]
[2020-06-03 20:41:16,674] [_recollect:282] Stop collect information of keep_alive_config due to error occurd.
[2020-06-03 20:41:16,674] [_recollect:285]
[2020-06-03 20:41:22,191] [_recollect:282] Stop collect information of keep_alive_config due to error occurd.
[2020-06-03 20:41:22,197] [_recollect:285]
[2020-06-03 20:41:27,706] [_recollect:282] Stop collect information of keep_alive_config due to error occurd.
[2020-06-03 20:41:27,712] [_recollect:285]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the _keep_alive_config and _recollect entry points shown in the report, then reproduce the self.service_instance.CurrentTime call with the same setup. Inspect the caught exception and logging output; done means the failure has a documented cause and the issue specifies a reproducible fix or diagnostic change.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.