fabio icon indicating copy to clipboard operation
fabio copied to clipboard

[nasty bug] Using a static route rule to change the weight of a missing dynamic route causes Fabio to incorrectly startup

Open far-blue opened this issue 3 years ago • 0 comments

If a static route exists that changes the weight of a dynamic route but that dynamic route doesn't exist in the initial data fetched from consul when fabio first starts up, fabio ends up in a half-configured state and won't route anything.

Here's an example:

Add the following as a static rule - it doesn't matter what it's called or what it targets as long as the target dynamic rule doesn't exist. In case you wondered, I use it to make sure all web ui traffic for vault goes to the leader:

route weight vault vault.example.com/* weight 1 tags "active"

If added once fabio is already running, everything should be fine and fabio will keep working.

Restart fabio

When fabio restarts, I found:

  • no dynamic routes show in the admin ui
  • none of the ports configured in the proxy.addr config are actually opened
  • no routing happens, even for other static routes
  • Fabio doesn't output any sort of warning and it doesn't terminate
  • Fabio continues to talk to consul and appears to monitor dynamic service changes but routing still fails

If at this point you then remove the above static rule, everything starts working again. You can even put the rule back and everything is fine - until you restart fabio again.

This caused me serious problems as it took down our entire website and a number of internal services and took ages to track down because in our case the dynamic route in question had been changed weeks ago - but we'd just not restarted fabio!

far-blue avatar Jul 03 '21 10:07 far-blue