apache / trafficcontrol

Apache Traffic Control is an Open Source implementation of a Content Delivery Network
https://trafficcontrol.apache.org/
Apache License 2.0
1.08k stars 344 forks source link

Traffic Portal is completely blank when the TO is down #3887

Open lbathina opened 5 years ago

lbathina commented 5 years ago

I'm submitting a ...

Traffic Control components affected ...

Current behavior:

When TO is stopped, the TP portal doesn't load. It shows only a blank page with no errors.

Expected / new behavior:

As per Jeremy this should not be the case. we expect TP to load and show menus.

Minimal reproduction of the problem with instructions:

Anything else:

mitchell852 commented 5 years ago

Here's the issue:

when you try to navigate to a "private" view in TP (fyi every view is private except for tp.domain.com/#!/login) before the view renders, TP attempts to make a call to GET /api/1.4/user/current using a mojolicious cookie (if avaliable). This will result in 1 of 3 things:

  1. GET /api/1.4/user/current will return a 200 OK and the page will render 2.GET /api/1.4/user/current will return a 401 unauthorized (either because the mojo cookie is absent or expired or corrupt) and you will be redirected to tp.domain.com/#!/login to login and get a new cookie
  2. a 500 because TO is down or something else went horribly wrongful

in the first 2 cases, TP will render just fine but in the 3rd, TP will simply fail silently. I guess TP needs to handle the 500 better.

mitchell852 commented 5 years ago

i'm going to reclassify this as an "improvement" because TP was designed to depend on TO so if TO is down, TP is useless....but, with a small change (maybe) as i mentioned above TP could be better at notifying the user of the problem.