SAN FRANCISCO — The United States is on track to achieve the second-longest economic expansion in its history. Unemployment is at a 17-year low. And California’s state budget has a multibillion-dollar surplus.

So why is its longtime governor, Jerry Brown, issuing prophecies of doom?

“What’s out there is darkness, uncertainty, decline and recession,” Mr. Brown said recently after presenting his final budget to legislators.

California has accounted for about 20 percent of the nation’s economic growth since 2010, significantly more than its share of the population or overall output. But Mr. Brown, in his final year in office, has raised the question on the minds of those paid to think about the economy: How long can this last?