Two men disagreed during the time of the Messenger of Allah ﷺ about the mosque founded upon piety. One of them said, "It is the mosque of the Messenger of Allah ﷺ."The other said, "It is the mosque of Quba."So they went to the Prophet ﷺ and asked him about it. He replied, "It is this mosque of mine."
اختلف رجلان على عهد رسول الله ﷺ في المسجد الذي أسس على التقوى، فقال أحدهما: هو مسجد رسول الله ﷺ، وقال الآخر: هو مسجد قباء، فأتيا النبي ﷺ فسألاه فقال: هو مسجدي هذا.
Imam Ahmad (22805) and Tabarani in Al-Kabir (6025) both narrated it from Waki, who said, "Rabia bin Uthman Taymi narrated to us, from Imran bin Abu Anas, from Sahl bin Saad," and he related the hadith.Its chain is hasan, on account of the criticism directed at Rabia bin Uthman Taymi. Abu Zura and Abu Hatim criticized him, while Nasai said, "There is no harm in him." Ibn Hibban listed him among the trustworthy narrators, and Muslim narrated one hadith from him in his Sahih. The conclusion regarding him is that his hadith is hasan.He has been corroborated. Ibn Hibban graded it sahih (1604, 1605), narrating it also through this same route. Haythami said in Al-Majma (4/10), after attributing it to Ahmad and Tabarani, "Their narrators are the narrators of the Sahih."As for the corroboration, it is what Imam Ahmad narrated in shortened form (22838) from Abdullah bin Harith, who said, "Aslami, meaning Abdullah bin Amir, narrated to me, from Imran bin Abu Anas, from Sahl bin Saad," who said, "Whenever the Messenger of Allah ﷺ was asked about the masjid founded on piety, he would say, 'It is my masjid.'"Abdullah bin Amir Aslami is daif, and Haythami pointed this out in Al-Majma (10/4), saying, "Ahmad narrated it, and it contains Abdullah bin Amir Aslami, who is daif."I say, it is as he said, for part of his confusion is that at one time he narrated it this way, and at another time he added, after Sahl bin Saad, "Ubayy bin Kaab."This is shown by what Ahmad also narrated (21107) from Abu Naeem, who said, "Abdullah bin Amir Aslami narrated to us, from Imran bin Abu Anas, from Sahl bin Saad, from Ubayy bin Kaab, that the Prophet ﷺ said, 'The masjid founded on piety is this masjid of mine.'" Hakim graded it sahih (2/334).So the correct view is that the mention of Ubayy bin Kaab in this hadith is not sahih.