Python包索引(PyPI)的文件托管服务在2026年8月中旬经历了一场持续约两周的服务中断事件。1从8月15日至8月28日期间,files.pythonhosted.org下载文件频繁返回502和503错误,造成用户无法正常获取包文件。1
这场故障的根本原因是Fastly内容分发网络的金丝雀部署过程中出现配置错误。1一个位于Seattle的缓存节点(cache-pae2080020)在部分回滚操作中配置与其他节点不匹配,引发了单点故障。1随着事件推进,技术团队还发现了PyPI自身Fastly配置中存在的多个缺陷,包括B2超时时缺乏回源故障转移机制、分段缓存对HTTP范围请求的不完整支持,以及URL规范化顺序错误。1
故障期间出现了多次严重事件。18月18日单日内记录了6小时内88个502错误,涉及32个无关的包。1到了8月21日,一个客户端发送的逻辑无效范围请求导致近百万级的5xx响应。18月24日,两个并行下载器生成了41,315个同类错误。1服务从8月20日开始逐步恢复,直至8月28日Fastly发布补丁后才完全修复。1
针对此次事件,Python软件基金会采取了后续措施,包括招聘基础设施工程师以及将PyPI流量从Fastly金丝雀计划中移除。1
PyPI's file hosting service encountered intermittent 502 and 503 errors from August 15 to August 28, 2026, affecting users attempting to download packages from files.pythonhosted.org 1. The disruption lasted approximately two weeks before being fully resolved on August 28 1.
The incident stemmed from a configuration mismatch in Fastly's canary deployment process, which resulted in a single Seattle cache node (cache-pae2080020) operating with incorrect settings 1. Investigation revealed multiple underlying deficiencies in PyPI's own Fastly configuration, including inadequate origin failover handling during B2 timeouts, incomplete HTTP range request support in segmented caching, and improper URL normalization sequencing 1. Initial recovery began on August 20, followed by complete resolution after Fastly released a patch on August 28 1.
Service disruptions escalated in severity throughout the incident period. On August 18 alone, a single six-hour window recorded 88 502 errors affecting 32 unrelated packages 1. A more severe incident occurred on August 21, when a single client sending logically invalid range requests triggered nearly one million 5xx responses 1. By August 24, two concurrent download processes generated 41,315 identical errors 1.
In response, the Python Software Foundation announced plans to hire additional infrastructure engineers and decided to remove PyPI traffic from Fastly's canary deployment program 1.
评论
还没有评论,欢迎留下第一条。