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

VCSA 6.7.0.2 no metrics #89

Closed
rackunits opened this issue Feb 20, 2019 · 15 comments
Closed

VCSA 6.7.0.2 no metrics #89

rackunits opened this issue Feb 20, 2019 · 15 comments

Comments

@rackunits
Copy link

rackunits commented Feb 20, 2019

When using VMware-vCenter-Server-Appliance-6.7.0.20000-10244745-patch-FP.iso (latest version) the docker container is unable to produce metrics for export.

`
/usr/bin/docker run -it -p 9272:9272 -e VSPHERE_USER=[email protected] -e VSPHERE_PASSWORD='mypass' -e VSPHERE_HOST='10.0.0.xx' -e VSPHERE_IGNORE_SSL=True --name vmware_exporter pryorda/vmware_exporter
[2019-02-14 19:44:00.540658+00:00] Starting web server on port 9272
[2019-02-14 19:44:01.513733+00:00] Start collecting metrics from 10.0.0.99
[2019-02-14 19:44:01.513832+00:00] Starting vm metrics collection
[2019-02-14 19:44:01.513909+00:00] Fetching vim.VirtualMachine inventory
[2019-02-14 19:44:01.517189+00:00] Retrieving service instance content
[2019-02-14 19:44:01.519459+00:00] START: _vmware_get_vm_perf_manager_metrics
[2019-02-14 19:44:01.520242+00:00] Starting datastore metrics collection
[2019-02-14 19:44:01.520908+00:00] Fetching vim.Datastore inventory
[2019-02-14 19:44:01.522654+00:00] Starting host metrics collection
[2019-02-14 19:44:01.523283+00:00] Fetching vim.HostSystem inventory
[2019-02-14 19:44:01.633741+00:00] Retrieved service instance content
[2019-02-14 19:44:02.089670+00:00] Fetched vim.VirtualMachine inventory (0:00:00.575705)
[2019-02-14 19:44:02.100404+00:00] Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 766, in _async_render_GET
yield self.generate_latest_metrics(request)
twisted.internet.defer.FirstError: FirstError[#1, [Failure instance: Traceback: <class 'twisted.internet.defer.FirstError'>: FirstError[#0, [Failure instance: Traceback: <class 'TypeError'>: Required field "querySpec" not provided (not @optional)
/usr/local/lib/python3.6/threading.py:916:_bootstrap_inner
/usr/local/lib/python3.6/threading.py:864:run
/usr/local/lib/python3.6/site-packages/twisted/_threads/_threadworker.py:46:work
/usr/local/lib/python3.6/site-packages/twisted/_threads/_team.py:190:doWork
--- ---
/usr/local/lib/python3.6/site-packages/twisted/python/threadpool.py:250:inContext
/usr/local/lib/python3.6/site-packages/twisted/python/threadpool.py:266:
/usr/local/lib/python3.6/site-packages/twisted/python/context.py:122:callWithContext
/usr/local/lib/python3.6/site-packages/twisted/python/context.py:85:callWithContext
/usr/local/lib/python3.6/site-packages/pyVmomi/VmomiSupport.py:706:
/usr/local/lib/python3.6/site-packages/pyVmomi/VmomiSupport.py:511:_InvokeMethod
/usr/local/lib/python3.6/site-packages/pyVmomi/VmomiSupport.py:1041:CheckField
]]
--- ---
/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py:554:_vmware_get_vm_perf_manager_metrics
/usr/local/lib/python3.6/site-packages/vmware_exporter/defer.py:99:parallelize
]]

[2019-02-14 19:44:02.131425+00:00] Fetched vim.Datastore inventory (0:00:00.609866)
[2019-02-14 19:44:02.138566+00:00] Fetched vim.HostSystem inventory (0:00:00.614648)
[2019-02-14 19:44:02.208135+00:00] Finished datastore metrics collection
[2019-02-14 19:44:02.262205+00:00] Finished vm metrics collection
[2019-02-14 19:44:02.263507+00:00] Finished host metrics collection
[2019-02-14 19:44:16.512584+00:00] Start collecting metrics from 10.0.0.99
[2019-02-14 19:44:16.512666+00:00] Starting vm metrics collection
[2019-02-14 19:44:16.512727+00:00] Fetching vim.VirtualMachine inventory
[2019-02-14 19:44:16.512795+00:00] Retrieving service instance content
[2019-02-14 19:44:16.513403+00:00] START: _vmware_get_vm_perf_manager_metrics
[2019-02-14 19:44:16.513966+00:00] Starting datastore metrics collection
[2019-02-14 19:44:16.514041+00:00] Fetching vim.Datastore inventory
[2019-02-14 19:44:16.514330+00:00] Starting host metrics collection
[2019-02-14 19:44:16.514741+00:00] Fetching vim.HostSystem inventory
[2019-02-14 19:44:16.585087+00:00] Retrieved service instance content
[2019-02-14 19:44:17.031539+00:00] Fetched vim.VirtualMachine inventory (0:00:00.518771)
[2019-02-14 19:44:17.057751+00:00] Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 766, in _async_render_GET
yield self.generate_latest_metrics(request)
twisted.internet.defer.FirstError: FirstError[#1, [Failure instance: Traceback: <class 'twisted.internet.defer.FirstError'>: FirstError[#0, [Failure instance: Traceback: <class 'TypeError'>: Required field "querySpec" not provided (not @optional)
/usr/local/lib/python3.6/threading.py:916:_bootstrap_inner
/usr/local/lib/python3.6/threading.py:864:run
/usr/local/lib/python3.6/site-packages/twisted/_threads/_threadworker.py:46:work
/usr/local/lib/python3.6/site-packages/twisted/_threads/_team.py:190:doWork
--- ---
/usr/local/lib/python3.6/site-packages/twisted/python/threadpool.py:250:inContext
/usr/local/lib/python3.6/site-packages/twisted/python/threadpool.py:266:
/usr/local/lib/python3.6/site-packages/twisted/python/context.py:122:callWithContext
/usr/local/lib/python3.6/site-packages/twisted/python/context.py:85:callWithContext
/usr/local/lib/python3.6/site-packages/pyVmomi/VmomiSupport.py:706:
/usr/local/lib/python3.6/site-packages/pyVmomi/VmomiSupport.py:511:_InvokeMethod
/usr/local/lib/python3.6/site-packages/pyVmomi/VmomiSupport.py:1041:CheckField
]]
--- ---
/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py:554:_vmware_get_vm_perf_manager_metrics
/usr/local/lib/python3.6/site-packages/vmware_exporter/defer.py:99:parallelize
]]
`

