GSA / notifications-admin

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

Exception Investigation: builtins:ValueError #1395

Closed ccostino closed 4 days ago

ccostino commented 3 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 is likely related to #1394 due to the same error message showing up with the transaction:

Invalid IPv6 URL

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

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 1482, in full_dispatch_request
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 1974, in preprocess_request
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/newrelic/hooks/framework_flask.py", line 231, in _nr_wrapper_Flask_before_request_wrapped_
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 361, in redirect_notify_to_beta
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/werkzeug/utils.py", line 106, in __get__
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/werkzeug/sansio/request.py", line 210, in url
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/werkzeug/sansio/utils.py", line 137, in get_current_url
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/werkzeug/urls.py", line 84, in uri_to_iri
File "/home/vcap/deps/0/python/lib/python3.9/urllib/parse.py", line 496, in urlsplit

Implementation Sketch and Acceptance Criteria

Security Considerations

terrazoon commented 1 month ago

This error message actually looks slightly bogus. In the logs, there are several error messages chained together.

500 error -> Invalid IPv6 URL -> Request Context has no attribute 'service'

It's not totally clear what's going on but it seems like maybe the cause is the IPv6 URL.