San Diego’s battle against hepatitis A has focused new attention on a very old, very San Diego problem: feces.

It’s a battle the region has repeatedly lost. Excrement from the canyons in Tijuana and from our own toilets and streets has bedeviled the region since western civilization took up roots here.

Things had been looking up. Sewage spills are down ten-fold from 20 years ago. Litigious environmental lawyers who once haunted the city had moved on.

Then came the hepatitis A outbreak. The county recently called downtown San Diego “a fecally contaminated environment.” The outbreak renewed interest in the bacteria-filled San Diego River and a terrible spill that send hundreds of thousands of gallons of raw sewage into it earlier this year. A congressman has sounded the alarm about waterways, asking about more vigorous testing. And an image problem has arisen again, like in the 1980s when there so much sewage running into Mission Bay its beaches were closed a quarter of the time. Hoteliers worried tourists would go swimming, catch hepatitis and sue them.

There’s no indication the current hepatitis outbreak – among the deadliest in America in two decades – is linked to the sewage from San Diego’s waterways. Rather, the current theory is poor sanitation around homeless encampments fueled the outbreak.

Still, like the colonias in Tijuana that don’t have sewage service, sewage spills and a lack of restrooms produce the same disgusting problem with no easy solutions. One prominent environmental attorney is again wondering if he needs to get involved many years after he led a movement to clean up the problem.

The region’s struggles with sewage have no end in sight without a – what’s the phrase? – crap ton of money. A recent report by the city, the county, the Regional Water Quality Control Board and the San Diego County Taxpayers Association looked at the bacteria in the region’s waterways. It said the partial cleanup and restoration of San Diego’s rivers would cost about $2 billion. The study also found that, under no scenario would the costs of the cleanup be outweighed by the calculable economic benefits.

Still, investments in the city’s sewage system have paid off. In 2000, the city spilled sewage 365 times. Last year, after a lawsuit forced the city to clean up its act, there were only 37 spills. The city’s goal is to have no more than 40 spills a year.

Spills still happen, of course. Over the past decade, 20 million gallons of sewage have spilled from the region’s public sewer systems into public waterways. That figure that doesn’t even count the millions of gallons of sewage that have come into the United States from Mexico through the polluted Tijuana River.

Earlier this year, a 12-inch plastic pipe owned by the county broke and began emptying sewage into a creek near Lakeside and El Cajon.

On Feb. 28, a neighbor noticed sewage pouring out of the pipe and into Los Coches Creek but, for some reason, didn’t report the problem.

Instead, county maintenance crews doing routine work didn’t discover the spill until March 17.

Officials estimated that 862,920 gallons of raw sewage had ended up in the creek, which drains into the San Diego River, which drains into the Pacific Ocean near Ocean Beach. They have no way of knowing exactly how much had spilled.

And because the spill had gone undetected for so long, the county warned nobody about it as its was happening. If there’s a known spill, officials scramble to test the waters and then may close beaches so swimmers and surfers don’t end up playing in a plume of wastewater.

The San Diego River is the only water body to be potentially implicated in the recent hepatitis A outbreak that has ravaged the county. Several hundred homeless people live along the river, including some who are said to cook and clean with its water, and bath in it. At least four cases of hepatitis A, including one death, have been linked to the San Diego River Valley, according to a July 26 county health department memo, but the county does not think the river itself is to blame.

“Currently, out of the 490 total cases, none of these cases have been identified as a waterborne source,” said county spokesman Michael Workman. In fact, he said, the Centers for Diseases Control said it has not identified an outbreak of the virus in a moving water source for over 30 years.

Problems with the San Diego River inspired a round of attention on spills in 2000, after 34 million gallons of city sewage went in the river and closed beaches from Ocean Beach to Point Loma.

San Diego environmental groups sued the city for repeatedly letting millions of gallons of sewage dump into coastal waters – all in violation of the federal Clean Water Act. The city eventually settled that case and agreed to raise sewer rates to pay for repairs, which have dramatically reduced the number of spills and the amount of sewage spilled.

“It was a huge success,” said Marco Gonzalez, one of the environmental attorneys who brought the case against the city. “I would call it probably the biggest success in my legal career.”

San Diego troubled history with sewage actually goes back 130 years, when the city’s first sewer system was declared “an unpardonable blunder” immediately after it was installed. There were open-air toilets, colonies of rats and standing sewage even as the city was preparing for the Panama-California Exposition that helped put San Diego on the map in 1915. In the 1930s, there was so much sewage off the coast that it was corroding the hulls of Navy ships and driving away tourists. In the 1950s, San Diego Bay was, for lack of a better word, gross because of all the human waste that ended up there.

There have been 398 sewage spills across San Diego County in the past decade. Nearly all the 20 million gallons of sewage spilled into public waterways came from big spills of 200,000 gallons or more.

The largest was the city’s fault. A 15-inch city pipeline in the hills overlooking Mission Bay broke in January 2016 because of “unprecedented flooding and significant erosion” blamed on an El Niño storm. About 6.7 million gallons of sewage spilled into Tecolote Creek and then into the bay.

La Mesa, Oceanside, Camp Pendleton and the Padre Dam Municipal Water District also had large spills in the past decade.

Gonzalez said he’s been focused on other environmental issues lately, but that could change if spills continue.

“If we see a couple more of these big spills, I’m sure we’ll end up knocking some heads,” he said.

Gonzalez said some spills are hard to prevent, though: Sometimes a pipeline will break because the ground beneath it erodes in a storm. Sometimes a power outage will shut down a pump station, which causes sewage to back up and spill.

But there’s some new technology that is helping sewage system operators track down problems. Escondido said it avoided a spill earlier this year thanks to such a monitoring system.

“We called out the spill that didn’t happen, which is an example of what can happen if you’re watching the water underground,” said Gregory Quist, the owner of the company that provided the technology.

The big spill into the San Diego River in 2000, like the smaller spill this year into Los Coches Creek, went undetected for days.

Over the years, there’s been major improvements in coastal water quality when the weather is dry, as it is much of the time, said Kenneth Schiff, deputy director of the Southern California Coastal Water Research Project. When it rains, though, a bacterial stew still closes beaches.

“During wet weather, we frequently quantify exceedances in San Diego and other parts of Southern California,” he said.

There’s considerable debate over who or what is responsible for the bacterial runoff: How much of it is leaking sewer systems? How much of it is homeless people using the river like an outdoor latrine?

Everyone seems to agree both are to blame. But in repeated conservations, government officials tend to emphasize homeless people, while environmental activists tend to emphasize problems with government-run sewage systems.

The city has numerous water-quality monitoring obligations related to pathogens and chemicals in runoff, but there is no consistent monitoring for hepatitis A in any Southern California waterways.

Even if the city was testing creeks, rivers, bays and the ocean for the virus, it’s unclear what it would do if it found it.

“We aren’t aware of a Hep A max concentration level that would be considered or expressed as dangerous or not dangerous,” Anthony Santacroce, a city spokesman, said in an email.

In other words, we’re not sure how much of the virus in waterways is likely to make someone sick.

Rep. Scott Peters noted in a recent letter that there’s “rising fear” that San Diego’s waterways are now carrying the virus, even if they weren’t the initial source of the outbreak. In a reply to his questions, the Environmental Protection Agency said no one is monitoring the water for the virus, but said the Coastal Water Research Project offered to work on a new monitoring protocol.

Correction: An earlier version of this post said the San Diego River drains into Mission Bay. It drains into the Pacific Ocean near Ocean Beach, adjacent to Mission Bay.