28

I installed elastic search curator via the following command.

sudo pip install -U elasticsearch-curator

It all installed OK.

However now when I do the following

curator_cli --version

I get the following dependency warning.

 /usr/local/lib/python2.7/dist-packages/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)
curator_cli, version 5.5.4

How do I either fix the warning or hide it?

Hoseong Jeon
  • 1,240
  • 2
  • 12
  • 20
Robbo_UK
  • 11,351
  • 25
  • 81
  • 117

2 Answers2

90

So took a couple of things for me to get this working.

First I upgraded cyptography as per Mufeeds suggestion

sudo pip install --upgrade cryptography

This then gave me a new error everytime I did pip <any command>

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 7, in <module>
    from pip._internal import main
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/__init__.py", line 42, in <module>
    from pip._internal import cmdoptions
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cmdoptions.py", line 16, in <module>
    from pip._internal.index import (
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/index.py", line 15, in <module>
    from pip._vendor import html5lib, requests, six
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py", line 86, in <module>
    from pip._vendor.urllib3.contrib import pyopenssl
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/urllib3/contrib/pyopenssl.py", line 46, in <module>
    import OpenSSL.SSL
  File "/usr/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in <module>
    SSL_ST_INIT = _lib.SSL_ST_INIT
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

Resolved this by resintalling PyOpenSSL

sudo python -m easy_install --upgrade pyOpenSSL

Curator is now working as expected without the warnings

curator_cli --version
> curator_cli, version 5.5.4
Robbo_UK
  • 11,351
  • 25
  • 81
  • 117
  • What version of Python are you using? Anything older than Python 2.7.9 is likely to have issues, as there are SNI and other SSL complications. Travis CI tests Curator with the most recent patch levels of 2.7, 3.5, and 3.6. I'll be adding 3.7 support soon. – untergeek Jul 11 '18 at 15:16
  • Running on Python 2.7.13. – Robbo_UK Jul 11 '18 at 16:19
  • 1
    How was this installed on which operating system? Very strange that a 2.7.13 Python wouldn't have the appropriate modules updated. – untergeek Jul 12 '18 at 16:42
  • installed it all with sudo apt install – Robbo_UK Jul 18 '18 at 08:38
  • On which operating system? I can see that it's Debian or Debian derived. – untergeek Jul 19 '18 at 13:34
  • ubuntu 16 I think. was a while ago now – Robbo_UK Dec 11 '18 at 13:55
  • 1
    In all honesty, if you are using Ubuntu or Debian, I'd recommend using Elastic's provided DEB packages, which are stand-alone (i.e. will not interfere with system Python in any way) and built with a very recent version of Python. There is a repo and a direct download available: https://www.elastic.co/guide/en/elasticsearch/client/curator/current/apt-repository.html#_direct_package_download_link – untergeek Dec 11 '18 at 16:02
  • im pretty sure I did use that - I followed steps on the elastic website. Maybe the issue here is that I already had python and some kind of conflict arose. However its a while ago now and the ubuntu versions have changes. – Robbo_UK Dec 12 '18 at 13:07
0

This 1st step below will update cryptography, but break pyopenssl.

sudo pip install --upgrade cryptography

We can fix that by removing the pyopennssl library and use pip to reinstall.

sudo rm -rf /usr/lib/python2.7/dist-packages/OpenSSL
sudo rm -rf /usr/lib/python2.7/dist-packages/pyOpenSSL-0.15.1.egg-info
sudo pip install pyopenssl --upgrade
sudo pip install cryptography --upgrade

The last line will produce an error if the open sll library were to still be broken, so this validates all should be well...

My preference is to avoid another package manage like easy install in the mix, so sharing this in case that is anyone else's preference as well.

openCivilisation
  • 796
  • 1
  • 8
  • 25