GSA / notifications-admin

The UI of Notify.gov
https://notify.gov
Other
11 stars 2 forks source link

Exception Investigation: builtins:AttributeError #1394

Open ccostino opened 5 months ago

ccostino commented 5 months ago

This is one of the errors we've seen captured in New Relic that we'd like to dig into and understand, if not also resolve.

This one might have been caused by a bug we accidentally pushed and fixed quickly since it happened right on the home page, but it'd be good to make sure our error handling is robust. However, there is also this error message with the transaction, so perhaps it was an outside party attempting something:

Invalid IPv6 URL

Error message: 'RequestContext' object has no attribute 'service' Path: / Exception: builtins:AttributeError

Traceback (most recent call last):
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/eventlet/greenthread.py", line 221, in main
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/gunicorn/workers/geventlet.py", line 157, in handle
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/gunicorn/workers/base_async.py", line 55, in handle
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/gunicorn/workers/base_async.py", line 108, in handle_request
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/newrelic/api/wsgi_application.py", line 669, in _nr_wsgi_application_wrapper_
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/flask/app.py", line 2213, in __call__
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/notifications_utils/request_helper.py", line 80, in __call__
File "/home/vcap/app/app/proxy_fix.py", line 11, in __call__
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/werkzeug/middleware/proxy_fix.py", line 182, in __call__
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/newrelic/api/wsgi_application.py", line 564, in _nr_wsgi_application_wrapper_
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/newrelic/hooks/framework_flask.py", line 148, in _nr_wrapper_Flask_handle_exception_
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/newrelic/api/function_trace.py", line 166, in literal_wrapper
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/flask/app.py", line 1348, in handle_user_exception
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/newrelic/hooks/framework_flask.py", line 166, in _nr_wrapper_error_handler_
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/newrelic/api/function_trace.py", line 166, in literal_wrapper
File "/home/vcap/app/app/__init__.py", line 537, in handle_bad_request
File "/home/vcap/app/app/__init__.py", line 440, in _error_response
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/newrelic/api/function_trace.py", line 166, in literal_wrapper
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/flask/templating.py", line 151, in render_template
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/flask/templating.py", line 132, in _render
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/newrelic/api/function_trace.py", line 147, in dynamic_wrapper
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/jinja2/environment.py", line 1301, in render
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/jinja2/environment.py", line 936, in handle_exception
File "/home/vcap/app/app/templates/error/500.html", line 1, in top-level template code
File "/home/vcap/app/app/templates/withoutnav_template.html", line 3, in top-level template code
File "/home/vcap/app/app/templates/admin_template.html", line 2, in top-level template code
File "/home/vcap/app/app/templates/main_template.html", line 55, in top-level template code
File "/home/vcap/app/app/templates/main_template.html", line 57, in block 'main'
File "/home/vcap/app/app/templates/withoutnav_template.html", line 6, in block 'beforeContent'
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/werkzeug/local.py", line 311, in __get__
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/werkzeug/local.py", line 515, in _get_current_object

Implementation Sketch and Acceptance Criteria

Security Considerations

terrazoon commented 1 month ago

Fixed here: https://github.com/GSA/notifications-api/pull/1233