Qays bin Abbad (may Allah have mercy on him) narrates: "I came to Madinah to meet the Companions of Muhammad (peace and blessings be upon him), and there was no one among them whom I would rather meet than Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him). Then, when the iqamah for the prayer was called, Sayyiduna Umar (may Allah be pleased with him) came out, and with him were the other Companions (may Allah be pleased with them) of the Prophet (peace and blessings be upon him). I stood in the first row, and a man came, looked at the faces of the people and recognised all of them except me. Then he moved me aside (from there) and stood in my place himself. (Because of this sudden incident) I lost all awareness of my prayer. When he had completed the prayer, he said: 'O young man! May Allah not grieve you. What I did to you was not out of ignorance; rather, the Messenger of Allah (peace and blessings be upon him) told us: "Be in the row that is (directly) behind me." And when I looked at the people's faces, I recognised all of them except you.' Then he narrated some things, and I never saw people stretch their necks towards anyone, turning to him, the way they were turned towards him. I heard him say: 'By the Lord of the Ka'bah! The people of the pacts (those in authority) have perished. Listen! I do not grieve for them; rather, I grieve for the Muslims whom they will cause to perish.' And he (the one speaking) was none other than Sayyiduna Ubayy (may Allah be pleased with him)."
Imam Ahmad (may Allah have mercy on him) narrated it in his Musnad from Abu Dawud (may Allah have mercy on him).
Imam al-Nasa'i (may Allah have mercy on him) narrated it from Muhammad bin Umar bin Ali bin Ata' bin Muqaddam (may Allah have mercy on him).
And Abu Hatim bin Hibban (may Allah have mercy on him) narrated it from Ibn Khuzaymah (may Allah have mercy on him).