Costs shall not be allowed to plaintiff in an action upon a domestic judgment between the same parties, unless such action was brought with previous leave of the court for cause shown; but this shall not apply to an action upon the judgment of a justice brought in another county or in the same county where the summons was not served upon all the defendants, or in case of the death of a party, or the death, resignation, incapacity to act, or removal from the county of the justice, or the loss of the docket.