FOUNDING PRICING · 40% OFFfor the first 1,000 members · from ₹95/month
OutageFastly11 min read

Fastly 2021 Outage Explained: One Valid Config, 85% Errors

How one customer's valid configuration change triggered a hidden bug and took 85% of Fastly's CDN offline on 8 June 2021, and what the outage teaches us.

ShareXLinkedInWhatsApp
Rows of server racks seen from above in the CERN data centre, with signs marking the mail servers, database servers and World Wide Web servers.
Rows of server racks seen from above in the CERN data centre, with signs marking the mail servers, database servers and World Wide Web servers. Photo: Hugovanmeijeren, CC BY-SA 3.0, via Wikimedia Commons.

On 8 June 2021, a large part of the web stopped loading for about an hour. News sites, shops, developer tools and a government portal all returned the same error at the same moment, because they all sat behind one content delivery network, Fastly. Fastly said that 85% of its network was returning errors, and that the trigger was a single customer making a perfectly valid change to their own configuration.

The story is short, and Fastly published only a brief summary. It is still one of the clearest real examples of three ideas every backend engineer needs: a latent bug, a blast radius, and the difference between detecting a failure and fixing it.

A diagram of the request path from a user through a Fastly point of presence to the customer's origin server, showing that on 8 June 2021 the edge answered with 503 errors while the origin servers behind it were still healthy.

What broke for users

Reporting on the day listed Reddit, Twitch, Spotify, Stack Overflow, GitHub, PayPal, Shopify, Stripe, Vimeo and the UK government's gov.uk among the affected sites, along with news publishers including the Guardian, the Financial Times, the BBC, CNN and the New York Times. Visitors saw HTTP 503 errors in place of pages.

A 503 status means "service unavailable". It is the code a server uses when it cannot handle the request right now. The important detail here is who sent it. The companies' own servers were, as far as anyone reported, running normally. The 503 came from the layer in front of them.

The disruption started at 09:47 UTC, which is 15:17 in India, the middle of the working afternoon. It was mid-morning in Europe and before dawn on the US east coast.

Why so many unrelated sites share one failure

A content delivery network, or CDN, is a fleet of servers placed in many cities. Each location is called a point of presence, or POP. Fastly has described a POP as racks of servers, network links to other networks, and its caching software. When you request a page from a site that uses a CDN, the name resolves to the CDN, your request lands on a POP near you, and the POP either answers from its cache or fetches the page from the site's real server, called the origin.

That makes the CDN a reverse proxy: it stands in front of the origin and answers on its behalf. The benefits are real. Pages load faster because the copy is close to the reader, the origin handles far less traffic, and attack traffic is absorbed at the edge. The cost is that the CDN is now on the path of every single request. If the edge cannot answer, a healthy origin does not help, because users are not talking to the origin at all.

One CDN serves thousands of customers on the same servers running the same software. This is what makes it cheap and fast. It is also why a fault in that shared software shows up on a newspaper, a payment company and a code hosting site within the same second.

The tops of several rows of black server racks with thick bundles of power and network cables running across them in trays.
Cabling above the racks in the server room of the Parallel Computer Centre at the Royal Institute of Technology, Stockholm; an illustration of shared infrastructure, not a Fastly facility. Photo: Esquilo, CC BY-SA 3.0, via Wikimedia Commons.

The timeline

All times are UTC on 8 June 2021 and come from Fastly's summary.

TimeWhat happened
12 MayA software deployment begins. It contains the bug, which stays dormant.
09:47Global disruption starts.
09:48Fastly's monitoring identifies the disruption.
09:58Fastly publishes a status post.
10:27Engineers identify the customer configuration involved.
10:36Affected services begin to recover.
11:00The majority of services have recovered.
12:35The incident is mitigated.
12:44The status post is marked resolved.
17:25Deployment of the bug fix begins.

Fastly's headline figures were detection within one minute and 95% of the network back to normal within 49 minutes. Count 49 minutes from 09:47 and you reach 10:36, the point at which services started to recover.

