Investigations are underway to figure out what actually happened in the months and years leading up to this week's unprecedented failure at two spillways on the Oroville Dam in California - the tallest in the United States. 

While information is still be gathered, early reports have stated that three environmental groups warned federal officials way back in 2005 that something like this could happen, and what's perhaps even more concerning is the fact that Oroville is just one of nearly 100,000 dams across the US that are in serious need of repairs.

"The last time the American Society of Civil Engineers issued its Infrastructure Report Card was in 2013, when it gave US dams a 'D' grade, and reported that more than 4,000 are deficient," Jacques Leslie reports for the Los Angeles Times.

"The group will publish a new report card next month; while its contents haven't been released, a spokesperson told me the conclusions of the 2013 report card are 'still fairly accurate'." 

In case you missed it, earlier this week, at least 188,000 residents in areas surrounding the Oroville Dam in Northern California were forced to evacuate their homes in response to a crack that formed in the emergency spillway.

While the threat has now more or less subsided, flash flood warnings remain in place, and several homes and farms have been submerged after waters from the dam overflowed into the nearby Feather River.

What's perhaps most notable about the crisis is just how suddenly it occurred, and how ill-equipped officials on the scene appeared to be when it came to predicting the outcome of events.

Panicked messages from the Butte County Sheriff early on painted a vastly different picture to that of the California State Department of Water just hours later, and locals were left to wonder what was actually going on.

But how can a crack this big catch anyone by surprise?

According to Justin Pritchard and Ellen Knickmeyer at the Associated Press, inspectors with the state agency that operates and maintains the dam did not find any concerns in either 2014 or 2015. 

"Conditions appeared to be normal," the inspector wrote in reports from both years.

As recently as August 2016, the spillway was reportedly not checked on foot, "but instead from afar", and no cause for concern was recorded. 

"Both the most recent report and the report from February 2015 note a 'long-standing diagonal crack' on the left pier for one of the gates, but they say the crack had not extended to the point where it required an investigation," Oroville MR News reports.

But over the past few weeks, torrential rains have filled Oroville Dam to the brim, and this month, it hit 151 percent of its normal capacity

That forced operators to use the emergency spillway for the first time since the Oroville Dam begun operations in 1968, and the massive amounts of water that funnelled through it led to unexpected levels of erosion that significantly fractured and widened the crack.

The only thing left to do was empty the excess water into the nearby Feather River - at a rate of 100,000 cubic feet (2,831 cubic metres) per second.

The biggest issue appears to be how the dam managers were addressing the crack - there seems to have been little done to actually mend the spillway, with staff reportedly taking a 'bandaid' approach to the situation.

"We don't have details on the repairs, but they put cement into the cracks and troweled it over," Robert Bea, professor emeritus of civil and environmental engineering at the University of California at Berkeley, told the Associated Press

"I call it 'patch and pray.'"

And this is particularly worrying when you realise that the dam operators had been warned of this exact risk 12 years ago, by three environmental groups: Friends of the River, the Sierra Club, and the South Yuba Citizens League.

"In response to the dam's relicensing application in 2005, they filed a motion with federal officials to require that the earthen hillside that comprises the auxiliary spillway be covered with concrete to prevent erosion," the Los Angeles Times reports.

"But according to the San Jose Mercury News, federal officials dismissed the request on the grounds that even if the emergency spillway suffered 'significant damage,' it would not threaten control of reservoir water or endanger the dam itself."

They're right about one thing - the Oroville Dam has not been compromised in terms of its construction, but the week showed just how dire the effects can be when its emergency spillway is suddenly unfit for use.

And now government officials all over the country are likely wondering if something similar could happen to dams in their local area.

The Oroville Dam is now almost 50 years old, and has never undergone the kinds of upkeep it clearly required, and as you can see in the graph below, it's just one of thousands of dams of a similar age:

dams-febUnited States Army Corps of Engineers

"A 2016 survey by the Association of State Dam Safety Officials estimated the cost of repairing deficient dams that currently place downstream residents at risk at $22.91 billion," the Los Angeles Times reports.

"Carrying out that task would take many decades."

The story at Oroville is still unfolding, but it sure seems like a timely warning for dam operators all over the country to make sure their own facilities are in check.