@pryorda
Copy link
Owner

pryorda commented Feb 23, 2019

I don't currently have a 6.7 instance to test with. I'll look at this more when I have one. What version do you have pulled down ?

@rackunits
Copy link
Author

I pulled straight from the master branch.

@akurach
Copy link
Contributor

akurach commented Mar 14, 2019

Version
6.7.0
Build
11727113

everything is ok.

is was ok until I've updated to latest version...

@akurach
Copy link
Contributor

akurach commented Mar 14, 2019

Here is my traceback of docker container.
without docker app cant be running. dnt know why.

root@exporter:/opt/docker# docker-compose up --force-recreate
Recreating docker_vmware_exporter_1
Attaching to docker_vmware_exporter_1
vmware_exporter_1  | [2019-03-14 13:21:33.463247+00:00] Starting web server on port 9272
vmware_exporter_1  | [2019-03-14 13:21:46.780090+00:00] Start collecting metrics from esxname.com
vmware_exporter_1  | [2019-03-14 13:21:46.780152+00:00] Starting vm metrics collection
vmware_exporter_1  | [2019-03-14 13:21:46.780189+00:00] Fetching vim.VirtualMachine inventory
vmware_exporter_1  | [2019-03-14 13:21:46.781295+00:00] Retrieving service instance content
vmware_exporter_1  | [2019-03-14 13:21:46.782062+00:00] Starting datastore metrics collection
vmware_exporter_1  | [2019-03-14 13:21:46.782105+00:00] Fetching vim.Datastore inventory
vmware_exporter_1  | [2019-03-14 13:21:46.782473+00:00] Starting host metrics collection
vmware_exporter_1  | [2019-03-14 13:21:46.782508+00:00] Fetching vim.HostSystem inventory
vmware_exporter_1  | [2019-03-14 13:21:46.904393+00:00] Retrieved service instance content
vmware_exporter_1  | [2019-03-14 13:21:47.581929+00:00] Fetched vim.HostSystem inventory (0:00:00.799401)
vmware_exporter_1  | [2019-03-14 13:21:49.054341+00:00] Fetched vim.Datastore inventory (0:00:02.272215)
vmware_exporter_1  | [2019-03-14 13:21:49.055066+00:00] Finished datastore metrics collection
vmware_exporter_1  | [2019-03-14 13:21:49.137606+00:00] Fetched vim.VirtualMachine inventory (0:00:02.357397)
vmware_exporter_1  | [2019-03-14 13:21:53.705338+00:00] Traceback (most recent call last):
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 806, in _async_render_GET
vmware_exporter_1  |     yield self.generate_latest_metrics(request)
vmware_exporter_1  | twisted.internet.defer.FirstError: FirstError[#0, [Failure instance: Traceback: <class 'twisted.internet.defer.FirstError'>: FirstError[#1, [Failure instance: Traceback: <class 'twisted.internet.defer.FirstError'>: FirstError[#1, [Failure instance: Traceback: <class 'AttributeError'>: 'dict' object has no attribute 'extend'
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/internet/defer.py:501:errback
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/internet/defer.py:568:_startRunCallbacks
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/internet/defer.py:654:_runCallbacks
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/internet/defer.py:1475:gotResult
vmware_exporter_1  | --- <exception caught here> ---
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/internet/defer.py:1416:_inlineCallbacks
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/python/failure.py:491:throwExceptionIntoGenerator
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py:421:host_labels
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/python/threadpool.py:250:inContext
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/python/threadpool.py:266:<lambda>
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/python/context.py:122:callWithContext
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/python/context.py:85:callWithContext
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py:421:<lambda>
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py:414:_collect
vmware_exporter_1  | ]]
vmware_exporter_1  | --- <exception caught here> ---
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py:429:vm_labels
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/vmware_exporter/defer.py:99:parallelize
vmware_exporter_1  | ]]
vmware_exporter_1  | --- <exception caught here> ---
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py:594:_vmware_get_vms
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/vmware_exporter/defer.py:99:parallelize
vmware_exporter_1  | ]]
vmware_exporter_1  |
vmware_exporter_1  | Unhandled error in Deferred:
vmware_exporter_1  |
vmware_exporter_1  | Traceback (most recent call last):
vmware_exporter_1  | --- <exception caught here> ---
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 429, in vm_labels
vmware_exporter_1  |     virtual_machines, host_labels = yield parallelize(self.vm_inventory, self.host_labels)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/vmware_exporter/defer.py", line 99, in parallelize
vmware_exporter_1  |     results = yield defer.DeferredList(args, fireOnOneErrback=True)
vmware_exporter_1  | twisted.internet.defer.FirstError: FirstError[#1, [Failure instance: Traceback: <class 'AttributeError'>: 'dict' object has no attribute 'extend'
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/internet/defer.py:501:errback
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/internet/defer.py:568:_startRunCallbacks
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/internet/defer.py:654:_runCallbacks
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/internet/defer.py:1475:gotResult
vmware_exporter_1  | --- <exception caught here> ---
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/internet/defer.py:1416:_inlineCallbacks
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/python/failure.py:491:throwExceptionIntoGenerator
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py:421:host_labels
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/python/threadpool.py:250:inContext
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/python/threadpool.py:266:<lambda>
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/python/context.py:122:callWithContext
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/python/context.py:85:callWithContext
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py:421:<lambda>
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py:414:_collect
vmware_exporter_1  | ]]
vmware_exporter_1  |
vmware_exporter_1  | Unhandled error in Deferred:
vmware_exporter_1  |
vmware_exporter_1  | Traceback (most recent call last):
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 501, in errback
vmware_exporter_1  |     self._startRunCallbacks(fail)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 568, in _startRunCallbacks
vmware_exporter_1  |     self._runCallbacks()
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 654, in _runCallbacks
vmware_exporter_1  |     current.result = callback(current.result, *args, **kw)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 1475, in gotResult
vmware_exporter_1  |     _inlineCallbacks(r, g, status)
vmware_exporter_1  | --- <exception caught here> ---
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
vmware_exporter_1  |     result = result.throwExceptionIntoGenerator(g)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
vmware_exporter_1  |     return g.throw(self.type, self.value, self.tb)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 421, in host_labels
vmware_exporter_1  |     result = yield threads.deferToThread(lambda: _collect(dc, dc.hostFolder))
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/python/threadpool.py", line 250, in inContext
vmware_exporter_1  |     result = inContext.theWork()
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/python/threadpool.py", line 266, in <lambda>
vmware_exporter_1  |     inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/python/context.py", line 122, in callWithContext
vmware_exporter_1  |     return self.currentContext().callWithContext(ctx, func, *args, **kw)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/python/context.py", line 85, in callWithContext
vmware_exporter_1  |     return func(*args,**kw)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 421, in <lambda>
vmware_exporter_1  |     result = yield threads.deferToThread(lambda: _collect(dc, dc.hostFolder))
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 414, in _collect
vmware_exporter_1  |     host_inventory.extend(_collect(dc, folder))
vmware_exporter_1  | builtins.AttributeError: 'dict' object has no attribute 'extend'
vmware_exporter_1  |
vmware_exporter_1  | Unhandled error in Deferred:
vmware_exporter_1  |
vmware_exporter_1  | Traceback (most recent call last):
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 501, in errback
vmware_exporter_1  |     self._startRunCallbacks(fail)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 568, in _startRunCallbacks
vmware_exporter_1  |     self._runCallbacks()
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 654, in _runCallbacks
vmware_exporter_1  |     current.result = callback(current.result, *args, **kw)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 1475, in gotResult
vmware_exporter_1  |     _inlineCallbacks(r, g, status)
vmware_exporter_1  | --- <exception caught here> ---
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
vmware_exporter_1  |     result = result.throwExceptionIntoGenerator(g)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
vmware_exporter_1  |     return g.throw(self.type, self.value, self.tb)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 421, in host_labels
vmware_exporter_1  |     result = yield threads.deferToThread(lambda: _collect(dc, dc.hostFolder))
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/python/threadpool.py", line 250, in inContext
vmware_exporter_1  |     result = inContext.theWork()
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/python/threadpool.py", line 266, in <lambda>
vmware_exporter_1  |     inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/python/context.py", line 122, in callWithContext
vmware_exporter_1  |     return self.currentContext().callWithContext(ctx, func, *args, **kw)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/python/context.py", line 85, in callWithContext
vmware_exporter_1  |     return func(*args,**kw)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 421, in <lambda>
vmware_exporter_1  |     result = yield threads.deferToThread(lambda: _collect(dc, dc.hostFolder))
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 414, in _collect
vmware_exporter_1  |     host_inventory.extend(_collect(dc, folder))
vmware_exporter_1  | builtins.AttributeError: 'dict' object has no attribute 'extend'
vmware_exporter_1  |
^CGracefully stopping... (press Ctrl+C again to force)
Stopping docker_vmware_exporter_1 ... done

