You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd expect to get an proper handling in case either user or pw aren't properly set (the code is looking into the ENV for that, maybe it should check if we didn't nudge it in the settings mapping instead? That's another story)
Adding a else block with proper error raising would ensure we're not facing that 500 error while, maybe, providing the needed bits to ensure user and password are properly set in order to get the subscription?
Cheers,
C.
Reported error from the controller-web logs:
2024-12-11 14:40:21,480 ERROR [4fc068319bcf44d69dff4b0b184895b2] django.request Internal Server Error: /api/controller/v2/config/attach/
Traceback (most recent call last):
File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/contextlib.py", line 81, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
return view_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/django/views/generic/base.py", line 104, in view
return self.dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/awx/api/generics.py", line 373, in dispatch
return super(APIView, self).dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/rest_framework/views.py", line 509, in dispatch response = self.handle_exception(exc)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/rest_framework/views.py", line 469, in handle_exception self.raise_uncaught_exception(exc)
File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch response = handler(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/awx/api/views/root.py", line 259, in post for sub in validated:
^^^^^^^^^
UnboundLocalError: cannot access local variable 'validated' where it is not associated with a value
AWX version
stable-2.5
Select the relevant components
UI
UI (tech preview)
API
Docs
Collection
CLI
Other
Installation method
kubernetes
Modifications
no
Ansible version
No response
Operating system
No response
Web browser
No response
Steps to reproduce
Deploy AAP Controller
Create an Automation Platform (either via the UI, or via CRs)
Try to attach a subscription using the API instead of the UI:
Please confirm the following
[email protected]
instead.)Bug Summary
Hello,
When trying to attach a subscription using cURL, the API returns a 500 error due to a missing check (see bellow).
After some digging, it seems the culprit is nested in
awx/api/views/root.py
inApiV2AttachView
method, especially this block:I'd expect to get an proper handling in case either
user
orpw
aren't properly set (the code is looking into the ENV for that, maybe it should check if we didn't nudge it in the settings mapping instead? That's another story)Adding a
else
block with proper error raising would ensure we're not facing that 500 error while, maybe, providing the needed bits to ensure user and password are properly set in order to get the subscription?Cheers,
C.
Reported error from the controller-web logs:
AWX version
stable-2.5
Select the relevant components
Installation method
kubernetes
Modifications
no
Ansible version
No response
Operating system
No response
Web browser
No response
Steps to reproduce
Expected results
It should either properly find the credentials, or at least fails with a proper error, not a generic 500 due to uncaught condition
Actual results
It fails with a 500 error, meaning we have to get logs and find out the actually issue by comparing the code.
Additional information
I've deployed a single replicas onto a CRC (OpenShift Local) instance to do some testings.
The text was updated successfully, but these errors were encountered: