The retention in the endoplasmic reticulum (ER) lumen of soluble resident proteins. Sorting receptors retrieve proteins with ER localization signals, such as KDEL and HDEL sequences or some transmembrane domains, that have escaped to the cis-Golgi network and return them to the ER. Abnormally folded proteins and unassembled subunits are also selectively retained in the ER.