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 Configuration Failed to save settings. Returned status: 500 A server error has occured #7622

Closed
joeywashburn opened this issue Jul 15, 2020 · 8 comments

Comments

@joeywashburn
Copy link

joeywashburn commented Jul 15, 2020

ISSUE TYPE
  • Bug Report
SUMMARY

When choosing MemberDNGroupType and trying to save you get the error message

ENVIRONMENT
  • AWX version: 13.0.0/AWX 11.2.0 I have two environments with the same problem
  • AWX install method: docker on Linux/ Kubernetes
  • Ansible version: 2.9.10 / 2.9.7
  • Operating System: Ubuntu 20/ Whatever Kube is running. Used the defaults
  • Web Browser:
STEPS TO REPRODUCE

Go into Settings\Auth and choose MemberDNGroupType from the LDAP. Save
image

EXPECTED RESULTS

Save with no errors

ACTUAL RESULTS

Error. See attached screenshot
image (1)

ADDITIONAL INFORMATION
@wenottingham
Copy link
Contributor

We'd need the full traceback from the server side.

@joeywashburn
Copy link
Author

joeywashburn commented Jul 15, 2020

Is this what you are looking for?

[pid: 82|app: 0|req: 70/361] 192.168.175.1 () {48 vars in 2256 bytes} [Wed Jul 15 14:33:35 2020] GET /api/ => generated 91916 bytes in 134 msecs (HTTP/1.1 200) 13 headers in 565 bytes (1 switches on core 0)
192.168.175.1 - - [15/Jul/2020:14:33:35 +0000] "GET /api/ HTTP/1.1" 200 91916 "http://192.168.175.128/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0" "-"
192.168.175.1 - - [15/Jul/2020:14:33:35 +0000] "GET /api/v2/me/ HTTP/1.1" 200 939 "http://192.168.175.128/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0" "-"
[pid: 82|app: 0|req: 71/362] 192.168.175.1 () {46 vars in 2184 bytes} [Wed Jul 15 14:33:35 2020] GET /api/v2/me/ => generated 939 bytes in 86 msecs (HTTP/1.1 200) 12 headers in 452 bytes (1 switches on core 0)
[pid: 80|app: 0|req: 130/363] 192.168.175.1 () {48 vars in 2372 bytes} [Wed Jul 15 14:33:35 2020] GET /api/v2/workflow_approvals/?status=pending&page_size=1 => generated 52 bytes in 94 msecs (HTTP/1.1 200) 10 headers in 292 bytes (1 switches on core 0)
192.168.175.1 - - [15/Jul/2020:14:33:35 +0000] "GET /api/v2/workflow_approvals/?status=pending&page_size=1 HTTP/1.1" 200 52 "http://192.168.175.128/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0" "-"
192.168.175.1 - - [15/Jul/2020:14:33:36 +0000] "GET /api/v2/config/ HTTP/1.1" 200 806 "http://192.168.175.128/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0" "-"
[pid: 81|app: 0|req: 44/364] 192.168.175.1 () {48 vars in 2295 bytes} [Wed Jul 15 14:33:35 2020] GET /api/v2/config/ => generated 806 bytes in 792 msecs (HTTP/1.1 200) 10 headers in 301 bytes (1 switches on core 0)
192.168.175.1 - - [15/Jul/2020:14:33:36 +0000] "GET /api/v2/config/ HTTP/1.1" 200 806 "http://192.168.175.128/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0" "-"
[pid: 79|app: 0|req: 55/365] 192.168.175.1 () {48 vars in 2295 bytes} [Wed Jul 15 14:33:36 2020] GET /api/v2/config/ => generated 806 bytes in 129 msecs (HTTP/1.1 200) 10 headers in 301 bytes (1 switches on core 0)
[pid: 82|app: 0|req: 72/366] 192.168.175.1 () {54 vars in 2442 bytes} [Wed Jul 15 14:33:36 2020] OPTIONS /api/v2/settings/all/ => generated 288645 bytes in 518 msecs (HTTP/1.1 200) 10 headers in 310 bytes (1 switches on core 0)
192.168.175.1 - - [15/Jul/2020:14:33:37 +0000] "OPTIONS /api/v2/settings/all/ HTTP/1.1" 200 288645 "http://192.168.175.128/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0" "-"
192.168.175.1 - - [15/Jul/2020:14:33:39 +0000] "GET /api/v2/settings/system/ HTTP/1.1" 200 562 "http://192.168.175.128/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0" "-"
[pid: 81|app: 0|req: 45/367] 192.168.175.1 () {48 vars in 2313 bytes} [Wed Jul 15 14:33:39 2020] GET /api/v2/settings/system/ => generated 562 bytes in 60 msecs (HTTP/1.1 200) 10 headers in 307 bytes (1 switches on core 0)
192.168.175.1 - - [15/Jul/2020:14:33:39 +0000] "GET /api/v2/settings/all/ HTTP/1.1" 200 103438 "http://192.168.175.128/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0" "-"
[pid: 81|app: 0|req: 46/368] 192.168.175.1 () {48 vars in 2307 bytes} [Wed Jul 15 14:33:39 2020] GET /api/v2/settings/all/ => generated 103438 bytes in 130 msecs (HTTP/1.1 200) 10 headers in 310 bytes (1 switches on core 0)

