The first documented computer 'bug' was an actual moth.
On September 9, 1947, engineers working on the Harvard Mark II computer found a moth trapped in one of its electromechanical relays, causing a malfunction. They taped the moth into the machine’s logbook with the note “First actual case of bug being found,” a page that survives today in the Smithsonian’s collection.
The word “bug” for a technical fault actually predates this incident by decades — Thomas Edison used it in his notebooks in the 1870s — but the Mark II moth is the most famous and literal example of the term, and it’s often credited with popularizing “debugging” as the word for fixing a problem in a machine or program.