When a marriage is supposed to be void, or the validity thereof is doubted, for any of the causes mentioned in the 2 preceding sections; either party, excepting in the cases where a contrary provision is hereinafter made, may file a petition or bill in the circuit court of the county where the parties, or 1 of them, reside, or in the court of chancery, for annulling the same, and such petition or bill shall be filed, and proceedings shall be had thereon, as in the case of a petition or bill filed in said court for a divorce; and upon due proof of the nullity of the marriage, it shall be declared void by a decree or sentence of nullity.