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
NAV's /graphite view works as a proxy to the configured graphite-web server for authenticated users (since graphite-web provides no proper authorization scheme):
Proxies render requests to graphite-web, as configured in graphite.conf
"""
The view proxies both response status codes and response bodies. There is, however, a drawback to the current implementation: Any 5XX type response code from graphite-web will trigger Django's log handler to send a full error message to the NAV site admins, even if there is no exception or error in NAV code (it simply triggers on the fact that the index() view function returns a HttpResponse object with status>=500).
We've seen cases where someone has built dashboards of NAV graphs, and if the dashboards refresh just as the graphite-web service is being restarted, hundreds of these e-mails are dispatched to the site admins, which is "inconvenient" (i.e. it is unnecessary noise!).
The sent email will often contain all request details, but no traceback, since there is no actual exception raised within the view code.
This adds a bit of complicated regression testing of #3259, which
causes Dango to send error e-mail to NAV site admins when the proxied
response code from Graphite-web is in the 5XX range.
Describe the bug
NAV's
/graphite
view works as a proxy to the configured graphite-web server for authenticated users (since graphite-web provides no proper authorization scheme):nav/python/nav/web/graphite/views.py
Lines 30 to 33 in e771213
The view proxies both response status codes and response bodies. There is, however, a drawback to the current implementation: Any
5XX
type response code from graphite-web will trigger Django's log handler to send a full error message to the NAV site admins, even if there is no exception or error in NAV code (it simply triggers on the fact that theindex()
view function returns aHttpResponse
object withstatus>=500
).We've seen cases where someone has built dashboards of NAV graphs, and if the dashboards refresh just as the graphite-web service is being restarted, hundreds of these e-mails are dispatched to the site admins, which is "inconvenient" (i.e. it is unnecessary noise!).
The sent email will often contain all request details, but no traceback, since there is no actual exception raised within the view code.
To Reproduce
503 Service Unavailable
).DJANGO_DEBUG=False
innav.conf
)Expected behavior
5xx
errors should be passed on to the client without error mails being sent to the site admins.Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: