We develop a microscopic theory of ac Josephson effect in superconducting junctions described by an arbitrary scattering matrix that may include magnetic effects. In the limit of constant in time bias voltage V applied to the junction we derive a formally exact current-phase relation (CPR) that is manifestly 2 pi periodic in the Josephson phase phi in full accordance with general principles. Our result unambiguously argues against the idea of the so-called "fractional ac Josephson effect" admitting 4 pi periodic in phi CPR. We also demonstrate that at any nonzero V quantum dynamics of Andreev bound states becomes non-Hermitian, which signals their instability, thus making any "quasi-equilibrium" description of ac Josephson effect unreliable. We specifically address the limit of highly transparent junctions with magnetic scattering where-along with super- and excess current terms-at small V we also recover a nontrivial 2 pi-periodic dissipative current with the amplitude proportional to|V |1/3.