Abdullah bin Abbas reported,

When the Messenger of Allah ﷺ was on his deathbed, there were some men in the house, among them Umar bin Khattab. The Prophet ﷺ said, "Come, let me write for you a document after which you will never go astray."Umar said, "The Messenger of Allah ﷺ is overcome with pain, and you have the Quran. The Book of Allah is sufficient for us."The people of the house disagreed and began to argue. Some of them said, "Bring writing materials so the Messenger of Allah ﷺ may write for you a document after which you will never go astray," while others said what Umar had said. When their idle talk and disagreement before the Messenger of Allah ﷺ grew excessive, the Messenger of Allah ﷺ said, "Get up and leave."Ubaydullah said that Ibn Abbas used to say, "The real calamity, the greatest calamity, was what came between the Messenger of Allah ﷺ and his writing that document for them, namely their disagreement and clamor."

Azami 9309

Sahih

عن ابن عباس قال

لما حضر رسول الله ﷺ وفي البيت رجال فيهم عمر بن الخطاب، فقال النبي ﷺ: هلم أكتب لكم كتابا لا تضلون بعده فقال عمر: إن رسول الله ﷺ قد غلب عليه الوجع، وعندكم القرآن، حسبنا كتاب الله. فاختلف أهل البيت، فاختصموا، فمنهم من يقول: قربوا يكتب لكم رسول الله ﷺ كتابا لن تضلوا بعده، ومنهم من يقول ما قال عمر، فلما أكثروا اللغو والاختلاف عند رسول الله ﷺ، قال رسول الله ﷺ: قوموا. قال عبيد الله: فكان ابن عباس يقول: إن الرزية كل الرزية ما حال بين رسول الله ﷺ وبين أن يكتب لهم ذلك الكتاب من اختلافهم ولغطهم.

الأعظمي 9309صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Biography of the Prophet ﷺ
Chapter
Nearness of his death, his foretelling of it, his passing, and his burial
Section
Bequest of the Prophet ﷺ
Numbering
Jami al-Kamil 9309 (2nd edition)
Azami 9309