Enabling "Debug Web Requests" Causes Ascender Web UI to Error
Introduction
In Ascender, the "Debug Web Requests" setting (Settings > Troubleshooting) enables Python cProfile profiling on every web request. If the required profile output directory does not exist or is not writable, enabling this setting will immediately cause all web requests to fail with A server error has occurred.
Resolution
Since the Web UI is inaccessible, disable the setting via the API using curl:
curl -k -X PATCH \
-H "Content-Type: application/json" \
-u admin:<password> \
https://<ascender-host>/api/v2/settings/debug/ \
-d '{"AWX_REQUEST_PROFILE": false}'
Replace admin:<password> with valid Ascender admin credentials and <ascender-host> with the Ascender hostname.
Alternatively, if API access is also unavailable, exec into the task pod to run this:
kubectl exec -n ascender -it deployment/ascender-app-task -c ascender-app-task -- awx-manage shell -c \
"from awx.conf.models import Setting; Setting.objects.filter(key='AWX_REQUEST_PROFILE').delete()"
The Web UI should recover shortly after disabling the setting.
Root Cause
When this setting is enabled, the TimingMiddleware activates cProfile on every incoming request and writes profile output to /var/log/tower/profile/. If that directory does not exist or the application user lacks write permissions, the middleware raises an unhandled exception on every response, resulting in a 500 error for all requests, including the UI itself.