在配置用于Web服务器身份验证的LDAP后尝试登录Airflow 10 Webui时出现以下错误。
其他人遇到过此问题吗?
-------------------------------------------------------------------------------
Node: web-c9f49dbb-kfmc5
-------------------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python2.7/dist-packages/flask_admin/base.py", line 69, in inner
return self._run_view(f, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/flask_admin/base.py", line 368, in _run_view
return fn(self, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/airflow/www/views.py", line 735, in login
return airflow.login.login(self, request)
File "/usr/local/lib/python2.7/dist-packages/airflow/utils/db.py", line 74, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/airflow/contrib/auth/backends/ldap_auth.py", line 296, in login
LdapUser.try_login(username, password)
File "/usr/local/lib/python2.7/dist-packages/airflow/contrib/auth/backends/ldap_auth.py", line 187, in try_login
configuration.conf.get("ldap", "bind_password"))
File "/usr/local/lib/python2.7/dist-packages/airflow/contrib/auth/backends/ldap_auth.py", line 68, in get_ldap_connection
server = Server(configuration.conf.get("ldap", "uri"), use_ssl, tls_configuration)
File "/usr/local/lib/python2.7/dist-packages/ldap3/core/server.py", line 118, in __init__
raise LDAPInvalidPortError('port must be an integer')
LDAPInvalidPortError: port must be an integer
我的airflow.cfg看起来像这样:
[ webserver ]
authenticate = True
auth_backend = airflow.contrib.auth.backends.ldap_auth
[ldap]
uri = ldaps://ldap.jumpcloud.com:636
user_filter = objectClass=*
user_name_attr = uid
group_member_attr = memberOf
bind_user = uid=airflowldapservice,ou=Users,o=ORGANIZATION,dc=jumpcloud,dc=com
bind_password = PASSWORD
basedn = ou=Users,o=ORGANIZATION,dc=jumpcloud,dc=com
cacert = /etc/ca/ldap_ca.crt
search_scope = LEVEL
更新:
重新键入“ uri = ldaps://ldapsjdcloud.com:636”行之后,有趣的是,现在我收到此错误。
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python2.7/dist-packages/flask_admin/base.py", line 69, in inner
return self._run_view(f, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/flask_admin/base.py", line 368, in _run_view
return fn(self, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/airflow/www/views.py", line 735, in login
return airflow.login.login(self, request)
File "/usr/local/lib/python2.7/dist-packages/airflow/utils/db.py", line 74, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/airflow/contrib/auth/backends/ldap_auth.py", line 296, in login
LdapUser.try_login(username, password)
File "/usr/local/lib/python2.7/dist-packages/airflow/contrib/auth/backends/ldap_auth.py", line 187, in try_login
configuration.conf.get("ldap", "bind_password"))
File "/usr/local/lib/python2.7/dist-packages/airflow/contrib/auth/backends/ldap_auth.py", line 71, in get_ldap_connection
if not conn.bind():
File "/usr/local/lib/python2.7/dist-packages/ldap3/core/connection.py", line 539, in bind
request = bind_operation(self.version, self.authentication, self.user, self.password, auto_encode=self.auto_encode)
File "/usr/local/lib/python2.7/dist-packages/ldap3/operation/bind.py", line 57, in bind_operation
request['authentication'] = AuthenticationChoice().setComponentByName('simple', Simple(validate_simple_password(password)))
File "/usr/local/lib/python2.7/dist-packages/ldap3/protocol/sasl/sasl.py", line 136, in validate_simple_password
password = sasl_prep(password)
File "/usr/local/lib/python2.7/dist-packages/ldap3/protocol/sasl/sasl.py", line 78, in sasl_prep
raise LDAPSASLPrepError('SASLprep error: ASCII control character present')
DAPSASLPrepError: SASLprep error: ASCII control character present