Global investment in energy fell for a second consecutive year in 2016, and an international watchdog is ringing alarm bells about future shortages of oil and electricity.

Energy companies and investors last year plowed $1.7 trillion into fossil fuel exploration, new power plants, upgrades to the electric grid and all the other means of powering the world, the International Energy Agency reported on Tuesday. That marks a 12 percent drop from 2015, IEA said in its annual World Energy Investment report.

The drop was largely driven by falling oil and gas spending during the second full year of a punishing crude price downturn, as well as falling investment in power generation, particularly from coal plants.

The declining investment won’t have much affect in the coming years because the world is oversupplied with oil and some global markets can produce more electricity than they use.

However, “falling investment points to a risk of market tightness and undercapacity at some point down the line,” according to IEA, which advises the international community on energy policy.