A horizontal timeline of 8 June 2021 from 09:47 to 12:35 UTC, split into one minute to detect, 39 minutes to find the cause, 9 minutes until services begin to recover, and a long tail until the incident is mitigated, with the bug fix deployment starting later at 17:25.
Where the hour went: detection was the fast part

The root cause: a latent bug and a trigger

Fastly's explanation has two halves, and both were needed.

The bug. A software deployment that began on 12 May introduced a defect. Fastly described it as an "undiscovered software bug", one that could be triggered by a specific customer configuration under specific circumstances. For the next 27 days the code ran in production, handled an enormous volume of traffic, and did nothing wrong.

The trigger. Early on 8 June, one customer pushed a configuration change that happened to meet those circumstances. Fastly was clear that the change was valid. The customer did nothing wrong, and the system was supposed to accept what they sent.

Fastly has not published what the bug was, which component it lived in, or what the configuration contained, so this post will not guess. What we can explain is the shape of the failure, because the shape is common.

A latent bug is a defect on a path that has not executed yet. Imagine a function with a thousand possible input combinations, of which tests and real traffic have exercised 999. The code is wrong for the last one. Every dashboard is green, every test passes, and the program is still incorrect. It is waiting for an input. In illustration only, not Fastly's code:

def apply_config(cfg):
    if cfg.uses_feature_a and cfg.uses_feature_b and cfg.order == "b_first":
        # Nobody has ever sent this combination. This branch has a defect.
        return broken_path(cfg)
    return normal_path(cfg)

To see why customer configuration is such a rich source of unusual inputs, look at what a CDN lets customers do. Fastly has written that its edge software is built on a heavily customised version of the Varnish cache, and that customers control caching through VCL, the Varnish Configuration Language. Fastly's own description is that VCL behaves more like a programming language than a settings file. Customers can generate it from a web interface or write their own, and it is loaded onto the caches without a maintenance window. The number of distinct valid configurations is, for practical purposes, unlimited. No test suite can try them all.

A two-part diagram: a deployment on 12 May 2021 places a dormant bug on Fastly's servers, where it stays quiet for 27 days, and on 8 June a valid customer configuration change supplies the second condition, so that both together produce errors across 85% of the network.
Two conditions, 27 days apart, both required

Why one customer's change reached the whole network

A bug that needs a rare input usually harms only the customer who sent it. This one harmed everybody. Fastly's summary states the effect, 85% of the network returning errors, without describing the internal mechanism, but two properties of a CDN explain why such an outcome is possible.

First, a customer's configuration has to be present at every POP, because a request for that customer can arrive anywhere in the world. A change is therefore distributed globally and quickly. Speed is a selling point: a publisher who fixes a caching rule wants it live in seconds.

Second, customers share the machines. If handling one customer's configuration damages a process that also serves other customers, the damage is not limited to the customer who sent it. Whatever the details were in this case, the observed result was exactly that: one input, shared software, global effect.

Put together, a fast global configuration channel plus shared software gives you a system where a single bad interaction can be everywhere before a human has read the first alert.

Why the safeguards did not catch it

Fastly listed this as an open question in its own summary: one of its stated next steps was to work out why the bug was not found during quality assurance and testing. The summary does not give the answer, and no fuller public post-mortem is cited here.

The general difficulty is worth stating, though. The usual defence against a bad release is a staged rollout: ship to a few machines, watch, then widen. That defence works when the bug shows itself under ordinary traffic. This bug had been fully rolled out for weeks and was invisible, because the triggering input did not exist yet. A canary cannot catch a failure whose trigger arrives 27 days later.

The second defence is to stage the configuration change itself. But the change was valid and came from a customer, not from Fastly's engineers. Customers push changes all day, and they expect them to apply at once.

What Fastly did and said it would change

The immediate fix was to disable the customer configuration that triggered the bug. Notice the order of operations: remove the trigger first, repair the code later. Services began recovering at 10:36, while deployment of the real bug fix did not begin until 17:25, about seven hours afterwards.

In its summary Fastly apologised, said that it should have anticipated the problem even though the conditions were specific, and listed what it would do next:

  • deploy the bug fix across the network as quickly and safely as possible;
  • carry out a full post-mortem of the processes and practices followed during the incident;
  • find out why the bug was not detected in testing;
  • look for ways to shorten the time to remediate.

