The national mining ​agency had warned weeks earlier that a buildup of gases at the mine could become dangerous.