According to the latest reporting, the actual flight deviated from the advance flight plan by hundreds of miles. I don't know the regs in that region, but I suspect that IFR flight plans must declare an alternate, and it's unclear if it was Makhachkala and, if so, why they crossed the sea instead.
That seems to have been the real problem. Russia was not anticipating airline traffic there. Sounds like there has been fairly active drone activity in that area.
update: Another comment suggested a plausible different order of events: https://news.ycombinator.com/item?id=42521882