shinken-solutions / shinken

Flexible and scalable monitoring framework
http://www.shinken-monitoring.org
GNU Affero General Public License v3.0
1.13k stars 336 forks source link

Shinken fails to pip install with pip 7.1.2 #1713

Open gourneau opened 9 years ago

gourneau commented 9 years ago

When installing with the latest version of pip 7.1.2 the /etc/shinken directory is not created, and lots of other things are missing. This is the output of the install.

root@backbone:~# pip install shinken
Collecting shinken
/usr/local/lib/python2.7/dist-packages/pip-7.1.2-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading Shinken-2.4.tar.gz (26.7MB)
    100% |████████████████████████████████| 26.7MB 9.4kB/s
Building wheels for collected packages: shinken
  Running setup.py bdist_wheel for shinken
  Stored in directory: /root/.cache/pip/wheels/31/df/1e/fed41546be3224059d24968355fbfd1cebb09297f181556e7f
Successfully built shinken
Installing collected packages: shinken
Successfully installed shinken-2.4
/usr/local/lib/python2.7/dist-packages/pip-7.1.2-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning

However, the install works as expected with pip 1.5.4 (what python-pip currently has for Ubuntu 14.04)

naparuba commented 8 years ago

We will give a try.

antitoine commented 8 years ago

Hi,

I try to install shinken on new ubuntu server 16.04, and I have same issue.

Pip and python versions (fresh installed from ubuntu repo):

root@shinken-server:~# pip -V
pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)
root@shinken-server:~# python -V
Python 2.7.11+

After pip install, shinken seems to not be installed. Any update on this issue?

See pip install log in attachement : pip.txt

ser commented 8 years ago

Yeah, pip does not work and even worse, manual install is also broken. This is Ubuntu Xenial:

root@cela:~/shinken-2.4.3# python2 setup.py install
('updating path in %s', 'build/shinken.cfg')
running install
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/test-easy-install-6476.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /usr/local/lib/python2.7/dist-packages/

This directory does not currently exist.  Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).
ser commented 8 years ago

But reading file FOR_PACKAGERS I discovered that it's possible to manually specify the root directory, which installs shinken nearly correctly:

python setup.py install --root=/

Unfortunately you must play with file permissions manually after installation. What I did:

  1. uncommented user shinken in /etc/default/shinken
  2. chown -R shinken /var/log/shinken

BTW, I have installed also:

apt-get install python-cherrypy3

BEFORE shinken installation to use faster cherrypy

olivierHa commented 8 years ago

@ser , be careful, on Ubuntu Xenial, there is no python 2.7 installed.

I will try to reproduce this issue using Docker.

ser commented 8 years ago

there is, it's enough to install python-pip package to have fully working Python 2.7.11+ environment

I'm using an LXD container, BTW :)

ser commented 8 years ago

Full procedure of manual install in vanilla xenial lxd, because I'm doing it again:

# groupadd -g 888 shinken
# useradd -u 888 -g 888 shinken
# apt install python-setuptools python-wheel python-cherrypy3
# cd /usr/src
# git clone https://github.com/naparuba/shinken
# cd shinken
# python setup.py install --root=/
# chown -R shinken.shinken /var/log/shinken
# update-rc.d shinken defaults
# apt install monitoring-plugins
# apt clean
agustin-gomez-roca commented 7 years ago

Hi I'm not able to clone the git repository, any issue with it?

root@ubuntuprueba2:/usr/src# git clone https://github.com/naparuba/shinken
Cloning into 'shinken'...
fatal: unable to access 'https://github.com/naparuba/shinken/': gnutls_handshake() failed: Error in the push function.

I'm using Ubuntu 16.04 with the last available patches. Regards.

agustin-gomez-roca commented 7 years ago

I've bypassed the error by downloading the tar file and extracting it on /usr/src:

`root@ubuntuprueba2:/usr/src# cd shinken-2.4.3/

root@ubuntuprueba2:/usr/src/shinken-2.4.3# python setup.py install --root=/ Previous Shinken lib detected (/usr/local/lib/python2.7/dist-packages/shinken/init.pyc) running install ...`