@akurach
Copy link
Contributor

akurach commented Mar 14, 2019

for now i revered to very old repo

git reset --hard db51c1a

and everything works

@akurach
Copy link
Contributor

akurach commented Mar 14, 2019

I've played around with docker different vers.
SO
v.0.2.6 works OK with 6.7 @rackunits may be interesting for u)
v. 0.3.0 works but not stable results in output with 6.7
v. 0.3.1 not.
v. 0.4.0 not too.

Here's trace for v0.3.1

Status: Downloaded newer image for pryorda/vmware_exporter:v0.3.1
Recreating docker_vmware_exporter_1
Attaching to docker_vmware_exporter_1
vmware_exporter_1  | [2019-03-14 14:47:14.424858+00:00] Starting web server on port 9272
vmware_exporter_1  | [2019-03-14 14:47:17.424297+00:00] Start collecting metrics from kr01-vc01.tech.mosreg.ru
vmware_exporter_1  | [2019-03-14 14:47:17.530695+00:00] Starting inventory collection
vmware_exporter_1  | [2019-03-14 14:47:22.605195+00:00] [Failure instance: Traceback: <class 'AttributeError'>: 'vim.Folder' object has no attribute 'host'
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/internet/base.py:1276:mainLoop
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/internet/base.py:902:runUntilCurrent
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/internet/defer.py:460:callback
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/internet/defer.py:568:_startRunCallbacks
vmware_exporter_1  | --- <exception caught here> ---
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/twisted/internet/defer.py:654:_runCallbacks
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py:687:generate_latest_metrics
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/prometheus_client/exposition.py:63:generate_latest
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/prometheus_client/core.py:97:collect
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py:192:collect
vmware_exporter_1  | /usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py:564:_vmware_get_inventory
vmware_exporter_1  | ]
vmware_exporter_1  |
vmware_exporter_1  | Traceback (most recent call last):
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/internet/base.py", line 1276, in mainLoop
vmware_exporter_1  |     self.runUntilCurrent()
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/internet/base.py", line 902, in runUntilCurrent
vmware_exporter_1  |     call.func(*call.args, **call.kw)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 460, in callback
vmware_exporter_1  |     self._startRunCallbacks(result)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 568, in _startRunCallbacks
vmware_exporter_1  |     self._runCallbacks()
vmware_exporter_1  | --- <exception caught here> ---
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 654, in _runCallbacks
vmware_exporter_1  |     current.result = callback(current.result, *args, **kw)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 687, in generate_latest_metrics
vmware_exporter_1  |     output = generate_latest(registry)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/prometheus_client/exposition.py", line 63, in generate_latest
vmware_exporter_1  |     for metric in registry.collect():
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/prometheus_client/core.py", line 97, in collect
vmware_exporter_1  |     for metric in collector.collect():
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 192, in collect
vmware_exporter_1  |     host_inventory, ds_inventory = self._vmware_get_inventory(content)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 564, in _vmware_get_inventory
vmware_exporter_1  |     for host in folder.host:
vmware_exporter_1  | builtins.AttributeError: 'vim.Folder' object has no attribute 'host'
vmware_exporter_1  |
^CGracefully stopping... (press Ctrl+C again to force)
Stopping docker_vmware_exporter_1 ... done

