Open knight-ni opened 4 years ago
@rmontenegroo Could you take a peek at this?
@knight-ni would paste the complete error message here? I can't make it happen here.
What is your vsphere version?
-- update -- As I said earlier, I was not able to re-create the error. I considered the possibility of the non-existence of customFieldsManager for any reason, so I made some changes to the code. I also considered the scenario where, for any crazy reason, the custom property id is not in the allCustomAttributesNames dict.
https://github.com/rmontenegroo/vmware_exporter/tree/issue_199
I have the same problem on a vSphere 6.5 host, I tried it with VSPHERE_PROD_FETCH_CUSTOM_ATTRIBUTES=True
and without, no luck.
This is the log output using the latest docker image:
```
2020-05-26 12:48:44,303 INFO:Start collecting metrics from 1.2.3.4
2020-05-26 12:48:44,303 INFO:Starting vm metrics collection
2020-05-26 12:48:44,303 INFO:Fetching vim.VirtualMachine inventory
2020-05-26 12:48:44,303 INFO:Retrieving service instance content
2020-05-26 12:48:44,304 INFO:START: _vmware_get_vm_perf_manager_metrics
2020-05-26 12:48:44,304 INFO:Fetching vim.Datastore inventory
2020-05-26 12:48:44,304 INFO:Starting host metrics collection
2020-05-26 12:48:44,304 INFO:Fetching vim.HostSystem inventory
2020-05-26 12:48:44,304 INFO:START: _vmware_get_host_perf_manager_metrics
2020-05-26 12:48:44,432 INFO:Retrieved service instance content
2020-05-26 12:48:44,563 ERROR:Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 1638, in _async_render_GET
yield self.generate_latest_metrics(request)
twisted.internet.defer.FirstError: FirstError[#0, [Failure instance: Traceback:
When setting fetch_custom_attributes to False, it should not initialize allCustomAttributesNames in helpers.py which will lead to a None type has no attribute 'field' from line "for f in content.customFieldsManager.field", after I commented that code, everything work fine.