In one of his pilgrimages to Mecca there was such a shortage of water that people were dying of thirst. Bayazid came across a place where people were gathered around a well, so thirsty that they were fighting among one another. In the middle of all this commotion he saw a wretched dog that was clearly dying of thirst. The dog looked at Bayazid and somehow conveyed to him that Bayazid’s real mission should be getting water for the dog. He came up with a plan and began announcing, “Does anyone want to buy the merit of a hajj pilgrimage in exchange for some water?” Not receiving any response from people, he began to increase his part of the bargain, raising his hajj journeys to five, six, seven and finally to seventy in exchange for some water.
At last, someone said that he was willing, giving Bayazid the water in exchange for the merits of seventy hajj journeys. It is at this point in the story that Bayazid’s ego gets him into trouble. Right after the transaction took place, he began to feel proud of his action and pleased with himself for doing such a noble act of selflessness. Full of himself and proud of his action, Bayazid put the bowl of water in front of the dog, but the dog did not accept the water and turned away.
Now a man of Bayazid’s caliber looks for the divine message even from a dog, and Bayazid felt sorely ashamed of himself for his pride.
At this point, he heard a message from God, “How long are you going to say I have done this and I have done that? Don’t you see that even a dog does not accept your charitable act?” At once, Bayazid repented of his act of self-seeing.
– Adapted from Aflaki 1983, vol. II, p. 671. Taken from Zoya-thewayofasufi.blogspot.com