and here is for 0.4.0

Status: Downloaded newer image for pryorda/vmware_exporter:v0.4.0
Recreating docker_vmware_exporter_1
Attaching to docker_vmware_exporter_1
vmware_exporter_1  | [2019-03-14 14:46:03.373203+00:00] Starting web server on port 9272
vmware_exporter_1  | [2019-03-14 14:46:06.318302+00:00] Start collecting metrics from kr01-vc01.tech.mosreg.ru
vmware_exporter_1  | [2019-03-14 14:46:06.409089+00:00] Starting inventory collection
vmware_exporter_1  | [2019-03-14 14:46:11.546790+00:00] Traceback (most recent call last):
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 650, in _async_render_GET
vmware_exporter_1  |     yield self.generate_latest_metrics(request)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
vmware_exporter_1  |     result = result.throwExceptionIntoGenerator(g)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
vmware_exporter_1  |     return g.throw(self.type, self.value, self.tb)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 689, in generate_latest_metrics
vmware_exporter_1  |     metrics = yield collector.collect()
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
vmware_exporter_1  |     result = result.throwExceptionIntoGenerator(g)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
vmware_exporter_1  |     return g.throw(self.type, self.value, self.tb)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 184, in collect
vmware_exporter_1  |     content,
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/python/threadpool.py", line 250, in inContext
vmware_exporter_1  |     result = inContext.theWork()
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/python/threadpool.py", line 266, in <lambda>
vmware_exporter_1  |     inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/python/context.py", line 122, in callWithContext
vmware_exporter_1  |     return self.currentContext().callWithContext(ctx, func, *args, **kw)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/twisted/python/context.py", line 85, in callWithContext
vmware_exporter_1  |     return func(*args,**kw)
vmware_exporter_1  |   File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 572, in _vmware_get_inventory
vmware_exporter_1  |     for host in folder.host:
vmware_exporter_1  | AttributeError: 'vim.Folder' object has no attribute 'host'
vmware_exporter_1  |
^CGracefully stopping... (press Ctrl+C again to force)

