dnaeon / py-vpoller

Distributed vSphere API Proxy
Other
83 stars 31 forks source link

AttributeError: 'module' object has no attribute 'SSLContext' #251

Closed rockaut closed 6 years ago

rockaut commented 6 years ago

I tried to update the Dockerfile to new Zabbix Proxy 3.4.10 as the Version Proxy 3.4.7 isn't compatible to Server 3.4.10.

But i get some python errors on startup, and no vPoller-Worker or Proxy connection after that. Zabbix Proxy is communicating without troubles.

[2018-06-28 11:42:03,535 - INFO/MainProcess] Starting Worker Manager [0.7.1 release] [2018-06-28 11:42:03,536 - INFO/MainProcess] Starting Worker processes [2018-06-28 11:42:03,536 - INFO/MainProcess] Concurrency: 4 (processes) [2018-06-28 11:42:03,537 - INFO/VPollerWorker-1] Worker process is starting [2018-06-28 11:42:03,538 - INFO/VPollerWorker-1] Loading task module vpoller.vsphere.tasks [2018-06-28 11:42:03,539 - INFO/VPollerWorker-2] Worker process is starting [2018-06-28 11:42:03,539 - INFO/VPollerWorker-2] Loading task module vpoller.vsphere.tasks 317:20180628:114203.539 current database version (mandatory/optional): 03040000/03040007 317:20180628:114203.540 required mandatory version: 03040000 [2018-06-28 11:42:03,542 - INFO/VPollerWorker-1] Loading helper module vpoller.helpers.zabbix [2018-06-28 11:42:03,542 - INFO/VPollerWorker-3] Worker process is starting [2018-06-28 11:42:03,542 - INFO/VPollerWorker-3] Loading task module vpoller.vsphere.tasks [2018-06-28 11:42:03,542 - INFO/VPollerWorker-2] Loading helper module vpoller.helpers.zabbix [2018-06-28 11:42:03,543 - INFO/VPollerWorker-1] Loading helper module vpoller.helpers.czabbix [2018-06-28 11:42:03,542 - INFO/MainProcess] Worker Manager is ready and running [2018-06-28 11:42:03,543 - INFO/VPollerWorker-1] Creating Worker sockets [2018-06-28 11:42:03,543 - INFO/VPollerWorker-2] Loading helper module vpoller.helpers.czabbix [2018-06-28 11:42:03,543 - INFO/VPollerWorker-4] Worker process is starting [2018-06-28 11:42:03,543 - INFO/VPollerWorker-2] Creating Worker sockets [2018-06-28 11:42:03,543 - INFO/VPollerWorker-4] Loading task module vpoller.vsphere.tasks Process VPollerWorker-1: Traceback (most recent call last): File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "build/bdist.linux-x86_64/egg/vpoller/worker.py", line 393, in run Process VPollerWorker-2: Traceback (most recent call last): File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "build/bdist.linux-x86_64/egg/vpoller/worker.py", line 393, in run self.create_agents() File "build/bdist.linux-x86_64/egg/vpoller/worker.py", line 621, in create_agents cache_housekeeping=self.config.get('cache_housekeeping') File "/usr/local/lib/python2.7/dist-packages/vconnector/core.py", line 100, in __init__ self.create_agents() File "build/bdist.linux-x86_64/egg/vpoller/worker.py", line 621, in create_agents cache_housekeeping=self.config.get('cache_housekeeping') File "/usr/local/lib/python2.7/dist-packages/vconnector/core.py", line 100, in __init__ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) AttributeError: 'module' object has no attribute 'SSLContext' AttributeError: 'module' object has no attribute 'SSLContext' [2018-06-28 11:42:03,545 - INFO/VPollerWorker-3] Loading helper module vpoller.helpers.zabbix [2018-06-28 11:42:03,545 - INFO/VPollerWorker-4] Loading helper module vpoller.helpers.zabbix [2018-06-28 11:42:03,546 - INFO/VPollerWorker-3] Loading helper module vpoller.helpers.czabbix [2018-06-28 11:42:03,546 - INFO/VPollerWorker-4] Loading helper module vpoller.helpers.czabbix [2018-06-28 11:42:03,546 - INFO/VPollerWorker-4] Creating Worker sockets [2018-06-28 11:42:03,546 - INFO/VPollerWorker-3] Creating Worker sockets Process VPollerWorker-3: Traceback (most recent call last): File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap 317:20180628:114203.548 proxy #0 started [main process] Process VPollerWorker-4: self.run() Traceback (most recent call last): File "build/bdist.linux-x86_64/egg/vpoller/worker.py", line 393, in run File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "build/bdist.linux-x86_64/egg/vpoller/worker.py", line 393, in run 332:20180628:114203.549 proxy #1 started [configuration syncer #1] 333:20180628:114203.549 proxy #2 started [heartbeat sender #1] self.create_agents() File "build/bdist.linux-x86_64/egg/vpoller/worker.py", line 621, in create_agents cache_housekeeping=self.config.get('cache_housekeeping') File "/usr/local/lib/python2.7/dist-packages/vconnector/core.py", line 100, in __init__ self.create_agents() File "build/bdist.linux-x86_64/egg/vpoller/worker.py", line 621, in create_agents cache_housekeeping=self.config.get('cache_housekeeping') File "/usr/local/lib/python2.7/dist-packages/vconnector/core.py", line 100, in __init__ 334:20180628:114203.549 proxy #3 started [data sender #1] 335:20180628:114203.549 proxy #4 started [housekeeper #1] ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) AttributeError: 'module' object has no attribute 'SSLContext' ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) AttributeError: 'module' object has no attribute 'SSLContext'

