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

[bug] ldap地址正确但是测试连接失败 #428

Closed
wklken opened this issue May 12, 2022 · 2 comments
Closed

[bug] ldap地址正确但是测试连接失败 #428

wklken opened this issue May 12, 2022 · 2 comments
Assignees
Labels
Layer: api Api module related Module: LDAP/MAD ldap/mad related Type: bug Something isn't working Type: question Usage or problems

Comments

@wklken
Copy link
Collaborator

wklken commented May 12, 2022

Traceback (most recent call last):
  File "/app/bkuser_core/categories/plugins/ldap/client.py", line 71, in initialize
    return Connection(**connection_params)
  File "/usr/local/lib/python3.6/site-packages/ldap3/core/connection.py", line 326, in __init__
    self.do_auto_bind()
  File "/usr/local/lib/python3.6/site-packages/ldap3/core/connection.py", line 341, in do_auto_bind
    self.open(read_server_info=False)
  File "/usr/local/lib/python3.6/site-packages/ldap3/strategy/sync.py", line 56, in open
    BaseStrategy.open(self, reset_usage, read_server_info)
  File "/usr/local/lib/python3.6/site-packages/ldap3/strategy/base.py", line 150, in open
    raise LDAPSocketOpenError('invalid server address')
ldap3.core.exceptions.LDAPSocketOpenError: invalid server address

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/bkuser_core/categories/views.py", line 197, in test_connection
    syncer_cls(instance.id).fetcher.client.initialize(**serializer.validated_data)
  File "<string>", line 6, in __init__
  File "/app/bkuser_core/categories/plugins/ldap/syncer.py", line 159, in __post_init__
    self.fetcher: LDAPFetcher = self.get_fetcher()
  File "/app/bkuser_core/categories/plugins/base.py", line 230, in get_fetcher
    return self.fetcher_cls(self.category_id, self.config_loader)
  File "<string>", line 4, in __init__
  File "/app/bkuser_core/categories/plugins/ldap/syncer.py", line 40, in __post_init__
    self.client = LDAPClient(self.config_loader)
  File "<string>", line 3, in __init__
  File "/app/bkuser_core/categories/plugins/ldap/client.py", line 38, in __post_init__
    use_ssl=bool(self.config_provider.get("ssl_encryption") == "SSL"),
  File "/app/bkuser_core/categories/plugins/ldap/client.py", line 79, in initialize
    raise local_exceptions.LdapCannotBeInitialized
bkuser_core.categories.plugins.ldap.exceptions.LdapCannotBeInitialized

ldap3从 2.6.1, 升级到 2.7 之后解决;

@wklken wklken added Type: bug Something isn't working Type: question Usage or problems Layer: api Api module related Module: LDAP/MAD ldap/mad related labels May 12, 2022
@wklken wklken self-assigned this May 12, 2022
@wklken
Copy link
Collaborator Author

wklken commented May 12, 2022

https://github.com/cannatag/ldap3/search?q=invalid+server+address&type=issues

跟里面的问题有关系, 应该是一个bugfix;

对应的ldap server是 openldap

@wklken
Copy link
Collaborator Author

wklken commented May 13, 2022

cannatag/ldap3#750

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Layer: api Api module related Module: LDAP/MAD ldap/mad related Type: bug Something isn't working Type: question Usage or problems
Projects
None yet
Development

No branches or pull requests

1 participant