apache_2fa icon indicating copy to clipboard operation
apache_2fa copied to clipboard

500 Internal Server Error - No Module Named 'onetimepass'

Open kevin-webster opened this issue 6 years ago • 3 comments

Hi,

I've followed the instructions in the readme file to the letter, for a test domain.

When I attempt to authenticate, the redirect URL changes to the following:

http://test/auth/auth?/%3f

When I look at the Apache error logs, I can see the following:

End of script output before headers: auth.

I noticed someone else reported this previously so I attempted to run the ./auth script directly yet this comes up with the following:

No module named 'onetimepass'

This module was previously installed using sudo pip install onetimepass, yet when I attempt to install it again, I see the following message:

sudo pip install onetimepass
The directory '/home/<user>/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/<user>/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: onetimepass in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied: six in /usr/lib/python2.7/dist-packages (from onetimepass)

Any clues would be greatly appreciated.

kevin-webster avatar Jul 03 '19 14:07 kevin-webster

Ok, so what I should have done is use pip3 and not pip.

Having moved past that issue, I now have another one whereby after entering the credentials (new ones generated using the htdigest command), I get the following message on the browser:

Contact your administrator to obtain your 2FA secret.

And nothing else happens...

kevin-webster avatar Jul 03 '19 14:07 kevin-webster

Doh! This issue can now be ignored - sorry. There was an error in the tokens.json file.

I've since managed to generate a base32 secret token, store it in the tokens.json file for a new user, download the Google Authenticator app and successfully log in!

Apologies for my foolishness!

kevin-webster avatar Jul 03 '19 15:07 kevin-webster

I can confirm that things start working when using pip3 in stead of pip. This makes sense as the shebang of the auth file points to python3. Can the documentation be changed to reflect this? It will save a lot of people from running into the same issue.

bcnx avatar Dec 25 '20 20:12 bcnx