The electron-phonon interaction causes thermal and zero-point motion shifts of electron quasiparticle (QP) energies $epsilon_k(T)$. Other consequences of interactions, visible in angle-resolved photoemission spectroscopy (ARPES) experiments, are broadening of QP peaks and appearance of sidebands, contained in the electron spectral function $A(k,omega)=-{Im m}G_R(k,omega) /pi$, where $G_R$ is the retarded Greens function. Electronic structure codes (e.g. using density-functional theory) are now available that compute the shifts and start to address broadening and sidebands. Here we consider MgO and LiF, and determine their nonadiabatic Migdal self energy. The spectral function obtained from the Dyson equation makes errors in the weight and energy of the QP peak and the position and weight of the phonon-induced sidebands. Only one phonon satellite appears, with an unphysically large energy difference (larger than the highest phonon energy) with respect to the QP peak. By contrast, the spectral function from a cumulant treatment of the same self energy is physically better, giving a quite accurate QP energy and several satellites approximately spaced by the LO phonon energy. In particular, the positions of the QP peak and first satellite agree closely with those found for the Frohlich Hamiltonian by Mishchenko $textit{et al.}$ (2000) using diagrammatic Monte Carlo. We provide a detailed comparison between the first-principles MgO and LiF results and those of the Frohlich Hamiltonian. Such an analysis applies widely to materials with infra-red active phonons. We also compare the retarded and time-ordered cumulant treatments: they are equivalent for the Frohlich Hamiltonian, and only slightly differ in first-principles electron-phonon results for wide-band gap materials.