Weird thing is. All i'm changin is the Zabbix Version in Dockerfile:

`FROM 'zabbix/zabbix-proxy-sqlite3:ubuntu-3.4.10'

ENV ZBX_SOURCE_VERSION 3.4.10`

If i leave them at 3.4.7 all works well. So it has to be something with the Zabbix Module i guess.

rockaut commented 6 years ago

certifi==2018.4.16 chardet==3.0.4 colorama==0.2.5 docopt==0.6.2 html5lib==0.999 idna==2.7 meld3==0.6.10 pyvmomi==6.7.0 PyYAML==4.1 pyzabbix==0.7.4 pyzmq==17.0.0 requests==2.19.1 six==1.11.0 supervisor==3.0b2 tabulate==0.8.2 urllib3==1.23 vconnector==0.5.0 vpoller==0.7.1

rockaut commented 6 years ago

I may have found it in the old issue #180 ... currently it seems Python 2.7.6 is active in zabbix-proxy image.

rockaut commented 6 years ago

I tried to get it to 2.7.9 but it didn't work. Don't know how to fix that. I opened an Issue in Zabbix Docker Rep as 14.04 is very old now and hope the may update the source image itself.

As a workaround i will try the oder distribution-images

dnaeon commented 6 years ago

What was the issue with 2.7.9?

As you noted already the cause of the exception is an old Python, which is no longer supported.

rockaut commented 6 years ago

I tried to install it from source but got multiple errors. Haven't had much time to completely work it out. Also I have to admit that I really would like to see the source problem fixed which is the old base image of zabbix proxy.

May you please leave that issue open so I can close it with PR after fix.

Marin Atanasov Nikolov notifications@github.com schrieb am Do., 28. Juni 2018, 18:57:

What was the issue with 2.7.9?

As you noted already the cause of the exception is an old Python, which is no longer supported.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dnaeon/py-vpoller/issues/251#issuecomment-401103507, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbq-L_ijuXJXcgsGxitUJLF7xfxiCYKks5uBQsKgaJpZM4U7Py7 .

--

Live long and prosper 🖖

Markus

dnaeon commented 6 years ago

Sure, will leave it open.

Let me know when you find the root cause. Might also be useful to others to provide a link to the Zabbix proxy issue as well, so we can keep track of it.

Thanks, Marin

rockaut commented 6 years ago

You're right: https://github.com/zabbix/zabbix-docker/issues/328

Would help if some vote there too.

rockaut commented 6 years ago

https://github.com/zabbix/zabbix-docker/issues/328 is now fixed. Already have a working new Buildfile - will upload later today.

rockaut commented 6 years ago

Issue can be closed