"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)
كَانَ عُمَرُ نَذَرَ فِي الْجَاهِلِيَّةِ اعْتِكَافِ لَيْلَةٍ فِي الْمَسْجِدِ الْحَرَامِ «فَسَأَلَ رَسُولَ اللهِ ﷺ عَنْ ذَلِكَ فَأَمَرَهُ أَنْ يَعْتَكِفَ»