HSA Showing Excess Contribution

I have an HSA and my wife has an HSA both are single accounts.  I contributed $2840 and my wife contributed $1060.  The distributions were mine $1586 and  wife $1275. with deductions showing mine  $810 and wife $1060.  Once all is entered it states I have an excess contribution of $2030 and must be withdrew to prevent being taxed 6%.  My HSA account only has $2936.50 in it.  I'm confused as to why I am showing an excess contribution?  If I withdraw the $2030 that only leaves me less than 1K for medical expenses.  I was under the impression that having an HSA was like a retirement account that could be helpful as you get older to cover medical expenses.