Sunan Abi Dawud, Hadith 2619

‘Ali (Allaah be pleased with him) said “The Messenger of Allah sent an army and appointed a man as a commander for them and he commanded them to listen to him and obey. He kindled fire and ordered them to jump into it. A group refused to enter into it and said “We escaped from the fire; a group intended to enter into it. When the Prophet was informed about it, he said “Had they entered into it, they would have remained into it. There is no obedience in matters involving disobedience to Allaah. Obedience is in matters which are good and universally recognized.

حَدَّثَنَا عَمْرُو بْنُ مَرْزُوقٍ، أَخْبَرَنَا شُعْبَةُ، عَنْ زُبَيْدٍ، عَنْ سَعْدِ بْنِ عُبَيْدَةَ، عَنْ أَبِي عَبْدِ الرَّحْمَنِ السُّلَمِيِّ، عَنْ عَلِيٍّ، - رضى الله عنه - أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم بَعَثَ جَيْشًا وَأَمَّرَ عَلَيْهِمْ رَجُلاً وَأَمَرَهُمْ أَنْ يَسْمَعُوا لَهُ وَيُطِيعُوا فَأَجَّجَ نَارًا وَأَمَرَهُمْ أَنْ يَقْتَحِمُوا فِيهَا فَأَبَى قَوْمٌ أَنْ يَدْخُلُوهَا وَقَالُوا إِنَّمَا فَرَرْنَا مِنَ النَّارِ وَأَرَادَ قَوْمٌ أَنْ يَدْخُلُوهَا فَبَلَغَ ذَلِكَ النَّبِيَّ صلى الله عليه وسلم فَقَالَ ‏"‏ لَوْ دَخَلُوهَا - أَوْ دَخَلُوا فِيهَا - لَمْ يَزَالُوا فِيهَا ‏"‏ ‏.‏ وَقَالَ ‏"‏ لاَ طَاعَةَ فِي مَعْصِيَةِ اللَّهِ إِنَّمَا الطَّاعَةُ فِي الْمَعْرُوفِ ‏"‏ ‏.‏

sunnah.com

also referenced under: Hadith 2625 (DarusSalam)