It also pointed to a longer-term direction: using the isolation properties of WebAssembly and its Compute@Edge platform to build more resilience into its systems. The idea behind that is sandboxing. If each customer's logic runs inside its own isolated compartment, a failure in one compartment has a harder time reaching the others.

The computer science underneath

CDNs and reverse proxies. A CDN is a geographically distributed cache that terminates the user's connection and speaks to the origin on the user's behalf. The lesson on CDNs and the edge covers how requests are routed to a nearby POP and what gets cached, and proxies, reverse proxies and load balancers explains what it means for a middle layer to answer for a server. The price of putting anything on the request path is that its availability becomes an upper bound on yours.

Deployment safety. Rolling, canary and blue-green releases all limit how many machines meet new code at once. They are covered in shipping safely: rolling, blue-green, canary and feature flags. This outage shows their limit: they protect against bugs that appear during the rollout window, and configuration needs the same staged treatment as code if it can change behaviour.

Blast radius and isolation. A bulkhead is a wall that stops one flooded compartment from sinking the ship. In software it means separate pools, processes, cells or sandboxes so that one tenant's failure stays with that tenant. Bulkheads, cells and graceful degradation goes through the patterns. Fastly's stated interest in WebAssembly isolation is this idea applied to customer logic at the edge.

Incident response. The timeline separates neatly into time to detect, time to diagnose and time to mitigate. Detection took one minute. Finding the responsible configuration took until 10:27, about 40 minutes after the start. Once it was found, recovery began nine minutes later. Incident response and blameless post-mortems explains why teams measure these phases separately, and why mitigation, not root-cause repair, is the first goal.

What an interviewer could ask from this

Your origin servers are healthy but users see 503s. How is that possible? Something in front of the origin is failing: a CDN, a load balancer or a reverse proxy. Users talk to that layer, so its errors are what they see, whatever the state of the servers behind it.

What is a latent bug, and why do staged rollouts not always catch one? A defect on a code path that has not yet run. A staged rollout only observes behaviour during the rollout. If the triggering input arrives weeks later, the code is already everywhere.

Why can one tenant's input affect all tenants in a multi-tenant system? Tenants share processes and machines. If one tenant's input crashes or corrupts a shared component, everyone using that component is affected. Isolation per tenant, through sandboxes, cells or separate pools, limits the reach.

During an incident, do you fix the bug or remove the trigger? Remove the trigger, or roll back, first. Fastly disabled the configuration and recovered within the hour, then began deploying the code fix about seven hours later. Restoring service comes before understanding everything.

How would you reduce a site's dependence on a single CDN? Options include using two CDNs with DNS or traffic steering between them, keeping DNS time-to-live values short enough to switch, and making sure the origin can take some direct traffic. Each adds cost and complexity, so it is a business decision as much as a technical one.

Why is detection time not the same as recovery time? Monitoring can show that error rates jumped within seconds. It does not say why. Most of this incident was spent locating the one configuration, out of a very large number, that was responsible.

Takeaways

  • The outage needed two things: a bug shipped on 12 May and a valid customer configuration on 8 June. Neither alone caused any harm.
  • Passing tests and weeks of clean production traffic do not prove code is correct. They prove it is correct for the inputs seen so far.
  • A CDN sits on the path of every request, so when the edge fails, healthy origins are unreachable.
  • Shared software plus fast global configuration means a large blast radius unless tenants are isolated from each other.
  • Fastly detected the problem in one minute and still needed most of an hour to recover. Diagnosis, not detection, is usually the slow step.

Sources

  1. Fastly: Summary of June 8 outage
  2. TechCrunch: Numerous popular websites are facing an outage
  3. Fastly: Benefits of using Varnish
  4. Fastly: How Fastly builds POPs

Written by the Codevizag Academy team

An independent explainer built from the public sources listed above. Codevizag Academy is not affiliated with Fastly. Found a mistake? Write to support@codevizag.com.

More case studies

Understood it? Now prove it.

The lessons behind this case study are free, and 20 problems a month are judged on real test cases at no cost.

Start solving free