クラウドフレアがインターネットの半分をダウンさせるが、詳細な事後分析を共有
Cloudflare の設定ミスによる大規模インシデントにより ChatGPT や Spotify など主要サービスが停止したが、同社が公開した詳細な事後分析はインフラ依存リスクと透明性の重要性を示している。
キーポイント
大規模インシデントの発生と影響範囲
Cloudflare の CDN 障害により ChatGPT、Claude、Canva、Uber、Coinbase など世界中の主要サービスが最大 6 時間にわたり停止し、インターネットの半分が影響を受けた。
根本原因と技術的メカニズム
Bot Management モジュールへの設定ファイル伝播中にクラッシュが発生し、Cloudflare のプロキシ機能がオフラインになるという連鎖反応が起きたことが特定された。
AWS 障害との比較と依存リスク
直近の AWS 障害で指摘された「単一障害点」の問題が Cloudflare でも再燃し、X(旧 Twitter)や Signal など他社のサービスも同様に影響を受ける構造的問題を浮き彫りにした。
透明性ある事後分析の意義
Cloudflare の CEO が数時間以内に詳細な原因報告書を公開し、業界標準として期待される迅速かつ誠実なインシデント対応の模範ケースとなった。
権限変更による予期せぬデータ取得
セキュリティ向上のためのデータベース権限変更により、Bot Management モジュールが意図せず r0 データベースから 200 を超える機能を取得してしまい、システムパニックを引き起こした。
未処理のエラーによる連鎖的クラッシュ
機能数が制限を超えた際に返されるエラーを想定していなかったコードが .unwrap() 関数でパニックを起こし、エッジノードが順次停止して半分のインターネットがダウンした。
誤った原因特定と調査の遅延
ステータスページへの影響などから一時的にボットネット攻撃を疑い、根本原因である設定ファイルの不整合を特定するまでに 2.5 時間という長い時間を要した。
影響分析・編集コメントを表示
影響分析
この記事は、現代のインターネットインフラが少数の巨大プロバイダ(Cloudflare, AWS)に過度に集中している脆弱性を浮き彫りにしており、システム設計における「単一障害点」排除の重要性を再認識させる内容です。また、インシデント発生時の透明性ある対応が企業の信頼維持に直結することを示しており、エンジニアリング組織全体にとって重要な教訓となっています。
編集コメント
インフラの集中化リスクが現実のものとなった今、エンジニアリングリーダーは単なる可用性向上だけでなく、依存関係の分散と透明性ある対応プロセスの構築を最優先課題とするべきです。
こんにちは、プラグマティック・エンジニア・ニュースレターのボーナス無料号をお届けするゲルゲリーです。毎号、私はシニアエンジニアとエンジニアリングリーダーの視点を通じて、ビッグテックとスタートアップを取り上げています。今日は、今週の「The Pulse」号の5つのトピックのうちの1つを取り上げます。フル購読者は以下の記事を7日前に受け取りました。このような記事を毎週メールボックスで受け取りたい方は、こちらから購読してください。
多くの購読者は、このニュースレターを学習・開発予算から経費処理しています。そのような予算をお持ちの方は、マネージャーに送信できるメールの例をこちらでご確認いただけます。
始める前に、新しいお知らせを共有できることを嬉しく思います:The Pragmatic Summitです。
4年前、The Pragmatic Engineerは小さなニュースレターとして始まりました。私がビッグテックやスタートアップのエンジニアやエンジニアリングリーダーに関連するトピックを書くというものでした。時は流れ、今日ではニュースレターの読者は100万人を突破し、出版物はポッドキャストにも拡大しました。
常に欠けていたものが一つありました:直接会うことです。エンジニア、リーダー、創業者 – このコミュニティで他の人と会い、互いに学びたい人々。それが今、実現します:
Statsigとのパートナーシップにより、初めてのPragmatic Summitを主催します。席数には限りがあり、チケットは会場費、食事、運営費をカバーする499ドルで設定されています – このイベントから利益を得ることは目的としていません。
サミットへの参加を申し込む
多くの方々に会場でお会いできることを楽しみにしています!
Cloudflareがインターネットの半分をダウンさせる – しかし素晴らしい事後分析を共有
火曜日、数千のサイトが完全または部分的にオフラインとなる6時間に及ぶ障害が発生し、インターネットのどれだけがCloudflareのコンテンツデリバリーネットワーク(CDN)に依存しているかが再認識されました。より注目を集めた被害者の一部は以下の通りです:
ChatGPTとClaude
Canva、Dropbox、Spotify
Uber、Coinbase、Zoom
別件ですが、最近AWSが引き起こした別の障害の際、イーロン・マスクが自身のウェブサイトXで、AWSはSignalにとって強固な依存関係であり、AWSの障害はいつでもこの安全なメッセージングサービスをダウンさせうると指摘したことを覚えている方もいらっしゃるかもしれません。それに対し、ある開発者が、XもCloudflareに対して同じ状況であると指摘しました – そして今週初め、XがCloudflareの障害によって壊れたことで、それが証明されました。
あのAWS障害は同社のus-east-1リージョンで発生し、先月インターネットの大部分をダウンさせました。AWSは3日後にインシデントの詳細を公開しました – このeコマース大手としては異例の速さでした – ただし、その事後分析は高レベルなもので、AWSのDNS Enactorサービスが遅くなり、障害を引き起こした予期せぬ競合状態を引き起こした正確な原因は結局明らかになりませんでした。
今回はCloudflareで何が起こったのでしょうか?
障害を緩和してから数時間以内に、CloudflareのCEOマシュー・プリンセスは、何が正確に間違っていたのかについて、異例に詳細な報告を共有しました。根本原因は、設定ファイルをCloudflareのBot Managementモジュールに伝播させることに関連していました。そのファイルがBot Managementをクラッシュさせ、それがCloudflareのプロキシ機能をオフラインにしました。
以下は、Cloudflareのプロキシレイヤーが高レベルでどのように機能するかの簡単な概要です。これは顧客の「オリジン」リソースを保護するレイヤーであり、悪意のあるリクエストをブロックし、静的リソースをCloudflareのCDNにキャッシュすることで、それらへのネットワークトラフィックを最小限に抑えます:
インシデントは以下のように展開しました:
ClickHouseでのデータベース権限変更が事の始まりでした。権限が変更される前、機能メタデータ(Bot Managementモジュールによって使用される)を取得するすべてのクエリは、Clickhouseの分散テーブル上でのみ実行され、60の機能を含む「default」というデータベースに対して行われていました。
これまで、これらのクエリは共有システムアカウントを使用して実行されていました。Cloudflareのエンジニアリングチームは、システムのセキュリティと信頼性を向上させ、この共有システムアカウントから個々のユーザーアカウントに移行したいと考えていました。ユーザーアカウントはすでに「r0」という別のデータベースへのアクセス権を持っていたため、チームはr0へのアクセス権を明示的ではなく暗黙的にするデータベース権限変更を行いました。
これの副作用として、Bot Managementに渡される機能を収集する同じクエリがr0データベースからの取得を開始し、予想よりもはるかに多くの機能を返すようになりました:
Bot Managementモジュールは200を超える機能の読み込みを許可しません。この制限は、本番環境で使用されている60を大幅に上回っており、パフォーマンス上の理由で設定されていました:Bot Managementモジュールは最大200機能分のメモリを事前に割り当てており、この数を超えると動作しません。
誤った機能ファイルが配信されたマシンでシステムパニックが発生しました。Cloudflareは親切にも、このパニックを引き起こした正確なコードを共有してくれました。それはこのunwrap()関数です:
おそらく起こったこと:
append_with_names()関数はおそらく200機能の制限をチェックした
200を超える機能を確認した場合、おそらくエラーを返した
… そしてコードを書いたとき、append_with_names()がエラーを返すことは想定されていなかった…
… そのため、.unwrap()がパニックを起こし、システムをクラッシュさせた!
エッジノードが、一見ランダムに、次々とクラッシュし始めました。機能ファイルは5分ごとに生成され、エッジノードに段階的にロールアウトされていました。そのため、最初はほんの数ノードがクラッシュし、時間の経過とともに、より多くのノードが応答不能になりました。ある時点では、良い設定ファイルと悪い設定ファイルの両方が配布されており、良い設定ファイルを受け取った故障ノードが一時的に動作を開始することもありました!
なぜ根本原因の特定にそんなに時間がかかったのか?
Cloudflareのエンジニアは、これらすべてを理解し、エッジサーバーに伝播する誤った設定ファイルが彼らのプロキシダウンの原因であると突き止めるのに、異例の長さ – 2.5時間! – を要しました。どうやら、無関係な障害が、Cloudflareチームに、彼らが協調的なボットネット攻撃を受けているのではないかと疑わせたようです。なぜなら、いくつかのエッジノードがオフラインになり始めたとき、同社のステータスページもダウンしたからです:
チームは攻撃の詳細を収集しようとしましたが、攻撃は存在せず、つまり彼らは間違った場所を探すことに時間を浪費したことになります。実際には、ステータスページのダウンは偶然の一致であり、障害とは無関係でした。しかし、彼らの最初の反応が分散型サービス拒否(DDoS)攻撃があるかどうかを確認することだったのは容易に理解できます。
前述の通り、最終的に誤った設定ファイルを障害の原因と特定するのに2.5時間かかり、新しいファイルの伝播を停止し、新しく正しいファイルを作成してデプロイするのにさらに1時間かかりました。これはインシデント開始から3.5時間後のことでした。クリーンアップにさらに2.5時間を要し、UTC 17:06に障害は解決されました。開始から約6時間後です。
Cloudflareはインシデントと学びの詳細なレビューを共有しており、こちらで読むことができます。
なぜ事後分析がそんなに速くできたのか?
Cloudflareについて驚き続けていることの一つは、インシデント解決後24時間以内に非常に詳細な事後分析を公開する点です。共同創業者兼CEOのマシュー・プリンセスは、これがどのように可能だったかを説明しました:
マシューは障害対応コールに参加していた。
障害が解決された後、彼は自宅でインシデントレビューの最初のバージョンを書いた。マシューはリスボン、Cloudflareの欧州本社にいたので、これは夕方早い時間だった。
チームはこの最初の草案と、レビューが必要な質問を含むGoogle Docを回覧した。
数時間以内に、すべての質問に回答された。
マシュー:「私たちの誰も(このインシデントについて)満足していませんでした – 起こったことを恥じていました – しかし、私たちは(事後分析を)真実で正確であると宣言しました。
草案をSFチームに送り、彼らがもう一度チェックを行い、投稿した。
上場企業でありながら、スタートアップのスピードで動くとはこのことです!
このインシデントから学ぶべきことは多くあります、例えば:
エラーを発生させるときは、それをログに明示的に記録すること!Cloudflareはおそらく、エラーを返したコード行がそのエラーもログに記録し、かつCloudflareがそのノードで特定のエラーが急増したときにアラートを設定していれば、このエラーの根本原因をはるかに速く特定できたでしょう。それは確かに緩和にかかった時間を1時間か2時間短縮できたはずです。
もちろん、エラーをスローする前にログに記録することは追加の作業ですが、監視と組み合わせて行うことで
原文を表示
Hi, this is Gergely with a bonus, free issue of the Pragmatic Engineer Newsletter. In every issue, I cover Big Tech and startups through the lens of senior engineers and engineering leaders. Today, we cover one out of five topics from this week’s The Pulse issue. Full subscribers received the below article seven days ago. To get articles like this in your inbox, every week, subscribe here.
Many subscribers expense this newsletter to their learning and development budget. If you have such a budget, here’s an email you could send to your manager.
Before we start: I’m excited to share something new: The Pragmatic Summit.
Four years ago, The Pragmatic Engineer started as a small newsletter: me writing about topics relevant for engineers and engineering leaders at Big Tech and startups. Fast forward to today, and the newsletter crossed one million readers, and the publication expanded with a podcast as well.
One thing that was always missing: meeting in person. Engineers, leaders, founders—people who want to meet others in this community, and learn from each other. Until now that is:
In partnership with Statsig, I’m hosting the first-ever Pragmatic Summit. Seats are limited, and tickets are priced at $499, covering the venue, meals, and production—we’re not aiming to make any profit from this event.
Apply to attend the Summit
I hope to see many of you there!
Cloudflare takes down half the internet – but shares a great postmortem
On Tuesday came another reminder about how much of the internet depends on Cloudflare’s content delivery network (CDN), when thousands of sites went fully or partially offline in an outage that lasted 6 hours. Some of the higher-profile victims included:
ChatGPT and Claude
Canva, Dropbox, Spotify,
Uber, Coinbase, Zoom
Separately, you may or may not recall that during a different recent outage caused by AWS, Elon Musk noted on his website, X, that AWS is a hard dependency for Signal, meaning an AWS outage could take down the secure messaging service at any moment. In response, a dev pointed out that it is the same for X with Cloudflare – and so it proved earlier this week, when X was broken by the Cloudflare outage.
That AWS outage was in the company’s us-east-1 region and took down a good part of the internet last month. AWS released incident details three days later – unusually speedy for the e-commerce giant – although that postmortem was high-level and we never learned exactly what caused AWS’s DNS Enactor service to slow down, triggering an unexpected race condition that kicked off the outage.
What happened this time with Cloudflare?
Within hours of mitigating the outage, Cloudflare’s CEO Matthew Prince shared an unusually detailed report of what exactly went wrong. The root cause was to do with propagating a configuration file to Cloudflare’s Bot Management module. The file crashed Bot Management, which took Cloudflare’s proxy functionality offline.
Here’s a brief overview of how Cloudflare’s proxy layer works at a high level. It’s the layer that protects the “origin” resources of customers – minimizing network traffic to them by blocking malicious requests and caching static resources in Cloudflare’s CDN:
Here’s how the incident unfolded:
A database permissions change in ClickHouse kicked things off. Before the permissions changed, all queries to fetch feature metadata (to be used by the Bot Management module) would have only been run on distributed tables in Clickhouse, in a database called “default” which contains 60 features.
Until now, these queries were running using a shared system account. Cloudflare’s engineering team wanted to improve system security and reliability, and move from this shared system account to individual user accounts. User accounts already had access to another database called “r0”, so the team made the database permission change for access to r0 to be implicit instead of explicit.
As a side effect of this, the same query collecting the features to be passed to Bot Management started to fetch from the r0 database, and return many more features than expected:
The Bot Management module does not allow loading of more than 200 features. This limit was well above the production usage of 60, and was put in place for performance reasons: the Bot Management module pre-allocates memory for up to 200 features, and it will not operate with more than this number.
A system panic hit machines served with the incorrect feature file. Cloudflare was nice enough to share the exact code that caused this panic, which was this unwrap() function:
What likely happened:
The append_with_names() function likely checked for a limit of 200 features
If it saw more than 200 features, it likely returned an error
… and when writing the code, it was not expected that append_with_names() would return an error…
… and so .unwrap() panicked and crashed the system!
Edge nodes started to crash, one by one, seemingly randomly. The feature file was being generated every 5 minutes, and gradually rolled out to Edge nodes. So, initially, it was only a few nodes that crashed, and then over time, more became non-responsive. At one point, both good and bad configuration files were being distributed, making failed nodes that received the good configuration file start working – for a while!
Why so long to find the root cause?
It took Cloudflare engineers unusually long – 2.5 hours! – to figure all this out, and that an incorrect configuration file propagating to Edge servers was to blame for their proxy going down. Turns out, an unrelated failure made the Cloudflare team suspect that they were under a coordinated botnet attack, as when a few of the Edge nodes started to go offline, the company’s status page did, too:
The team tried to gather details about the attack, but there was no attack, meaning they wasted time looking in the wrong place. In reality, the status page going down was a coincidence and unrelated to the outage. But it’s easy to see why their first reaction was to figure out if there was a distributed denial of service (DDoS) attack.
As mentioned, it eventually took 2.5 hours to pinpoint the incorrect configuration files as the source of the outage, and another hour to stop the propagation of new files, and create a new and correct file, which was deployed 3.5 hours after the start of the incident. Cleanup took another 2.5 hours, and at 17:06 UTC, the outage was resolved, ~6 hours after it started.
Cloudflare shared a detailed review of the incident and learnings, which can be read here.
How did the postmortem come so fast?
One thing that keeps being surprising about Cloudflare is how they have a very detailed postmortem up in less than 24 hours after the incident is resolved. Cofounfer and CEO Matthew Prince explained how this was possible:
Matthew was part of the outage call.
After the outage was resolved, he wrote a first version of the incident review, at home. Matthew was in Lisbon, in Cloudflare’s European HQ, so this was early evening
The team circulated a Google Doc with this initial writeup, and questions that needed to be reviewed
In a few hours, all questions were answered
Matthew: “None of us were happy [about the incident] — we were embarrassed by what had happened — but we declared it [the postmortem] true and accurate.
Sent the draft over to the SF team, who did one more sweep, the posted it
Talk about moving with the speed of a startup, despite being a publicly traded company!
There is much to learn from this incident, such as:
Be explicit about logging errors when you raise them! Cloudflare could probably have identified the root cause of this error much faster if the line of code that returned an error, also logged the error, and if Cloudflare had alerts set up when certain errors spiked on its nodes. It could have surely shaved an hour or two off the time it took to mitigate.
Of course, logging errors before throwing them is extra work, but when done with monitoring or log analysis, it can help find the source of errors much faster.
Global database changes are always risky. You never know what part of the system you might hit. The incident started with a seemingly innocuous database permissions change that impacted a wide range of queries. Unfortunately, there is no good way to test the impact of such changes (if you know one, please leave a comment below!)
Cloudflare was making the right kind of change by removing global systems accounts; it’s a good direction to go in for security and reliability. It was extremely hard to predict the change would end up taking down a part of their system – and the web.
Two things going wrong at the same time can really throw an engineering team. If Cloudflare’s status page did not go offline, the engineering team would have surely pinpointed the problem much faster than they did. But in the heat of the moment, it’s easy to assume that two small outages are connected, until there’s evidence that they’re not. Cloudflare is a service that’s continuously under attack, so the engineering team can’t be blamed for assuming it might be more of the same.
CDNs are the backbone of the internet, and this outage doesn’t change that. The outage hit lots of large businesses, resulting in lost revenue for many. But could affected companies have prepared better for Cloudflare going down?
The problem is that this is hard: using a CDN means taking on a hard dependency in order to reduce traffic on your own servers (the origin servers), while serving internet users faster and more cheaply:
When using a CDN, you propagate addresses that point to that CDN server’s IP or domain. When the CDN goes down, you could start to redirect traffic to your own origin servers (and deal with the traffic spike), or utilize a backup CDN, if you prepared for this eventuality.
Both these are expensive to pull off:
Redirecting to the origin servers likely means needing to suddenly scale up backend infrastructure
Having a backup CDN means there must be a contract and payment for a CDN partner which will most likely sit idle. As and when it is needed, you must switch over and warm up their cache: it’s a lot of effort and money to do this!
A case study in the trickiness of dealing with a CDN going offline is the story of Downdetector, including inside details on why Downdetector went down during Cloudflare’s latest outage, and what they learned from it.
This was one out of the five topics covered in this week’s The Pulse. The full edition additionally covers:
Downdetector & the real cost of no upstream dependencies. During the Cloudflare outage, Downdetector was also unavailable. I got details from the team about why they have a hard dependency on Cloudflare, and why that won’t change anytime soon.
Antigravity: Google’s new AI IDE – that its devs cannot use. Google wants to become a serious player in AI coding tools, but Antigravity contains remnants of Windsurf. Interestingly, devs at Google aren’t allowed to use Antigravity for work
Industry pulse. Gemini 3 launch, Anthropic valued at $350B, Jeff Bezos funds an AI company, and unusually slow headcount growth at startups persists.
Five AI fakers caught in 1 month by crypto startup. Candidates who fake their backgrounds and change their looks in remote interviews continue to plague companies hiring full-remote – especially crypto startups.
Read the full The Pulse
Subscribe to my weekly newsletter to get articles like this in your inbox. It's a pretty good read - and the #1 tech newsletter on Substack.

![Predicting the future. Source: Mehul Mohan on X](https://substackcdn.com/image/fetch/$s_!IN2n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a9cfc94-1792-4a5e-8fb6-c1815df54ff0_1072x898.png
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み