Raise error when username or uid is not parsed and catch exception. Also retry getting the uid 3 times.