2020-07-15 14:33:50,066 ERROR    django.request Internal Server Error: /api/v2/settings/all/
Traceback (most recent call last):
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib64/python3.6/contextlib.py", line 52, in inner
    return func(*args, **kwds)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/api/generics.py", line 304, in dispatch
    return super(APIView, self).dispatch(request, *args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/views.py", line 505, in dispatch
    response = self.handle_exception(exc)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/views.py", line 465, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/views.py", line 476, in raise_uncaught_exception
    raise exc
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/views.py", line 502, in dispatch
    response = handler(request, *args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/generics.py", line 258, in patch
    return self.partial_update(request, *args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/api/generics.py", line 784, in partial_update
    return super(RetrieveUpdateAPIView, self).partial_update(request, *args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/mixins.py", line 82, in partial_update
    return self.update(request, *args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/api/generics.py", line 780, in update
    return super(RetrieveUpdateAPIView, self).update(request, *args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/mixins.py", line 67, in update
    serializer.is_valid(raise_exception=True)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/serializers.py", line 234, in is_valid
    self._validated_data = self.run_validation(self.initial_data)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/serializers.py", line 433, in run_validation
    value = self.to_internal_value(data)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/serializers.py", line 490, in to_internal_value
    validated_value = field.run_validation(primitive_value)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/fields.py", line 565, in run_validation
    value = self.to_internal_value(data)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/conf/serializers.py", line 55, in to_internal_value
    obj = super(SettingFieldMixin, self).to_internal_value(value)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/sso/fields.py", line 482, in to_internal_value
    return cls(**params_sanitized)
TypeError: __init__() missing 1 required positional argument: 'member_attr'
2020-07-15 14:33:50,066 ERROR    django.request Internal Server Error: /api/v2/settings/all/
Traceback (most recent call last):
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib64/python3.6/contextlib.py", line 52, in inner
    return func(*args, **kwds)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/api/generics.py", line 304, in dispatch
    return super(APIView, self).dispatch(request, *args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/views.py", line 505, in dispatch
    response = self.handle_exception(exc)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/views.py", line 465, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/views.py", line 476, in raise_uncaught_exception
    raise exc
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/views.py", line 502, in dispatch
    response = handler(request, *args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/generics.py", line 258, in patch
    return self.partial_update(request, *args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/api/generics.py", line 784, in partial_update
    return super(RetrieveUpdateAPIView, self).partial_update(request, *args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/mixins.py", line 82, in partial_update
    return self.update(request, *args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/api/generics.py", line 780, in update
    return super(RetrieveUpdateAPIView, self).update(request, *args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/mixins.py", line 67, in update
    serializer.is_valid(raise_exception=True)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/serializers.py", line 234, in is_valid
    self._validated_data = self.run_validation(self.initial_data)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/serializers.py", line 433, in run_validation
    value = self.to_internal_value(data)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/serializers.py", line 490, in to_internal_value
    validated_value = field.run_validation(primitive_value)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/rest_framework/fields.py", line 565, in run_validation
    value = self.to_internal_value(data)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/conf/serializers.py", line 55, in to_internal_value
    obj = super(SettingFieldMixin, self).to_internal_value(value)
  File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/sso/fields.py", line 482, in to_internal_value
    return cls(**params_sanitized)
TypeError: __init__() missing 1 required positional argument: 'member_attr'

@wenottingham
Copy link
Contributor

Yes, thanks.

@ryanpetrello
Copy link
Contributor

@joeywashburn any chance you could share the output of /api/v2/settings/ldap/ with us?

@joeywashburn
Copy link
Author

joeywashburn commented Oct 6, 2020

@joeywashburn any chance you could share the output of /api/v2/settings/ldap/ with us?

HTTP 200 OK
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept
X-API-Node: awx-6899dd4fbf-vqs7s
X-API-Product-Name: AWX
X-API-Product-Version: 14.1.0
X-API-Time: 0.026s

{
    "AUTH_LDAP_SERVER_URI": "ldap://ourdomaincontroller.com:389",
    "AUTH_LDAP_BIND_DN": "CN=service_awxapp,CN=Accounts,DC=ourdomain,DC=com",
    "AUTH_LDAP_BIND_PASSWORD": "$encrypted$",
    "AUTH_LDAP_START_TLS": false,
    "AUTH_LDAP_CONNECTION_OPTIONS": {
        "OPT_REFERRALS": 0,
        "OPT_NETWORK_TIMEOUT": 30
    },
    "AUTH_LDAP_USER_SEARCH": [
        "DC=ourdomain,DC=com",
        "SCOPE_SUBTREE",
        "(sAMAccountName=%(user)s)"
    ],
    "AUTH_LDAP_USER_DN_TEMPLATE": null,
    "AUTH_LDAP_USER_ATTR_MAP": {
        "first_name": "givenName",
        "last_name": "sn",
        "email": "mail"
    },
    "AUTH_LDAP_GROUP_SEARCH": [],
    "AUTH_LDAP_GROUP_TYPE": "ActiveDirectoryGroupType",
    "AUTH_LDAP_GROUP_TYPE_PARAMS": {},
    "AUTH_LDAP_REQUIRE_GROUP": "CN=AWXGRoup,CN=Groups,DC=ourdomain,DC=com",
    "AUTH_LDAP_DENY_GROUP": null,
    "AUTH_LDAP_USER_FLAGS_BY_GROUP": {},
    "AUTH_LDAP_ORGANIZATION_MAP": {},
    "AUTH_LDAP_TEAM_MAP": {},
    "AUTH_LDAP_1_SERVER_URI": "",
    "AUTH_LDAP_1_BIND_DN": "",
    "AUTH_LDAP_1_BIND_PASSWORD": "",
    "AUTH_LDAP_1_START_TLS": false,
    "AUTH_LDAP_1_CONNECTION_OPTIONS": {
        "OPT_REFERRALS": 0,
        "OPT_NETWORK_TIMEOUT": 30

@wenottingham
Copy link
Contributor

wenottingham commented Oct 6, 2020

The error is from AUTH_LDAP_GROUP_TYPE_PARAMS being unset. Not sure why it's being unset. (If you hit 'revert', it should be reset to the default.)

@joeywashburn
Copy link
Author

The error is from AUTH_LDAP_GROUP_TYPE_PARAMS being unset. Not sure why it's being unset. (If you hit 'revert', it should be reset to the default.)

It does and I am able to choose ADGroup and it works fine. Its something I reported a while back and forgot about it until a few days ago when ryan asked about it

@appuk
Copy link
Member

appuk commented Oct 28, 2020

Verified that I can choose MemberDNGroupType/ edit Group type when LDAP Group Type Parameters aren't set
hence closing

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

6 participants