Windows Azure Leap Day Outage
Code computed "one year from today" by adding 1 to the year. On 29 February that date doesn't exist.
- Severity
- Status page turned red
- Difficulty
- beginner
- Companies
- Microsoft
- Tech
- Windows Azure, Certificates, Date and time handling, Virtual machines
- Root cause
- dates/time/certificates, latent bug, dependency cascade
The story
Quick (1 min)
On 29 February 2012, a leap day, Microsoft's cloud platform Windows Azure had a major outage that lasted into the next day.
Each new virtual machine created a security certificate valid for one year. The code worked out "one year from today" by adding 1 to the year. On 29 February 2012 that gave 29 February 2013, a date that doesn't exist. Certificate creation failed, so new virtual machines couldn't start.
Azure's automation then assumed the servers were broken and moved workloads elsewhere, where they hit the same bug, so the problem spread. A rushed fix later broke networking for seven clusters.
The lesson: dates are harder than they look, and automation that misdiagnoses a failure can spread it.
Keep reading to the end to earn XP.Read. XP earned.
Engineer (2 min)
Components. Azure grouped about 1,000 servers into clusters, each managed by a Fabric Controller (FC). Every server ran a Host Agent (HA), and every VM ran a Guest Agent (GA). On startup, the GA created a transfer certificate so the HA could send it encrypted secrets.
The bug. The GA set the certificate's valid-to date by taking the current date and adding one to the year. From 4:00 PM PST on 28 Feb (00:00 UTC on 29 Feb), that produced 29 February 2013, an invalid date, so certificate creation failed and the GA terminated.
How automation spread it. The HA waits 25 minutes for the GA. After three timeouts on a clean VM, it assumes hardware failure and reports the server to the FC, which marks it "Human Investigate" (HI). The FC then service heals by moving that server's VMs to other servers, where new VMs hit the same bug. A cluster-wide HI threshold eventually froze healing and updates. That was a deliberate safety valve.
Bad timing. Many clusters were mid-rollout of new FC/HA/GA versions, creating lots of new VMs, so they hit the HI threshold exactly 75 minutes (3 × 25) later, at 5:15 PM.
Response. The bug was identified at 6:38 PM. Service management was disabled worldwide at 6:55 PM, a first for Azure. A fixed GA went out from 2:11 AM.
The second outage. For seven half-updated clusters, engineers "blasted" an older HA to every server at once, skipping the normal update-domain staging. The package accidentally included a networking plugin for the newer HA, which was incompatible. Every VM in those clusters, healthy ones included, lost networking at 2:47 AM. The single-server test hadn't checked network connectivity.
Interview takeaway: use date libraries, not string arithmetic; don't let automated healing assume the wrong cause; and keep staged rollouts even for emergency fixes.
Keep reading to the end to earn XP.Read. XP earned.
Deep dive (3 min)
Timeline (PST, from Microsoft's root cause analysis)
- 28 Feb, 4:00 PM (00:00 UTC 29 Feb): GAs in new VMs fail to create transfer certificates.
- 5:15 PM: clusters mid-rollout hit the server HI threshold exactly 75 minutes later. Critical alarms automatically stop updates and page operations.
- 6:38 PM: on-call Fabric Controller developers identify the bug.
- 6:55 PM: service management (deploy, update, scale) is disabled in all clusters worldwide, the first time ever, so customers can't make things worse. Already-running apps keep running.
- ~10:00 PM: test and rollout plan for a fixed GA. 11:20 PM: fixed GA code ready.
- 29 Feb, 1:50 AM: testing complete in a test cluster, and also tested on Microsoft's own production VMs.
- 2:11 AM: rollout to one production cluster succeeds, then the fix is pushed to all clusters.
- 2:47 AM: for seven partially updated clusters, an older HA package is "blasted" to every server at once. It contains an incompatible networking plugin, and every VM in those clusters loses its network. ACS and Service Bus deployments lived there, so dependent apps everywhere break.
- 3:40 AM: corrected HA package, this time tested for VM connectivity.
- 5:23 AM: service management restored to the majority of clusters.
- 5:40 AM: fix blasted to the seven clusters. 8:00 AM: largely operational, but many servers need manual restoration through the day.
- 1 Mar, 2:15 AM: dashboard reports all services healthy.
The bug, precisely
"The leap day bug is that the GA calculated the valid-to date by simply taking the current date and adding one to its year. That meant that any GA that tried to create a transfer certificate on leap day set a valid-to date of February 29, 2013, an invalid date that caused the certificate creation to fail."
Why automation made it worse
The HA's heuristic was that a clean VM failing three times with no error reported must mean bad hardware. That was reasonable in general and wrong here. Moving VMs to healthy servers spread the trigger. The HI threshold worked as designed: it moved whole clusters into a frozen state so humans could take over.
What Microsoft committed to
- Testing: better detection of time-related bugs; code analysis tools enhanced; the code base already reviewed.
- Fault isolation: distinguish software faults from hardware faults before they propagate.
- Graceful degradation: finer-grained controls than switching off service management entirely.
Service credit
A 33% credit for the affected billing month(s) to all customers of Compute, Access Control, Service Bus and Caching, whether impacted or not.
"The three truths of cloud computing are: hardware fails, software has bugs and people make mistakes." (Bill Laing and the Windows Azure Team)
Keep reading to the end to earn XP.Read. XP earned.
Failure replay
Step by step, what broke and what it hit next. Showing the key steps. Switch to Engineer or Deep dive for every step.
- 4:00 PM Feb 28 (UTC Feb 29)Guest Agentfailing
New VMs compute certificate expiry as "same date, year + 1", which gives 29 Feb 2013, an invalid date. Creation fails.
Affects: Host Agent
- +25 min ×3Host Agentdegraded
After three 25-minute timeouts, the Host Agent decides the hardware must be faulty.
Affects: Fabric Controller
- OngoingFabric Controllerfailing
It marks servers for human investigation and moves their VMs elsewhere, where they hit the same bug.
Affects: Guest Agent
- 5:15 PMFabric Controllerdegraded
Clusters mid-rollout hit the safety threshold. Healing and updates freeze and alarms page staff.
- 6:55 PMService managementdown
Bug identified at 6:38. Deploy, update and scale are disabled worldwide to protect running apps.
Affects: Customers
- 2:11 AMGuest Agentrecovering
A fixed Guest Agent rolls out to all clusters after testing.
- 2:47 AMHost Agentdown
In seven half-updated clusters, a rushed "blast" update ships an incompatible networking plugin. Every VM loses its network.
Affects: Customers
- 2:47 AMCustomersdown
Apps depending on Access Control and Service Bus in those clusters break worldwide.
- 5:40 AM–Mar 1Customersrecovering
A properly tested fix goes out. Servers are repaired manually and all services are healthy by 2:15 AM on 1 March.
Impact
- Who was affected
- Windows Azure Compute and dependent services (Access Control Service, Service Bus, SQL Azure Portal, Data Sync). Storage and SQL Azure were not affected.
- How long
- From 4:00 PM PST on 28 Feb until all services were reported healthy at 2:15 AM PST on 1 March (about 34 hours).
- Cost
- not disclosed (33% service credit for the affected month to all customers of the impacted services).
Lessons
- Never do date arithmetic by hand; use a date library and test edge dates (leap days, month ends, time zones).
- Self-healing automation must be able to tell software faults from hardware faults, or it will spread bugs.
- Circuit breakers such as the HI threshold work; build them in before you need them.
- Emergency fixes still need staged rollouts and full-health testing, including networking.
Quiz
Why did certificate creation fail on 29 February 2012?
The answer is The code added 1 to the year, producing 29 February 2013, which doesn't exist. The valid-to date was computed by incrementing the year, giving an invalid date.
Check answer
The code added 1 to the year, producing 29 February 2013, which doesn't exist. The valid-to date was computed by incrementing the year, giving an invalid date.
Why did the problem spread to more servers?
The answer is The platform thought servers had hardware faults and moved their VMs elsewhere, where the bug hit again. After three Guest Agent timeouts, the Host Agent assumed hardware failure, and service healing moved VMs to new servers, where they failed the same way.
Check answer
The platform thought servers had hardware faults and moved their VMs elsewhere, where the bug hit again. After three Guest Agent timeouts, the Host Agent assumed hardware failure, and service healing moved VMs to new servers, where they failed the same way.
What caused the secondary outage in seven clusters?
The answer is A rushed "blast" update included a networking plugin incompatible with the older Host Agent. The package with the older HA included a networking plugin written for the newer HA. The single-server test didn't check network connectivity.
Check answer
A rushed "blast" update included a networking plugin incompatible with the older Host Agent. The package with the older HA included a networking plugin written for the newer HA. The single-server test didn't check network connectivity.
What unusual step did Microsoft take at 6:55 PM PST?
The answer is Disabled service management (deploy, update, scale) in all clusters worldwide. Disabling service management kept customers from making things worse while already-running apps kept running. It was the first time Azure had done this.
Check answer
Disabled service management (deploy, update, scale) in all clusters worldwide. Disabling service management kept customers from making things worse while already-running apps kept running. It was the first time Azure had done this.
Interview prep
Try answering out loud before you open the model answer.
- debugging
A service fails every four years on one specific day. Walk through how you'd find and prevent this class of bug.
Show model answer
A four-year cycle points at leap-year handling. Look for date arithmetic done by manipulating fields directly, such as "add 1 to year", "add 30 days for a month" or "86400 seconds per day". Azure's Guest Agent created a certificate valid-to date of 29 Feb 2013, which doesn't exist. Fixes: use a well-tested date library, express durations properly ("plus one year" with defined leap-day behaviour), and add tests that freeze the clock at edge dates: 28/29 Feb, 31 Dec, DST transitions and leap seconds. Static analysis can flag manual date manipulation.
A strong answer hits:
- Recognise the leap-year pattern
- Avoid manual field arithmetic on dates
- Clock-injection tests at edge dates
- Static analysis or code review rules
How did your answer compare? - system design
Your platform auto-heals by moving workloads off servers it thinks are broken. How do you stop it from spreading a software bug across the fleet?
Show model answer
Self-healing assumes failures are independent and local. A software bug is neither. Safeguards: rate-limit healing actions and trip a circuit breaker when too many servers fail in a short window (Azure's HI threshold did this); classify failures carefully, since "no error reported" isn't proof of a hardware fault; stop rollouts automatically when failure rates rise; and alert humans as soon as correlated failures appear rather than letting automation keep going.
A strong answer hits:
- Correlated failures signal software, not hardware
- Rate limits and circuit breakers on remediation
- Pause rollouts automatically on anomalies
- Escalate to humans early
How did your answer compare? - behavioural
Under pressure during an outage, would you skip normal deployment safety steps to ship a fix faster? Use the Azure 2012 incident to explain.
Show model answer
Azure "blasted" an older Host Agent to every server in seven clusters at once, skipping update-domain staging. The package carried an incompatible networking plugin, which knocked healthy VMs offline and made the incident much worse. Pressure to be fast is real, but a fix can cause a bigger outage. I'd keep a fast-but-staged path: one server, then one cluster, then everything, with a health checklist that covers networking and dependencies. That costs minutes and protects against hours.
A strong answer hits:
- Emergency fixes can cause secondary outages
- Keep a fast but staged rollout path
- Health checks must cover the full VM (including network)
How did your answer compare?
Go deeper
- Official postmortemSummary of Windows Azure Service Disruption on Feb 29th, 2012Microsoft Azure Blog, link checked 2026-11-24