In the epic of Gilgamesh, he does find the secret to immortality, but he never gets to use it. He obtains the plant that grants eternal life, only to have a serpent steal it and eat it before he can bring it back to Enkidu.
It is a poignant twist that underscores one of the story's central themes: the ultimate futility of the human quest to escape death.