on db err: log the problem and terminate