ensky / taiga-contrib-ldap-auth

Taiga plugin for LDAP authentication
http://taiga.io
GNU Affero General Public License v3.0
54 stars 37 forks source link

HaltServer 'Worker failed to boot.' 3 #35

Open theodotos opened 8 years ago

theodotos commented 8 years ago

We have installed taiga successfully and we are now trying to setup ldap authentication. This is the Taiga version we are using:

root@taiga:/home/taiga/taiga-back# git log | head -4
commit 0f7e25b87016b2d6088bfdaa38c3c54a6dee005d
Author: Jesús Espino <jespinog@gmail.com>
Date:   Tue Jun 7 09:33:21 2016 +0200

This is our config:

# LDAP 
INSTALLED_APPS += ["taiga_contrib_ldap_auth"]

LDAP_SERVER = 'ldap://ldap.example.com'
LDAP_PORT = 389

# Full DN of the service account use to connect to LDAP server and search for login user's account entry
# If LDAP_BIND_DN is not specified, or is blank, then an anonymous bind is attempated
LDAP_BIND_DN = 'cn=taiga,ou=services,dc=example,dc=com'
LDAP_BIND_PASSWORD = 'MySecretPass'   # eg.
# Starting point within LDAP structure to search for login user
LDAP_SEARCH_BASE = 'ou=people,dc=example,dc=com'
# LDAP property used for searching, ie. login username needs to match value in sAMAccountName property in LDAP
LDAP_SEARCH_PROPERTY = 'uid'
LDAP_SEARCH_SUFFIX = None # '@example.com'

# Names of LDAP properties on user account to get email and full name
LDAP_EMAIL_PROPERTY = 'mail'
LDAP_FULL_NAME_PROPERTY = 'cn'

I have tested ldap connectivity with ldapsearch and it works correctly.

When I enable the ldap plugin I get:

Trying import local.py settings...
Trying import local.py settings...
Trying import local.py settings...
Traceback (most recent call last):
  File "/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/gunicorn/arbiter.py", line 184, in run
    self.sleep()
  File "/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/gunicorn/arbiter.py", line 317, in sleep
    ready = select.select([self.PIPE[0]], [], [], 1.0)
  File "/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/gunicorn/arbiter.py", line 219, in handle_chld
    self.reap_workers()
  File "/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/gunicorn/arbiter.py", line 464, in reap_workers
    raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/taiga/.virtualenvs/taiga/bin/gunicorn", line 11, in <module>
    sys.exit(run())
  File "/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
    WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
  File "/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/gunicorn/app/base.py", line 192, in run
    super(Application, self).run()
  File "/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/gunicorn/app/base.py", line 72, in run
    Arbiter(self).run()
  File "/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/gunicorn/arbiter.py", line 206, in run
    self.halt(reason=inst.reason, exit_status=inst.exit_status)
  File "/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/gunicorn/arbiter.py", line 302, in halt
    self.stop()
  File "/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/gunicorn/arbiter.py", line 347, in stop
    time.sleep(0.1)
  File "/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/gunicorn/arbiter.py", line 219, in handle_chld
    self.reap_workers()
  File "/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/gunicorn/arbiter.py", line 464, in reap_workers
    raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
[2016-07-30 04:59:30 -0400] [14852] [INFO] Starting gunicorn 19.4.5
[2016-07-30 04:59:30 -0400] [14852] [INFO] Listening at: http://127.0.0.1:8001 (14852)
[2016-07-30 04:59:30 -0400] [14852] [INFO] Using worker: sync
[2016-07-30 04:59:30 -0400] [14872] [INFO] Booting worker with pid: 14872
[2016-07-30 04:59:30 -0400] [14874] [INFO] Booting worker with pid: 14874
[2016-07-30 04:59:30 -0400] [14876] [INFO] Booting worker with pid: 14876

and the system keeps restarting...

Am I doing something wrong?

nkhdiscovery commented 7 years ago

Take a look at this: https://github.com/taigaio/taiga-back/issues/282 add --log-level debug --preload to args in section [watcher:taiga] in your /etc/circus/conf.d/taiga.ini file, or whatever its name is. Then:

circusctl reloadconfig
circusctl reload taiga

so you may get a prettier log and find the problem. I had a messy installation by someone else and I had to repair the system, this way I just found celery is not installed. Simple.

theodotos commented 7 years ago

Thanks for the feedback @nkhdiscovery. Now we are getting somewhere:

ImportError: No module named 'taiga_contrib_ldap_auth'

I installed taiga_contrib_ldap_auth without errors using:

pip3 install taiga-contrib-ldap-auth

When using pip (python2.7) I get:


...
Installed /tmp/pip-build-DsIVkd/taiga-contrib-ldap-auth/.eggs/versiontools-1.9.1-py2.7.egg

Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip-build-DsIVkd/taiga-contrib-ldap-auth/setup.py", line 34, in <module>

    'Topic :: Internet :: WWW/HTTP',

  File "/usr/lib/python2.7/distutils/core.py", line 111, in setup

    _setup_distribution = dist = klass(attrs)

  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 272, in __init__

    _Distribution.__init__(self,attrs)

  File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__

    self.finalize_options()

  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 327, in finalize_options

    ep.load()(self, ep.name, value)

  File "build/bdist.linux-x86_64/egg/versiontools/setuptools_hooks.py", line 64, in version

  File "build/bdist.linux-x86_64/egg/versiontools/__init__.py", line 234, in from_expression

  File "/tmp/pip-build-DsIVkd/taiga-contrib-ldap-auth/taiga_contrib_ldap_auth/__init__.py", line 2

SyntaxError: Non-ASCII character '\xc3' in file /tmp/pip-build-DsIVkd/taiga-contrib-ldap-auth/taiga_contrib_ldap_auth/__init__.py on line 2, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-DsIVkd/taiga-contrib-ldap-auth
Storing debug log for failure in /root/.pip/pip.log

Looks like a python vs python3 issue. Any idea?

References

keekeiz commented 7 years ago

I encountered the same issue. After investigating the issue, I found, in my host, the issue was related to the PATH setting in env. I checked the ldap module, no ldap module was found under the path '.virtualenvs/taiga/lib/python3.5/site-packages/' As issue 282[https://github.com/taigaio/taiga-back/issues/282] mentioned, we need to use right python version which located in the right place. Following the guide saying, I set the PATH as the following: PATH=/home/dev/.virtualenvs/taiga/bin:$PATH when I run "which pip3" , however I found it still pointed to /usr/local/bin or ~/.local/bin directory.

Then I added "/home/dev/.virtualenvs/taiga/bin" as the first path, rerun "pip3 install taiga-contrib-ldap-auth". In the end, I can run the taiga successfully and login with ldap.

Also, I found, after reload the server , the PATH in env keep always set without "/home/dev/.virtualenvs/taiga/bi" as the first, but not sure how to fix it.