During the Tang Dynasty, there lived an incompetent official. Despite being a man with good intentions, he could never fully carry out his duties and as a result, began seeking out other activities to get away from his problems. He decided that traveling would give him the desired effect and he slowly began to ignore his duties.
One day, during his travels, the official arrived at a temple. Exhausted, he decided to stay overnight. As he entered a deep sleep, the official began to dream and in his dream, he met a monk.
This monk pointed out an incense burner to the official and said, “You’ve lived three lives (back then most Chinese believed in reincarnation) and the left over incense in there is from the first. In that life, you were an official in charge of protecting borders. The second life, you were a secretary for the government and the third is your current life. You made a wish with that incense. Has anything changed?”
The official suddenly began to remember the events of his past lives and began to enter a stage of deep depression. He realized that in each of his lives, he had nothing to show for and wished to leave his position as an imperial official. His depression made him lose faith in his abilities.
Later on, this idiom became part of a poem called 干戈 (gān gé) by 王中 (wáng zhōng.) Wang Zhong was born towards the end of the Song Dynasty and this poem portrays the damage inflicted on people because of war (the Mongolians started invading China). The first line of the poem (干戈未定欲何之,一事無成兩鬢絲; gān gé wèi dìng, yī shì wú chéng liǎng bīn sī) translated loosely means: "Where do I hide while the fighting continues? I’ve been hiding all my life and now I’m old and have nothing to show for."