If you want I'm always ready for testing)
@pryorda

@pryorda
Copy link
Owner

pryorda commented Mar 23, 2019

We've been planning to update our infra so I'll probably start coding for this then.

@kremers
Copy link
Contributor

kremers commented May 21, 2019

Reproduced <class 'TypeError'>: Required field "querySpec" not provided (not @optional)

Following case:

  • No VMs available
  • Might be due to restricted rights
2019-05-21 11:27:04,218 ERROR:Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 845, in _async_render_GET
    yield self.generate_latest_metrics(request)
twisted.internet.defer.FirstError: FirstError[#1, [Failure instance: Traceback: <class 'twisted.internet.defer.FirstError'>: FirstError[#0, [Failure instance: Traceback: <class 'TypeError'>: Required field "querySpec" not provided (not @optional)
/usr/local/lib/python3.6/threading.py:916:_bootstrap_inner
/usr/local/lib/python3.6/threading.py:864:run
/usr/local/lib/python3.6/site-packages/twisted/_threads/_threadworker.py:46:work
/usr/local/lib/python3.6/site-packages/twisted/_threads/_team.py:190:doWork
--- <exception caught here> ---
/usr/local/lib/python3.6/site-packages/twisted/python/threadpool.py:250:inContext
/usr/local/lib/python3.6/site-packages/twisted/python/threadpool.py:266:<lambda>
/usr/local/lib/python3.6/site-packages/twisted/python/context.py:122:callWithContext
/usr/local/lib/python3.6/site-packages/twisted/python/context.py:85:callWithContext
/usr/local/lib/python3.6/site-packages/pyVmomi/VmomiSupport.py:706:<lambda>
/usr/local/lib/python3.6/site-packages/pyVmomi/VmomiSupport.py:511:_InvokeMethod
/usr/local/lib/python3.6/site-packages/pyVmomi/VmomiSupport.py:1041:CheckField
]]
--- <exception caught here> ---
/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py:602:_vmware_get_vm_perf_manager_metrics
/usr/local/lib/python3.6/site-packages/vmware_exporter/defer.py:99:parallelize
]]

