within an ace of something
within an ace of (doing) (something)
Extremely close to doing, achieving, or obtaining something, typically having failed by a very narrow margin. I came within an ace of winning that race, but I guess I'll have to settle for second place. They were within an ace of defeat when the quarterback threw a Hail Mary for a last-second touchdown. Crude oil prices came within an ace of $80 a barrel on Friday, threatening to plunge markets further into recession around the globe.