(“If the court determines at any - time that it lacks subject-matter jurisdiction, the court must dismiss the action.”). As a result, courts have generally found it to be error when a Court dismisses a claim sua sponte based on a defense that has already been waived. See, e.g., Haskell v. Wash. Twp., 864 F.2d 1266, 1273 (6th Cir.1988) (“Since it is a waivable defense, it ordinarily is error for a district court to raise the issue sua sponte.”)-, Simuell v. Shapp, 536 F.2d 15,19 (3d Cir.1976) (“In the absence of any such statutory authority, it is inappropriate for the trial court to dispose of the case sua sponte on an objection to the complaint which would be waived if not raised by the defendant(s) in a timely manner.”); Wagner v. Fawcett Publ’ns, 307 F.2d 409, 412 (7th Cir.1962) (<HOLDING>). III. Conclusion Accordingly, we hold that the
holding that the district court cannot remand sua sponte for defects in removal procedure recognizing that a district court may sua sponte dismiss a complaint for failure to serve after notice to the plaintiff holding that a district court has the power to raise the aedpa limitations period sua sponte because the defense implicates values beyond the interests of the parties holding that a district court has the discretion to raise a  2254 timeliness consideration sua sponte holding that the district court had no right to apply the statute of limitations sua sponte because it had been waived