2019-05-21 11:27:04,222 INFO:Fetched vim.Datastore inventory (0:00:00.377229)
2019-05-21 11:27:04,246 INFO:Finished vm metrics collection

@kremers
Copy link
Contributor

kremers commented May 21, 2019

TODO: Better error handling if "spec" is empty in line 602 because of no VMs discovered, we should print a info log message and not call to defer.

@kremers
Copy link
Contributor

kremers commented Jun 4, 2019

Should be fixed in latest PR

@pryorda
Copy link
Owner

pryorda commented Jun 7, 2019

@akurach Can you test?

@akurach
Copy link
Contributor

akurach commented Jun 18, 2019

@akurach Can you test?

I'l try it in a few days

@akurach
Copy link
Contributor

akurach commented Jun 28, 2019

in this config works

vmware_exporter:
    image: pryorda/vmware_exporter:v.0.9.5
    ports:
        - "9273:9272"
    environment:
        VSPHERE_HOST: "****"
        VSPHERE_USER: "***"
        VSPHERE_PASSWORD: "***"
        VSPHERE_IGNORE_SSL: "True"
        VSPHERE_COLLECT_VMS: "False"
        VSPHERE_COLLECT_VMGUESTS: "False"
    restart: always

I'll try to enable other options to check

@akurach
Copy link
Contributor

akurach commented Jun 28, 2019

tested on VMware ESXi, 6.7.0, 13644319
works ok all options.

@kremers
Copy link
Contributor

kremers commented Jun 28, 2019

/close

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

No branches or pull requests

5 participants