According to a legend mentioned in Kashi Khand when during Padma Kalp there was a severe drought all across the world, then all creatures were severely afflicted by it. So, when Lord Brahma came to know about this he became worried as it was difficult for him to see his creation being on the verge of destruction. After a long search for a solution, Lord Brahma saw King Ripunjay who was dedicatedly engrossed in the penance. Being pleased by him, Lord Brahma renamed him to King Divodas and requested him to take the world under his throne and save the humanity. King agreed with this but he had one condition that he wanted to rule peacefully without intervention, so that he could reform the dharma without any disturbance. Therefore, he wished that all Gods and Godly entities should remain in the heaven only and should not return to land. Lord Brahma also kept a condition that King should be an excellent administrator and that every person staying in his kingdom or visiting his kingdom should be treated well with proper religious pursuits. King agreed. On the command of Brahma, all Gods left to the heaven. But, it was not easy for Lord Brahma to ask Lord Shiva to leave Kashi and go to heaven as Kashi is believed to be one of the favourite places of Lord Shiva. So, when Lord Shiva appeared in front of Madaranchal being pleased with his prayers and Mandaranchal asked Lord Shiva to reside upon him along with Goddess Parvati and his family as a boon, finding right time to aware Lord Shiva about King Divodas’ condition, Lord Brahma told how King Divodas can save humanity and about King’s condition that all gods should leave to heaven. As Lord Shiva could not deny the request of Lord Brahma, so he also left to Mandaranchal from Kashi. As per his condition, King Divodas took the throne and worked vigorously to bring order in the decaying world. With the favours obtained from Lord Brahma, king established a rule so flawless that was never seen before. Under his regime, his subjects prospered and justice flourished.
As time passed, Lord Shiva desired to again come back to his own city Kashi. But due to Brahma’s boon to Divodasa, he was unable to set feet in Kashi. Soon Lord Shiva came to know that other gods too are unable to stay in Kashi. Not happy with this kind of attitude of the Divodas, Lord Shiva decided first to cast some dents into the flawlessness of Divodas’ rule in order to reduce his powers and then to end his regime. For this purpose Lord Shiva sent Yoginis and various gods to Kashi. But when Suryadev and Yoginis were failed to find out the loop holes in the kingdom of Raja Divodas, sent by Lord Shiva. Then as per the orders of Lord Shiva, Lord Ganesha left Mandarachal and came to Kashi. In Varanasi, Lord Ganesha spread his Maya Jaal, and controlled the people. He also controlled King and Queen. Later Lord Ganesha assumed himself as successful in his mission and established himself in Varanasi in fifty six forms (Chappan Vinayak). In Kashi, a visit to all these Vinayakas is considered very fruitful and sacred. From fifty six forms (Chappan Vinayak) of Lord Ganesha, eight forms have been included in Ashta Vinayak Yatra. According to the beliefs, devotees can get rid of all their hurdles if they go on Ashta Vinayak Yatra and they can achieve prosperity and knowledge. The following forms of Vinayak are included in this yatra:-