自讨苦吃
(idiomatic, informal) To provoke an unwanted action; to invite a problem or fail to prevent one.