My Happy Ending is a song written and produced by Avril Lavigne and Butch Walker for Lavigne 's second album , Under My Skin ( 2004 ) . `` My Happy Ending '' is a song written and produced by Avril Lavigne and Butch Walker , and engineered by Russ T. Cobb for Lavigne 's second album , Under My Skin ( 2004 ) .