It is narrated from Sayyiduna Jabir bin Abdullah (may Allah be pleased with them both) that we were with the Messenger of Allah (peace and blessings be upon him) on a journey or an expedition when clouds covered the sky. We tried to determine the direction of the qiblah, but we differed about it, so each of us drew a line in front of himself so that we would know our places. When morning came and we looked, we found that we had prayed facing a direction other than the qiblah. We mentioned this to the Messenger of Allah (peace and blessings be upon him), and he (peace and blessings be upon him) did not order us to repeat the prayer, and he said: "Your prayer has sufficed." Imam al-Bayhaqi narrated it in his Sunan through the chain of Dawud bin Amr from Muhammad bin Yazid al-Wasiti, through Muhammad bin Salim, from Ata. Then Imam al-Bayhaqi narrated it through the route of al-Harith bin Nabhan from Muhammad bin Ubaydullah, he from Ata bin Abi Rabah, and he from Sayyiduna Jabir bin Abdullah (may Allah be pleased with them both), that he said: "We prayed on a cloudy night and the direction of the qiblah was hidden from us, so we put down a marker (at the place of prayer). When we finished, we saw that we had prayed towards other than the qiblah. So we mentioned it to the Messenger of Allah (peace and blessings be upon him), and he (peace and blessings be upon him) said: 'You did well', and he did not order us to pray again." Imam al-Bayhaqi said that this narration is likewise reported from Muhammad bin Salim from Ata and from Abd al-Malik al-Arzami from Ata. Imam al-Bayhaqi also stated clearly that we know of no sahih and strong chain for this hadith, because Asim bin Ubaydullah bin Umar al-Umari, Muhammad bin Ubaydullah al-Arzami and Muhammad bin Salim al-Kufi are all weak narrators, while the route reaching Abd al-Malik al-Arzami is also not clear, because its chain contains wijadah (transmission from a found written text) and other technical defects.
Hadith Referenceإتحاف الخيرة المهرة بزوائد المسانيد العشرة / كتاب القبلة وفيه ستر العورة وما يصلى فيه / 1126
Hadith Gradingمحدثین:قال البيهقي: ولا نعلم لهذا الحديث إسنادا صحيحا قويا