WHEN it was discovered in 2000, the Kashagan oilfield in Kazakhstan's waters in the northern Caspian Sea was the world's biggest oil find in three decades. By now it was supposed to be pumping out 1.2m barrels a day (mbd), enough to meet Spain's entire consumption.

But the project, whose name sounds unfortunately like "cash all gone", went spectacularly awry. A year ago, when the first trickle of crude briefly flowed, it was already eight years behind schedule. Having cost $43 billion, it was $30 billion over budget. And production lasted only a few weeks before leaks of poisonous gas forced its suspension. Earlier this month a government minister admitted it would not restart until at least 2016.

Undeterred by the Kashagan fiasco, this week the government said it would approve a plan to expand the onshore Tengiz oilfield, another huge budget-buster. Tengiz was first expected to cost $23 billion but the government said this week that the bill had risen to $40 billion.

Each of the two oilfields is owned by a different consortium of foreign firms and the state oil company, KazMunaiGaz. In Kashagan's case they include Exxon, Shell, Total and ENI. In part the project's setbacks are due to unexpected technical problems. Corrosive and poisonous hydrogen sulphide gas, pumped up from the seabed along with the oil, has eaten through pipes bringing it onshore.

A general view shows the Bolashak oil plant on the Kashagan offshore oil field near Atyrau in Kazakhstan June 30, 2013. REUTERS/Leon Neal

It may cost another $5 billion to fix the problem. But insiders say privately that with so many companies involved, the project has lacked clear leadership and suffered from government meddling.

Investors of all kinds worry about "the declining predictability of Kazakhstan's regulatory and legal environment", says Mariyam Zhumadil of Halyk Finance, an investment bank in the commercial capital, Almaty.

In 2010 the government filed a $1.2 billion tax claim against the consortium that operates another field, Karachaganak, while making noises about breaches of environmental rules, not long after expressing an interest in buying a stake in the field. Later the consortium gave it 10% in return for it agreeing to expand the field.

Likewise, at Kashagan, environmental officials have fined the field's operators $737m for burning off the poisonous gas, which the consortium argues was an emergency measure. Ms Zhumadil reckons the fine is a "tool for future negotiations, perhaps to strengthen the national oil company's presence in the project."

This may not be the best way to encourage foreign firms to pump in the tens of billions of dollars more that are still needed to develop Kazakhstan's oilfields.

Click here to subscribe to The Economist