An 'old chestnut' is another way of saying a joke is old or stale. The origin appears to be eating roasted chestnuts at the fireside while listening to old stories.
The Broken Sword, was a melodrama by William Dimond (1816) in
which one of the characters, Captain Xavier, is forever telling
the same jokes, over and over, with slight variations. As he
repeats a certain joke involving a cork tree, he is corrected.
The man says, "A chestnut. I have heard you tell the joke
twenty-seven times, and I am sure it was a chestnut."