I have a 2005 Nissan Sentra that was happening on. Turns out there is a check valve inside the filler tube that is part of the emission system. This valve got stuck closed, you couldn't get any gas into the tank. The check engine light was on when this would occur. Had to have the valve replaced.