Warning signs of the past week’s violent prison protests were apparent for some time but were ignored by the authorities.