Closed WillianPessoa closed 6 years ago
Hi! Thanks for report.
Which version of this plugin are you running? Could you please paste the command output:
pip show conan-ldap-authentication
Your error shows the module as absent or not installed. Looks like some python2/3 environment problem.
I am using python2.7 in a CentOS6.
The output from command pip show conan-ldap-authentication
:
Version: 0.2.0
Summary: LDAP authenticator for Conan C/C++ package manager
Home-page: https://github.com/uilianries/conan-ldap-authentication
Author: Uilian Ries
Author-email: uilianries@gmail.com
License: MIT
Location: /usr/lib/python2.7/site-packages
Requires: pyldap, configparser
I am using Conan 1.1.0. Follow the output from comman pip show conan
:
Name: conan
Version: 1.1.0.dev0
Summary: Conan C/C++ package manager
Home-page: https://conan.io
Author: JFrog LTD
Author-email: luism@jfrog.com
License: MIT
Location: /usr/lib/python2.7/site-packages
Requires: PyJWT, requests, colorama, PyYAML, patch, fasteners, six, node-semver, distro, pylint, future, pygments, astroid, bottle, pluginbase
Okay, I presume that you are running Conan 1.0.1, right?
I don't have CentOS6 here, but I'll use a Docker image to simulate the same scenario.
Hi again!
I just created a gist that reproduces a complete CentOS 6 + Conan + Conan LDAP Authentication:
Following these steps, all works fine, you could test running:
$ docker build -t conan/centos6 .
$ docker run -p 9300:9300 conan/centos6
$ conan remote add local http://0.0.0.0:9300`
$ conan user -r local -p password read-only-admin
This test is very simple, just start a default conan server and execute LDAP authentication at forumsys
However, I was able to see your error twice: 1) When I install ldap-authentication, before to run conan_server once. It's really necessary to run at least conan_server once, before to install ldap-authentication, because only after to run, conan will populate ~/.conan_server/
2) When I uninstall Conan and reinstall it again, after to install ldap-authentication. Once installed again, the plugin folder will be empty, so you need to reinstall ldap-authentication as well:
# pip install -U --force-reinstall conan-ldap-authentication
Concluding, I think that you need to reinstall ldap-authentication to populate the plugin folder. Otherwise, the docker scenario works pretty well. Also, I'll update the README about this case.
@WillianPessoa Any update?
Sorry for the delay.
I followed your instructions, but the plugins folder was not created in .conan_server
folder located in my home.
I found the problem when I checked the root folder. The conan-ldap-authentication create plugins folder in root's home (/root/.conan_server/plugins
) instead create it in /home/myuser/.conan_server
.
I copy plugins
folder from /root/.conan_server/
to /home/myuser/.conan_server
and all works fine.
I installed conan and conan-ldap-authentication using my personal user. I think that conan-ldap-authentication should create plugins
folder in my home instead root's home.
Thanks for your answer. You found a bug :bug:
As far as I remember, I have used ${home} to put the file. However, after new releases, Conan provided a good API to retrieve where I should put my files. I'll release a new patch ASAP.
I just released a new patch. I changed some order during installation to avoid your problem again.
Reading again your comment:
I found the problem when I checked the root folder. The conan-ldap-authentication create plugins folder in root's home (/root/.conan_server/plugins) instead create it in /home/myuser/.conan_server.
Maybe you installed the ldap plugin as root. When the setup.py is executed, it retrieves the user's home. If you run by sudo command, it will be able to solve your user home, however, if you elevate to root before to install, it will install at /root.
I can't figure out some way to solve this. Conan server dir could be present for any user on your system. So, if you are interested to install for your user, you could use sudo
or virtualenv
.
This information is important and I need to update on README.
Regards.
Sorry for the delay.
I will install Conan and Conan-ldap-authentication in other machine with Centos06 tomorrow and I will give the results to you.
Many thanks!
I need to do a retification. My CentOS version is 6.9 and not 6.
After installed conan-ldap-authentication
using my personal user and using the command sudo, the plugins directory was created in /root/conan_server
.
I followed all steps/instructions to install conan
and conan-ldap-authentication
in your gist, but the result was the same.
Check the output from the command sudo pip2.7 install conan-ldap-authentication==0.2.0
:
[centos@localhost]$ sudo pip2.7 install conan-ldap-authentication==0.2.0
Collecting conan-ldap-authentication==0.2.0
Downloading conan_ldap_authentication-0.2.0.tar.gz
Collecting pyldap>=2.4.28 (from conan-ldap-authentication==0.2.0)
Downloading pyldap-2.4.45.tar.gz (304kB)
100% |████████████████████████████████| 307kB 711kB/s
Requirement already satisfied: configparser>=3.5.0 in /usr/local/lib/python2.7/site-packages (from conan-ldap-authentication==0.2.0)
Requirement already satisfied: setuptools in /usr/local/lib/python2.7/site-packages (from pyldap>=2.4.28->conan-ldap-authentication==0.2.0)
Building wheels for collected packages: conan-ldap-authentication, pyldap
Running setup.py bdist_wheel for conan-ldap-authentication ... error
Complete output from command /usr/local/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-UjPS_j/conan-ldap-authentication/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpjMWyTxpip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/conan
copying conan/__init__.py -> build/lib/conan
copying conan/ldap_authentication.py -> build/lib/conan
creating build/lib/conan/test
copying conan/test/__init__.py -> build/lib/conan/test
copying conan/test/test_authentication.py -> build/lib/conan/test
copying conan/requirements_test.txt -> build/lib/conan
copying conan/requirements.txt -> build/lib/conan
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/conan
copying build/lib/conan/__init__.py -> build/bdist.linux-x86_64/wheel/conan
copying build/lib/conan/ldap_authentication.py -> build/bdist.linux-x86_64/wheel/conan
copying build/lib/conan/requirements_test.txt -> build/bdist.linux-x86_64/wheel/conan
creating build/bdist.linux-x86_64/wheel/conan/test
copying build/lib/conan/test/__init__.py -> build/bdist.linux-x86_64/wheel/conan/test
copying build/lib/conan/test/test_authentication.py -> build/bdist.linux-x86_64/wheel/conan/test
copying build/lib/conan/requirements.txt -> build/bdist.linux-x86_64/wheel/conan
running install_data
creating build/bdist.linux-x86_64/wheel/conan_ldap_authentication-0.2.0.data
creating build/bdist.linux-x86_64/wheel/conan_ldap_authentication-0.2.0.data/data
creating build/bdist.linux-x86_64/wheel/root
creating build/bdist.linux-x86_64/wheel/root/.conan_server
creating build/bdist.linux-x86_64/wheel/root/.conan_server/plugins
creating build/bdist.linux-x86_64/wheel/root/.conan_server/plugins/authenticator
copying conan/ldap_authentication.py -> build/bdist.linux-x86_64/wheel/root/.conan_server/plugins/authenticator
running install_egg_info
running egg_info
writing requirements to conan_ldap_authentication.egg-info/requires.txt
writing conan_ldap_authentication.egg-info/PKG-INFO
writing top-level names to conan_ldap_authentication.egg-info/top_level.txt
writing dependency_links to conan_ldap_authentication.egg-info/dependency_links.txt
reading manifest file 'conan_ldap_authentication.egg-info/SOURCES.txt'
writing manifest file 'conan_ldap_authentication.egg-info/SOURCES.txt'
Copying conan_ldap_authentication.egg-info to build/bdist.linux-x86_64/wheel/conan_ldap_authentication-0.2.0-py2.7.egg-info
running install_scripts
error: [Errno 2] No such file or directory: '/root/.conan_server/plugins/authenticator/ldap_authentication.py'
----------------------------------------
Failed building wheel for conan-ldap-authentication
Running setup.py clean for conan-ldap-authentication
Running setup.py bdist_wheel for pyldap ... done
Stored in directory: /root/.cache/pip/wheels/0c/a3/42/e6127de64a53567a11c4e3ee5991547cb8f5a3241d2d67947e
Successfully built pyldap
Failed to build conan-ldap-authentication
Installing collected packages: pyldap, conan-ldap-authentication
Running setup.py install for conan-ldap-authentication ... done
Successfully installed conan-ldap-authentication-0.2.0 pyldap-2.4.45
[centos@localhost ~]$ cd .conan_server/
[centos@localhost .conan_server]$ ls
data server.conf version.txt
[centos@localhost .conan_server]$ sudo ls /root/.conan_server
plugins
I could create a gist to reproduce all installation process if you want to.
Please, this will help to understand.
I'll try using CentOS 6.9
Hi!
I was able to reproduce your problem.
When I created a non-root user, and run sudo pip install, the expanduser collected /root
as home.
I'll release the patch 0.2.3 soon. Thanks again for report this problem.
Done! I think this issue is fixed. Please, check again when possible.
It works!
[centos@ee7ccfb096cd conan-ldap-authentication]$ sudo pip2.7 install .
Processing /home/centos/sources/conan-ldap-authentication
Requirement already satisfied: pyldap>=2.4.28 in /usr/local/lib/python2.7/site-packages (from conan-ldap-authentication==0.2.3)
Requirement already satisfied: configparser>=3.5.0 in /usr/local/lib/python2.7/site-packages (from conan-ldap-authentication==0.2.3)
Requirement already satisfied: conan>=0.24.0 in /usr/local/lib/python2.7/site-packages (from conan-ldap-authentication==0.2.3)
Requirement already satisfied: setuptools in /usr/local/lib/python2.7/site-packages (from pyldap>=2.4.28->conan-ldap-authentication==0.2.3)
Requirement already satisfied: astroid<1.7,>=1.6 in /usr/local/lib/python2.7/site-packages (from conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: PyYAML<3.13.0,>=3.11 in /usr/local/lib/python2.7/site-packages (from conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: distro<1.2.0,>=1.0.2 in /usr/local/lib/python2.7/site-packages (from conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: future==0.16.0 in /usr/local/lib/python2.7/site-packages (from conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: node-semver==0.2.0 in /usr/local/lib/python2.7/site-packages (from conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: PyJWT<2.0.0,>=1.4.0 in /usr/local/lib/python2.7/site-packages (from conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: pylint<1.9.0,>=1.8.1 in /usr/local/lib/python2.7/site-packages (from conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: pygments<3.0,>=2.0 in /usr/local/lib/python2.7/site-packages (from conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: pluginbase<1.0,>=0.5 in /usr/local/lib/python2.7/site-packages (from conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: requests<3.0.0,>=2.7.0 in /usr/local/lib/python2.7/site-packages (from conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: fasteners>=0.14.1 in /usr/local/lib/python2.7/site-packages (from conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: bottle<0.13,>=0.12.8 in /usr/local/lib/python2.7/site-packages (from conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: colorama<0.4.0,>=0.3.3 in /usr/local/lib/python2.7/site-packages (from conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: patch==1.16 in /usr/local/lib/python2.7/site-packages (from conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: six>=1.10.0 in /usr/local/lib/python2.7/site-packages (from conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: enum34>=1.1.3; python_version < "3.4" in /usr/local/lib/python2.7/site-packages (from astroid<1.7,>=1.6->conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: lazy-object-proxy in /usr/local/lib/python2.7/site-packages (from astroid<1.7,>=1.6->conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: singledispatch; python_version < "3.4" in /usr/local/lib/python2.7/site-packages (from astroid<1.7,>=1.6->conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: backports.functools-lru-cache; python_version < "3.4" in /usr/local/lib/python2.7/site-packages (from astroid<1.7,>=1.6->conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: wrapt in /usr/local/lib/python2.7/site-packages (from astroid<1.7,>=1.6->conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: isort>=4.2.5 in /usr/local/lib/python2.7/site-packages (from pylint<1.9.0,>=1.8.1->conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: mccabe in /usr/local/lib/python2.7/site-packages (from pylint<1.9.0,>=1.8.1->conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python2.7/site-packages (from requests<3.0.0,>=2.7.0->conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python2.7/site-packages (from requests<3.0.0,>=2.7.0->conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/local/lib/python2.7/site-packages (from requests<3.0.0,>=2.7.0->conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/local/lib/python2.7/site-packages (from requests<3.0.0,>=2.7.0->conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: monotonic>=0.1 in /usr/local/lib/python2.7/site-packages (from fasteners>=0.14.1->conan>=0.24.0->conan-ldap-authentication==0.2.3)
Requirement already satisfied: futures; python_version == "2.7" in /usr/local/lib/python2.7/site-packages (from isort>=4.2.5->pylint<1.9.0,>=1.8.1->conan>=0.24.0->conan-ldap-authentication==0.2.3)
Building wheels for collected packages: conan-ldap-authentication
Running setup.py bdist_wheel for conan-ldap-authentication ... error
Complete output from command /usr/local/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-tVwU6T-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpTr52hNpip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/conan
copying conan/ldap_authentication.py -> build/lib/conan
copying conan/__init__.py -> build/lib/conan
creating build/lib/conan/test
copying conan/test/test_conan_authentication.py -> build/lib/conan/test
copying conan/test/configuration_file.py -> build/lib/conan/test
copying conan/test/__init__.py -> build/lib/conan/test
copying conan/test/test_authentication.py -> build/lib/conan/test
copying conan/requirements.txt -> build/lib/conan
copying conan/requirements_test.txt -> build/lib/conan
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/conan
creating build/bdist.linux-x86_64/wheel/conan/test
copying build/lib/conan/test/test_conan_authentication.py -> build/bdist.linux-x86_64/wheel/conan/test
copying build/lib/conan/test/configuration_file.py -> build/bdist.linux-x86_64/wheel/conan/test
copying build/lib/conan/test/__init__.py -> build/bdist.linux-x86_64/wheel/conan/test
copying build/lib/conan/test/test_authentication.py -> build/bdist.linux-x86_64/wheel/conan/test
copying build/lib/conan/ldap_authentication.py -> build/bdist.linux-x86_64/wheel/conan
copying build/lib/conan/requirements.txt -> build/bdist.linux-x86_64/wheel/conan
copying build/lib/conan/requirements_test.txt -> build/bdist.linux-x86_64/wheel/conan
copying build/lib/conan/__init__.py -> build/bdist.linux-x86_64/wheel/conan
running install_data
creating build/bdist.linux-x86_64/wheel/conan_ldap_authentication-0.2.3.data
creating build/bdist.linux-x86_64/wheel/conan_ldap_authentication-0.2.3.data/data
creating build/bdist.linux-x86_64/wheel/home
creating build/bdist.linux-x86_64/wheel/home/centos
creating build/bdist.linux-x86_64/wheel/home/centos/.conan_server
creating build/bdist.linux-x86_64/wheel/home/centos/.conan_server/plugins
creating build/bdist.linux-x86_64/wheel/home/centos/.conan_server/plugins/authenticator
copying conan/ldap_authentication.py -> build/bdist.linux-x86_64/wheel/home/centos/.conan_server/plugins/authenticator
running install_egg_info
running egg_info
creating conan_ldap_authentication.egg-info
writing requirements to conan_ldap_authentication.egg-info/requires.txt
writing conan_ldap_authentication.egg-info/PKG-INFO
writing top-level names to conan_ldap_authentication.egg-info/top_level.txt
writing dependency_links to conan_ldap_authentication.egg-info/dependency_links.txt
writing manifest file 'conan_ldap_authentication.egg-info/SOURCES.txt'
reading manifest file 'conan_ldap_authentication.egg-info/SOURCES.txt'
writing manifest file 'conan_ldap_authentication.egg-info/SOURCES.txt'
Copying conan_ldap_authentication.egg-info to build/bdist.linux-x86_64/wheel/conan_ldap_authentication-0.2.3-py2.7.egg-info
running install_scripts
error: [Errno 2] No such file or directory: '/home/centos/.conan_server/plugins/authenticator/ldap_authentication.py'
----------------------------------------
Failed building wheel for conan-ldap-authentication
Running setup.py clean for conan-ldap-authentication
Failed to build conan-ldap-authentication
Installing collected packages: conan-ldap-authentication
Running setup.py install for conan-ldap-authentication ... done
Successfully installed conan-ldap-authentication-0.2.3
[centos@ee7ccfb096cd conan-ldap-authentication]$ ls ~/.conan_server/
data plugins server.conf version.txt
Thanks! <3
Enjoy! :D
Hello,
I'm trying to set up a conan server with ldap authentication, but I find this error:
The file
server.conf
is correctly configured:and the
ldap_authentication.conf
is correctly configured too:Do I need to do anything else for the conan server to recognise the ldap plugin?