If you overcontributed in 2016, and didn't correct it before the deadline in 2017 (normally Oct. 15, but 16 that year because 15 was Sunday), you owe the (corrected!) 6% excise tax for tax year 2016, in addition to tax on earnings. This will require an amended return on 1040X, which is something of a nuisance because 1040X must be filed on paper not electronically. (Edit: I thought I remembered sometime seeing an allocation by year, but on checking apparently not, except sort of for closed years, which doesn't apply here.)
For tax year 2017, since you indicate you can't use it as a contribution, you have until Oct. 15 2018 to correct it, as described in JW8's answer. I'd say it's better to do it by April 15-this-year-17, which you have time to do, because then you will definitely get a 1099-R and I believe an updated 5498 from the custodian, and yes there are specific codes assigned for this case. Make sure you tell the custodian this is a corrective withdrawal so they will compute it (with the attributable earnings) and report it as such. If necessary talk to a human rather than using their website or a preprinted form intended for regular distributions.
You will owe tax at ordinary rates on the earnings, (corrected) AND the early distribution penalty. (My memory played me false on this one. The one time I was in this situation, long ago, I could 'use up' the excess contribution the second year and thus didn't need to take a distribution.)
Yes, pub 590A on the web or downloadable is the first port of call for this question, but it is rather brief for Roth, with less detail than the equivalent case for traditional. Pub 590B for distributions similarly covers traditional fully but barely mentions Roth. The instructions for 1099-R box 2a for Roth are more complete, specifying that only earnings go in 2a as taxable, and box 7 uses code J and 8 or P. The 'guide to codes' just after boxes 12-17 explains 8 and P as excess contributions/deferrals/earnings taxable in 2017 or 2016 respectively, and J as (any) early distribution, so yes the additional 10% for early distribution applies to the earnings. Sorry I got that wrong the first time.
And in case it wasn't obvious, to make things even worse, since you will now pay tax that is considered to have been due in April 2017, your payment is late and you nominally owe the penalty for late payment, and interest. You can probably get that penalty waived (offically called abated) assuming you have otherwise been compliant, but AFAIK they never actually waive interest -- although if the amount is small enough they may not bother collecting. (I have had them 'forget' interest of a dollar or two.) See https://www.irs.gov/businesses/small-businesses-self-employed/penalty-relief-due-to-first-time-penalty-abatement-or-other-administrative-waiver if necessary.