The Rambam says in Hilchos Malachim 12:2:
There are some Sages who say that Elijah's coming will precede the coming of the Mashiach. All these and similar matters cannot be definitely known by man until they occur for these matters are undefined in the prophets' words and even the wise men have no established tradition regarding these matters except their own interpretation of the verses. Therefore, there is a controversy among them regarding these matters.
Translation from Chabad.org
Two related questions:
1) Where is Eliyahu's arrival debated that you could describe it as "some Sages" and "controversy"? Presumably the Rambam learns from the Bar Kochba events, where Eliyahu Hanavi didn't make an appearance that it is, in fact, uncertain when in the process he will arrive, but is this actually explicitly argued anywhere?
2) In Hilchos Nazir 4:11 the Rambam says that someone who vows that he will be a Nazir on the day "The son of Dovid comes on" is a Nazir from that day forward, unless he makes the vow on Shabbos or Yom Tov. Because there is a Safek if Moshiach can come on those days, his vow only starts the day after (but is effective even on Shabbos and Yom Tov subsequently). What is the doubt about Shabbos and Yom Tov? The Kesef Mishna, the Midgal Oz, the Radbaz, etc. all point to the doubt about whether or not there is "Techumin" above. If there is, then Eliyahu HaNavi can't come on Shabbos and Yom Tov, so Moshiach can't come that day.
So from this we see clearly that Eliyahu HaNavi is an integral part of Moshaich's arrival and not subject a matter for which there is no clear tradition.
So which is it? How exactly does the Rambam understand Eliyahu HaNavi's timing in the arrival of Moshiach?