...only to do something - definition and synonyms

phrase
  1. used for saying that what happens next is disappointing or unpleasant

    I tore open the box, only to discover that some of the parts were missing.

See also main entry: only