Iran has barred its citizens from traveling to Saudi Arabia to perform the Umrah, or lesser pilgrimage to Mecca, which is the recommended-but-not-obligatory pilgrimage that can be performed any time (as opposed to the obligatory Hajj, which has to be performed during the annual Hajj). Ostensibly, Iranian authorities are reacting to a report that two Iranian teens were sexually assaulted by Saudi security at the Jeddah airport after flying in with their family. It’s a horrible report (though as Jim White notes, the severity of the alleged assault has been downgraded several times by Iranian authorities, from “rape” to “harassment” to “attempted assault”), but it’s the context that really matters here; the Saudis are intervening militarily in Yemen against the Houthis, whom they allege to be Iranian proxies (the actual evidence for that claim is pretty murky though there is some smoke there), and tensions are obviously very high. The Saudis have also allegedly been giving would-be Iranian pilgrims trouble with their visa applications, and Iranian news has said that flights from Tehran to Jeddah are being denied permission to land.
The Hajj isn’t until September this year, so for now the Iranian travel ban only affects pilgrims making the less-important Umrah, but it will be interesting to see what happens if things aren’t restored to some semblance of normalcy before the Hajj. The sexual assault allegations caused a pretty significant protest outside the Saudi embassy in Tehran on Saturday that was at least officially termed “spontaneous,” but there’s going to be a lot of pressure on Hassan Rouhani’s government to allow would-be Hajj pilgrims (who are obligated to make the pilgrimage at least once in their lives and many of whom may have saved and planned for years to attend this year’s pilgrimage) to travel as normal, assuming this dispute is still ongoing by then.
There is actually historical precedent for an Iranian government to bar or at least discourage its citizens/subjects from undertaking a pilgrimage to Mecca. Josh Keating notes a few relatively recent examples:
(Iran has suspended pilgrimages on a few previous occasions, including in 1943 after an Iranian citizen was beheaded for vomiting while circling the Kabaa and in 1987 when about 400 pilgrims, mostly Iranians, were killed in clashes with Saudi security forces after launching an anti-U.S. demonstration.)
But there are much earlier cases as well. Over the course of Islamic history it’s actually been the norm for Iran and the Hijaz (western Arabia, where Mecca and Medina are located) to be ruled by separate and often competing authorities. In 969, when the Shiʿa Fatimid Caliphate conquered Egypt, it also took control of the Hijaz (which was administered from Egypt) away from the Abbasid caliphs in Baghdad. From that point on, even when the Fatimids were overthrown by Saladin (a Sunni who nominally pledged allegiance to Baghdad), the Hijaz was governed by whichever kingdom controlled Egypt, which was never the same kingdom that controlled Iran.

Pilgrimage was (and still is) big business, so it must have pained those Iranian rulers to watch their people traipse off to Mecca to spend money in somebody else’s kingdom (though those rulers would themselves perform the Hajj at least once to demonstrate their religious credentials). So it was that the Timurid ruler Shahrukh (r. 1405-1447) and his favorite wife Gawharshad spent lavishly to build up the eastern Iranian city of Mashhad as an alternative to the Hijaz (which was then under the control of the Mamluks), if not for the Hajj then at least for the Umrah. Mashhad had long been a pilgrimage site, since the death and burial there of the Eighth (Imami) Shiʿa Imam, Ali al-Rida, in 818, but Shahrukh build a new communal mosque and shrines to draw pilgrims to the city.
A couple of centuries later, in 1601, the Safavid ruler Shah Abbas I is said to have walked (though one of the main sources for this event has him completing the trip far more quickly than would be physically possible) from his capital, Isfahan, to Mashhad, to demonstrate the importance of the pilgrimage and his own piety. The path he would have taken from Isfahan to Mashhad is somewhere around 750 miles, so if Abbas really did walk the whole way (and the other two sources do give more reasonable timelines for this–one actually seems a little too long), then that’s a pretty impressive feat. Abbas had plenty of reason to push Mashhad as an alternative pilgrimage site; where Shahrukh and the Mamluks simply weren’t friendly with one another, the Safavids and the Ottomans (who controlled Egypt and the Hijaz by 1601) were frequently at war with each other.
It’s worth noting that, while the Safavids and most of their subjects were Imami Shiʿa (at least by 1601) and had sectarian reasons to encourage pilgrimage to the shrine of one of their Twelve Imams, Shahrukh was Sunni (and a pretty devoted one at that, at least compared to his father, Timur) and most of his subjects were Sunni. Historically, though, while Sunnis never accepted the idea that the imams should have any political authority, they still venerated the imams as descendents of the Prophet. So it was perfectly normal for a 15th century Sunni ruler to encourage his Sunni subjects to make a pilgrimage to the shrine of a Shiʿa imam. Times have changed, I guess.
One last thing about Mashhad: because of its historical prestige (going back well before Shahrukh), pilgrims to Mashhad are entitled to call themselves Mashti, just as those who complete the Hajj are entitled to call themselves Hajji.