"Umar had made a vow to spend a night in 'Itikaf in Al-Masjid Al-Haram. He asked the Messenger of Allah about that, and he ordered him to perform the 'Itikaf." (Using translation from Nasāʾī 3821)
كَانَ عَلَى عُمَرَ بْنِ الْخَطَّابِ نَذْرٌ فِي اعْتِكَافِ لَيْلَةٍ فِي الْمَسْجِدِ الْحَرَامِ فَسَأَلَ رَسُولَ اللهِ ﷺ «فَأَمَرَهُ أَنْ يَعْتَكِفَ»