When the Prophet ﷺ passed by al-Hijr, he said, "Do not enter the dwellings of those who wronged themselves unless you are weeping, lest there befall you what befell them." Then he covered his head with his cloak while still on his saddle.
حدثنا يعمر بن بشر أخبرنا عبد الله أخبرنا معمر عن الزهري
أن النبي ﷺ لما مر بالحجر قال لا تدخلوا مساكن الذين ظلموا إلا أن تكونوا باكين أن يصيبكم ما أصابهم وتقنع بردائه وهو على الرحل
Its isnad is sahih. Yamar bin Bishr Khurasani, Abu Amr Marwazi, is trustworthy, one of the shaykhs of Ahmad. Ibn Jawzi mentioned him among his shaykhs, and the Hafiz gave his biography in Taajil, 457, saying, "Ibn Abu Hatim did not mention anyone narrating from him except Ibn Mubarak," and he mentioned among those who narrated from him Hajjaj bin Hamza. Ibn Hibban mentioned him among the trustworthy narrators and said, "Uthman bin Abu Shayba, Abu Kurayb, and Abdullah bin Abdul-Rahman, meaning Darimi, and others narrated from him." I found no biography of him beyond this.In manuscript Q it appears as "Mamar" with a mim at the beginning instead of the ya, which is a scribal error. Abdullah here is Ibn Mubarak.Ibn Kathir cited this hadith in Tarikh, 10:5, from this place in the Musnad, and said, "Bukhari narrated it from the hadith of Abdullah bin Mubarak and Abdul-Razzaq, both of them from Mamar, with his isnad, similarly." It is found in Bukhari, 6:207, from Muhammad bin Muqatil from Ibn Mubarak, and 8:45, from Abdullah bin Muhammad Jafi from Abdul-Razzaq. Something similar has already passed from the hadith of Abdullah bin Dinar from Ibn Umar, 4561 and 5225.