Forums

Unable to access the admin interface in web2py

Hi, I am very new to web2py (I just installed it on pythonanywhere!) and am trying to access the admin interface. But when I click it, I get the following error: Admin is disabled because insecure channel

Do I have to edit any other file to make the channel secure? Searched the forums, and didn't see anyone else ran into this issue.

I was having the same problem. I works if you access with https.

Hmmm... this is something we should make more easily discoverable!

Accessing with https works

After trying to use https I'm getting the following error: admin disabled because unable to access password file

Anyone encountered this ?

There might be some clues in the file /var/log/www/apache2/error.log. You can access it via this direct link. Alternatively, web2py's own logs might have something; I think it puts them in web2py/logs.

Also, this thread on Google Groups looks like it might be relevant.

Used https:// - it's helped me.

The error: admin disabled because unable to access password file happened to me when I created an instance of web2py that was not in the $HOME/web2py directory. It seems the system currently assumes that the web2py directory is always named 'web2py'. If, as in my case, you name it 'web2py2' then the system will be unable to locate the password file.

Thanks for letting us know!

Is there any workaround/solution for new web2py apps that aren't placed a in directory called 'web2py'?

UPDATE: the problem with installs into non-default directories is now fixed, the code below is no longer needed.

Hi there, this is certainly a bug on our side. We will put in place a fix. In the mean time you can use this script to correct any existing installations of Web2py.

WEB2PY_PATH = '/home/marladarla7/web2py2'                                                                                                               
ADMIN_PASSWORD = 'my_admin_pass'

import hashlib
import os
import sys
sys.path.append(WEB2PY_PATH)
os.chdir(WEB2PY_PATH)

# Does some necessary web2py setup
from gluon.widget import console                                                                                                                        
console()

# Appends a hash of your password to the correct file
with open(WEB2PY_PATH + '/parameters_443.py', 'a') as f:
  f.write('password="%s"' % (hashlib.md5(ADMIN_PASSWORD).hexdigest(),))

We have created a fix as well, just has to go through testing. Should be released in next version deploy.

That fix is now live, the above code is no longer necessary.

I just got the same error.

Https did work. But reading this thread I thought this was fixed.

The problem that was fixed was the one where you got this error regardless of whether you used HTTPS or not -- it was triggered when people put their web2py installations in a directory that wasn't our default. I'll update the post above to make that clearer.

The requirement to use HTTPS is part of web2py, so it's not something we can change.

Thanks for the clarification! Pardon my ignorance.

@sawhat, that's not great advice since we don't use the built-in web2py server and web2py running in a console will not be accessible from the internet.

I wonder if a welcome to PA document would be helpful to newer members as they arrive. Sort of a baseline document that tells of the current and planned state of PA. Not designed to go into detail of everything, but designed with many links to where the deeper answers can be found. Those of us who have been around for quite a while and know most of this backward and forward can easily forget how daunting something the scale of PA can be to the newest in our ranks.

I know getting the right balance for a document of this nature could be difficult, but I think it would be helpful to the people it is directed at. The rest of us would benefit from having a place to send people for many of the repeat questions that keep eluding new visitors.

~a2j

Might help.

That's a great idea. We're trying to collect as much stuff as possible on the help pages, but perhaps we need to work out how to summarise that for new users. I guess the big problem is that different people have different questions. Still, any suggestions would be much appreciated!

was simple accessing with https for me thanks.

web2py admin interface is locked due to incorrect input. Could not solve the problem.

Incorrect input? I've never seen that one. The only thing I can think of is that you haven't set an admin password.

i am running web2py on my account santvasu.pythonanywhere.com

When i login in to the admin interface, it takes a while enter image description here

And cones out with an error (403 FORBIDDEN) like this. enter image description here

I also got the bash shell running and did a reset of admin passwd using python -c "from gluon.main import save_password; save_password(raw_input('admin password: '),443)" Still no luck...

can you pl help me with this.

thanks and regards santhosh

Did you reload the website (using the button on the "Web" page) after changing the password? I think that is necessary to make it pick up the new one.

@giles

By reload, i guess you meant the following. enter image description here

I tied reload-ing. i am still getting the 403 FORBIDDEN error.

Requesting to kindly look into this.

thanks and regards santhosh

When I go to https://santvasu.pythonanywhere.com/admin I see a login page asking for an admin password. Are you sure you had run the password reset correctly and that there were no errors when you ran it?

@conrad Thanks for the inputs. :-) I retried the steps.

1) python -c "from gluon.main import save_password; save_password(raw_input('admin password: '),443)"

2) Reload-ed the webapp

Now its working. I guess i must have wrong password.

thanks once again. best regards santhosh

Excellent, glad you got it working eventually :-)

Thank you for your suggestion and support. :-)

Also thanks for adding the step that "Reload the webapp" to the page https://help.pythonanywhere.com/pages/Web2pyAdminPassword/

thanks once again. :-)

best regards

santhosh