Awx: Cannot save authentication settings

Created on 31 Jul 2018  ยท  4Comments  ยท  Source: ansible/awx

ISSUE TYPE
  • Bug Report
COMPONENT NAME
  • API
SUMMARY

Cannot save authentication settings

ENVIRONMENT
  • AWX version: 1.0.6 (also tested with 1.0.5 and 1.0.4)
  • AWX install method: docker (linux)
  • Ansible version: 2.5.4
  • Operating System: CentOS 7
  • Web Browser: Firefox and Google Chrome
STEPS TO REPRODUCE

Goto settings -> Authentication -> Sub Category (LDAP) and fill in the basic configuration:

  • LDAP SERVER URI
  • LDAP BIND DN
  • LDAP BIND PASSWORD
  • LDAP USER DN TEMPLATE

Before save view the awx_web logs, on save the server produce a HTTP code 400.

EXPECTED RESULTS

Filled-in information is saved and the HTTP code in the awx_web log should show 200.

ACTUAL RESULTS

In the awx_web logs shows an error 400 code:

2018-07-31 08:36:50,233 WARNING  awx.api.generics status 400 received by user admin attempting to access /api/v2/settings/all/ from 10.0.0.198
10.0.0.198 - - [31/Jul/2018:08:36:50 +0000] "PATCH /api/v2/settings/all/ HTTP/1.1" 400 76 "http://10.0.0.150/" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
[pid: 29|app: 0|req: 8/21] 10.0.0.198 () {48 vars in 2423 bytes} [Tue Jul 31 08:36:49 2018] PATCH /api/v2/settings/all/ => generated 76 bytes in 272 msecs (HTTP/1.1 400) 8 headers in 251 bytes (1 switches on core 0)
ADDITIONAL INFORMATION

Sometimes, not always, I also see the following message passing in the awx_web logs when trying to save my configuration.

2018-07-31 08:52:33,509 ERROR    django.request Internal Server Error: /api/v2/settings/all/
Traceback (most recent call last):
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/lib/python2.7/site-packages/awx/wsgi.py", line 65, in _legacy_get_response
    return super(AWXWSGIHandler, self)._legacy_get_response(request)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/utils/decorators.py", line 185, in inner
    return func(*args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/awx/api/generics.py", line 284, in dispatch
    return super(APIView, self).dispatch(request, *args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/rest_framework/views.py", line 494, in dispatch
    response = self.handle_exception(exc)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/rest_framework/views.py", line 454, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/rest_framework/views.py", line 491, in dispatch
    response = handler(request, *args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/rest_framework/generics.py", line 260, in patch
    return self.partial_update(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/awx/api/generics.py", line 745, in partial_update
    return super(RetrieveUpdateAPIView, self).partial_update(request, *args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/rest_framework/mixins.py", line 84, in partial_update
    return self.update(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/awx/api/generics.py", line 741, in update
    return super(RetrieveUpdateAPIView, self).update(request, *args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/rest_framework/mixins.py", line 69, in update
    serializer.is_valid(raise_exception=True)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/rest_framework/serializers.py", line 236, in is_valid
    self._validated_data = self.run_validation(self.initial_data)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/rest_framework/serializers.py", line 435, in run_validation
    value = self.to_internal_value(data)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/rest_framework/serializers.py", line 465, in to_internal_value
    validated_value = field.run_validation(primitive_value)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/rest_framework/fields.py", line 523, in run_validation
    value = self.to_internal_value(data)
  File "/usr/lib/python2.7/site-packages/awx/conf/serializers.py", line 57, in to_internal_value
    obj = super(SettingFieldMixin, self).to_internal_value(value)
  File "/usr/lib/python2.7/site-packages/awx/sso/fields.py", line 401, in to_internal_value
    return cls(**params_sanitized)
TypeError: __init__() takes at least 2 arguments (2 given)
api bug

Most helpful comment

@ryanpetrello unfortunately my project has finished at the company where I have implement this. Also in the end we moved to the enterprise version, Tower.

All 4 comments

I am also seeing this behavior on a fresh install of AWX 1.0.7.2 on CentOS 7

The 400 response should give details of what happened, but it could be that https://github.com/ansible/awx/issues/2446 is blocking the proper reporting of those errors.

@rgruyters we think we may have resolved this in a newer version of awx. Could you try the latest (3.0.0) and reopen if you're still seeing problems?

@ryanpetrello unfortunately my project has finished at the company where I have implement this. Also in the end we moved to the enterprise version, Tower.

Was this page helpful?
0 / 5 - 0 ratings