There are lots of opinions on this, and there are several cities in California who have gone through or started the Chapter 9 process[1]. When I read the material on these I see a fundamental tension between committing to planned future payments vs the ability to scale revenue to make those payments. As a result, any "baked in" payments, whether they are wage increases in union contracts or interest payments on general obligation bonds, can consume more than the available revenue. Bottom line is that things like pension obligations contribute to the problem but it takes a couple of things going south at the same time to drag a city under.
That said, responsible city management which is unable to arbitrarily change the tax rate by law (the fabled CA requirement of 2/3 majority vote) would not enter into contracts that would put the city's solvency at risk, and yet they still do.
[1] The factors contributing to a local government's decision to file for relief under Chapter 9 typically are varied and complex. From the information that has been made available to date, it appears that Stockton and San Bernardino's bankruptcy filings were driven by some similar factors including: long–term imbalances in revenues and spending, reduced tax revenues associated with the downturn in the economy, some constraints to reducing expenditures in the short term, and increasing costs to provide retiree benefits. Additionally, substantial borrowing appears to be a factor in Stockton's filing, and prior budgeting practices, such as borrowing from internal funds, appears to be a contributing factor in San Bernardino's case. By contrast, the bankruptcy filing by Mammoth Lakes appears to be driven by a single significant event—a recent legal judgment that required it to pay an amount more than twice its annual General Fund budget. -- https://lao.ca.gov/reports/2012/localgov/local-government-ba...