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

collection failed - docker container #175

Closed
devinodaniel opened this issue Jan 23, 2020 · 4 comments
Closed

collection failed - docker container #175

devinodaniel opened this issue Jan 23, 2020 · 4 comments

Comments

@devinodaniel
Copy link

devinodaniel commented Jan 23, 2020

Hello, I'm unable to connect to vsphere using docker. Getting a generic "collection failed" in UI.

Any ideas? Thanks

Update: using vCenter 6.7 - possible bug?
Update 2: Mistakenly had the error as "Connection failed" when it is actually "Collection failed"

Docker command

docker run -it --rm --dns=10.10.10.10 -p 9272:9272 \ 
-e VSPHERE_USER="[email protected]"  \
-e VSPHERE_PASSWORD="XXXXX" \
-e VSPHERE_HOST="libsvrvctr01.internal.customdomain.com" \
-e VSPHERE_IGNORE_SSL=True -e VSPHERE_SPECS_SIZE=2000 \ 
--name vmware_exporter pryorda/vmware_exporter

Error log

2020-01-23 17:10:59,710 INFO:Starting web server on port 9272
2020-01-23 17:11:05,715 INFO:Start collecting metrics from libsvrvctr01.internal.customdomain.com
2020-01-23 17:11:05,715 INFO:Starting vm metrics collection
2020-01-23 17:11:05,715 INFO:Fetching vim.VirtualMachine inventory
2020-01-23 17:11:05,716 INFO:Retrieving service instance content
2020-01-23 17:11:05,719 INFO:START: _vmware_get_vm_perf_manager_metrics
2020-01-23 17:11:05,719 INFO:Fetching vim.Datastore inventory
2020-01-23 17:11:05,720 INFO:Starting host metrics collection
2020-01-23 17:11:05,720 INFO:Fetching vim.HostSystem inventory
2020-01-23 17:11:05,720 INFO:START: _vmware_get_host_perf_manager_metrics
2020-01-23 17:11:05,795 INFO:Retrieved service instance content
2020-01-23 17:11:06,030 INFO:Fetched vim.VirtualMachine inventory (0:00:00.315161)
2020-01-23 17:11:06,035 ERROR:Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py", line 997, in _async_render_GET
    yield self.generate_latest_metrics(request)
twisted.internet.defer.FirstError: FirstError[#1, [Failure instance: Traceback: <class 'TypeError'>: 'str' object cannot be interpreted as an integer
/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py:460:callback
/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py:568:_startRunCallbacks
/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py:654:_runCallbacks
/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py:1475:gotResult
--- <exception caught here> ---
/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py:1418:_inlineCallbacks
/usr/local/lib/python3.6/site-packages/vmware_exporter/vmware_exporter.py:640:_vmware_get_vm_perf_manager_metrics
]]

2020-01-23 17:11:06,049 INFO:Fetched vim.HostSystem inventory (0:00:00.329467)
2020-01-23 17:11:06,055 INFO:Fetched vim.Datastore inventory (0:00:00.335705)
2020-01-23 17:11:06,168 INFO:Finished vm metrics collection
2020-01-23 17:11:06,168 INFO:Finished host metrics collection
2020-01-23 17:11:06,168 INFO:FIN: _vmware_get_host_perf_manager_metric
@devinodaniel devinodaniel changed the title connection failed - docker container collection failed - docker container Jan 24, 2020
@devinodaniel
Copy link
Author

I have found that setting VSPHERE_COLLECT_VMS=False when starting the container allows me to collect metrics successfully. So something about collecting the VMs is throwing this error...

@devinodaniel
Copy link
Author

Okay the issue appears to be when including -e VSPHERE_SPECS_SIZE=2000 as I'm starting the docker container (as it is in the example). If I remove this and let it use the default of 5000, then my container starts and collects all metrics without error.

I believe this is because VSPHERE_SPECS_SIZE might be being parsed as a string instead of an integer... thus causing the above stated error:

<class 'TypeError'>: 'str' object cannot be interpreted as an integer

@dannyk81
Copy link
Collaborator

related to #174

@pryorda
Copy link
Owner

pryorda commented Feb 14, 2022

Closing due to inactivity.

@pryorda pryorda closed this as completed Feb 14, 2022
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

3 participants