Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) narrates from Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him): "When Jibril (peace be upon him) struck the spot of Zamzam with his heel, the mother of Isma'il (Sayyidah Hajar, may Allah be pleased with her) began gathering sand and earth, and the Prophet (peace and blessings be upon him) said: 'May Allah have mercy on Hajar, the mother of Isma'il; had she left it (the water) as it was, it would have been a flowing spring.'"
Imam al-Bukhari (may Allah have mercy on him) narrated this hadith through Ahmad bin Sa'id (may Allah have mercy on him), Wahb bin Jarir (may Allah have mercy on him), his father Jarir (may Allah have mercy on him), Ayyub (may Allah have mercy on him), Abdullah bin Sa'id (may Allah have mercy on him), his father (Sa'id bin Jubayr, may Allah have mercy on him) and Ibn Abbas (may Allah be pleased with them both), and he did not mention Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him).
He said: Ali bin al-Madini (may Allah have mercy on him) and Hajjaj bin al-Sha'ir (may Allah have mercy on him) both narrated it through Wahb (may Allah have mercy on him), his father (may Allah have mercy on him), Ayyub (may Allah have mercy on him), Sa'id bin Jubayr (may Allah have mercy on him), Ibn Abbas (may Allah be pleased with them both) and Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him), from the Prophet (peace and blessings be upon him) in this way; the two of them dropped Abdullah bin Sa'id (may Allah have mercy on him) from the chain and added Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him) to it.
Wahb (may Allah have mercy on him) says: I said to my father: "Hammad (may Allah have mercy on him) does not mention Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him), nor does he narrate it as marfu' (attributed to the Prophet)." He said: "This is how I memorised it; this is how Ayyub (may Allah have mercy on him) narrated it to me."
And there is further discussion of this beyond what is given here.
Imam al-Nasa'i (may Allah have mercy on him) narrated it from Ahmad bin Sa'id (may Allah have mercy on him) with his chain, just as Imam al-Bukhari (may Allah have mercy on him) narrated it, and I think he mentioned Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him).
Also (Imam al-Nasa'i (may Allah have mercy on him)) narrated it from Abu Dawud Sulayman bin Sayf (may Allah have mercy on him), from Ali bin al-Madini (may Allah have mercy on him), from Wahb (may Allah have mercy on him) with his chain, from Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him).
Imam Abu Hatim bin Hibban al-Busti (may Allah have mercy on him) narrated it from Abdullah bin Salih al-Bukhari (may Allah have mercy on him), from Hajjaj bin al-Sha'ir (may Allah have mercy on him), with his chain through Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him).
Related hadith on this topic