Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDAP/AD Cannot set port #3847

Closed
sebv004 opened this issue May 29, 2019 · 1 comment
Closed

LDAP/AD Cannot set port #3847

sebv004 opened this issue May 29, 2019 · 1 comment

Comments

@sebv004
Copy link

sebv004 commented May 29, 2019

Issue Summary

Cannot conf ldap/ad successfully. I got error message: raise LDAPInvalidPortError('port must be an integer').

Steps to Reproduce

Here is my env file:
PYTHONUNBUFFERED=0 REDASH_LOG_LEVEL=INFO REDASH_REDIS_URL=redis://redis:6379/0 POSTGRES_PASSWORD=OCWMxNEyOTyHgx3f890oDvCLFnpWOmgr REDASH_COOKIE_SECRET=TUd0v0ZX89MkWNCQFZdqz1SQxk0xqBA9 REDASH_DATABASE_URL=postgresql://postgres:OCWMxNEyOTyHgx3f890oDvCLFnpWOmgr@postgres/postgres REDASH_LDAP_LOGIN_ENABLED=true REDASH_LDAP_URL="10.1.33.22:389" REDASH_LDAP_BIND_DN="MYDOMAIN\\myuser" REDASH_LDAP_BIND_DN_PASSWORD="mypwd" REDASH_LDAP_DISPLAY_NAME_KEY="displayName" REDASH_LDAP_EMAIL_KEY="mail" REDASH_LDAP_CUSTOM_USERNAME_PROMPT="Please enter domain account:" REDASH_LDAP_SEARCH_TEMPLATE="(sAMAccountName=%(username)s)" REDASH_LDAP_SEARCH_DN="CN=redash,OU=Groups,OU=myou,DC=myorg,DC=local"

Here is error log:
server_1 | [2019-05-29 13:03:59,988] ERROR in app: Exception on /ldap/login [POST] server_1 | Traceback (most recent call last): server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1988, in wsgi_app server_1 | response = self.full_dispatch_request() server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1641, in full_dispatch_request server_1 | rv = self.handle_user_exception(e) server_1 | File "/usr/local/lib/python2.7/dist-packages/flask_restful/__init__.py", line 271, in error_router server_1 | return original_handler(e) server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1544, in handle_user_exception server_1 | reraise(exc_type, exc_value, tb) server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1639, in full_dispatch_request server_1 | rv = self.dispatch_request() server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1625, in dispatch_request server_1 | return self.view_functions[rule.endpoint](**req.view_args) server_1 | File "/app/redash/authentication/ldap_auth.py", line 37, in login server_1 | ldap_user = auth_ldap_user(request.form['email'], request.form['password']) server_1 | File "/app/redash/authentication/ldap_auth.py", line 62, in auth_ldap_user server_1 | server = Server(settings.LDAP_HOST_URL, use_ssl=settings.LDAP_SSL) server_1 | File "/home/redash/.local/lib/python2.7/site-packages/ldap3/core/server.py", line 117, in __init__ server_1 | raise LDAPInvalidPortError('port must be an integer') server_1 | LDAPInvalidPortError: port must be an integer server_1 | [2019-05-29 13:03:59,988][PID:16][ERROR][redash] Exception on /ldap/login [POST] server_1 | Traceback (most recent call last): server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1988, in wsgi_app server_1 | response = self.full_dispatch_request() server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1641, in full_dispatch_request server_1 | rv = self.handle_user_exception(e) server_1 | File "/usr/local/lib/python2.7/dist-packages/flask_restful/__init__.py", line 271, in error_router server_1 | return original_handler(e) server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1544, in handle_user_exception server_1 | reraise(exc_type, exc_value, tb) server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1639, in full_dispatch_request server_1 | rv = self.dispatch_request() server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1625, in dispatch_request server_1 | return self.view_functions[rule.endpoint](**req.view_args) server_1 | File "/app/redash/authentication/ldap_auth.py", line 37, in login server_1 | ldap_user = auth_ldap_user(request.form['email'], request.form['password']) server_1 | File "/app/redash/authentication/ldap_auth.py", line 62, in auth_ldap_user server_1 | server = Server(settings.LDAP_HOST_URL, use_ssl=settings.LDAP_SSL) server_1 | File "/home/redash/.local/lib/python2.7/site-packages/ldap3/core/server.py", line 117, in __init__ server_1 | raise LDAPInvalidPortError('port must be an integer') server_1 | LDAPInvalidPortError: port must be an integer nginx_1 | 10.21.0.9 - - [29/May/2019:13:03:59 +0000] "POST /ldap/login?next=%2F HTTP/1.1" 500 291 "http://prd314/ldap/login?next=%2F" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36" "-" server_1 | [2019-05-29 13:03:59,998][PID:16][INFO][metrics] method=POST path=/ldap/login endpoint=ldap_auth_login status=500 content_type=? content_length=-1 duration=12.59 query_count=0 query_duration=0.00 server_1 | [2019-05-29 13:04:00,132][PID:16][INFO][metrics] method=GET path=/favicon.ico endpoint=redash_index status=302 content_type=text/html; charset=utf-8 content_length=297 duration=1.06 query_count=0 query_duration=0.00 nginx_1 | 10.21.0.9 - - [29/May/2019:13:04:00 +0000] "GET /favicon.ico HTTP/1.1" 302 297 "http://prd314/ldap/login?next=%2F" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36" "-" server_1 | [2019-05-29 13:04:00,251][PID:11][INFO][metrics] method=GET path=/login endpoint=redash_login status=200 content_type=text/html; charset=utf-8 content_length=1962 duration=108.06 query_count=1 query_duration=2.36 nginx_1 | 10.21.0.9 - - [29/May/2019:13:04:00 +0000] "GET /login?next=http%3A%2F%2Fprd314%2Ffavicon.ico HTTP/1.1" 200 868 "http://prd314/ldap/login?next=%2F" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36" "-"

Docker compose file:
version: "2" x-redash-service: &redash-service build: . depends_on: - postgres - redis env_file: /opt/redash/env restart: always services: server: <<: *redash-service command: server ports: - "5000:5000" environment: REDASH_WEB_WORKERS: 4 scheduler: <<: *redash-service command: scheduler environment: QUEUES: "celery" WORKERS_COUNT: 1 scheduled_worker: <<: *redash-service command: worker environment: QUEUES: "scheduled_queries,schemas" WORKERS_COUNT: 1 adhoc_worker: <<: *redash-service command: worker environment: QUEUES: "queries" WORKERS_COUNT: 2 redis: image: redis:3.0-alpine restart: always postgres: image: postgres:9.5.6-alpine env_file: /opt/redash/env volumes: - /opt/redash/postgres-data:/var/lib/postgresql/data restart: always nginx: image: redash/nginx:latest ports: - "80:80" depends_on: - server links: - server:redash restart: always

Dockerfile:
FROM redash/redash:latest RUN pip install ldap3

Technical details:

Redash: 7.0.0+b18042 (4a978ba)
Docker environment based on : https://github.com/getredash/setup

Could you help me please?

@support
Copy link

support bot commented May 29, 2019

👋 @sebv004, we use the issue tracker exclusively for bug reports and planned work. However, this issue appears to be a support request. Please use our forum to get help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant