how to troubleshoot admin errors?

59 views
Skip to first unread message

snfctech

unread,
Mar 2, 2010, 1:13:08 PM3/2/10
to web2py-users
Fedora10 web2py1.76.1 apache2/mod_wsgi

I thought all errors generated tickets? When I try to create an app
via the admin over HTTPS on a LAN all I get is an error flash "unable
to create application." It's not an apache permission issue because
it does the same thing if all my files and dirs have 777 permissions.
I don't get any apache errors in the error log and the only funny
thing I get in the access log is a 303 code from the POST request to
admin/default/site. Something must not be working out with
gluon.admin.app_create.

How should I troubleshoot this type of error, or does anybody have an
idea what's going on?

I'm going to start dissecting the app_create function - but my python
skills are still pretty weak and I was hoping there would just be a
good error log somewhere...

Thanks in advance for any tips.

mdipierro

unread,
Mar 2, 2010, 2:25:24 PM3/2/10
to web2py-users
These type of errors should be in /var/log/apach2/error.log

It is either a permission issue or web2py is not running from the
proper folder.

snfctech

unread,
Mar 2, 2010, 3:30:20 PM3/2/10
to web2py-users
I'm running Fedora and set the ErrorLog directive in my VirtualHost
file to /var/log/httpd/web2py-error_log - but there is no error. Just
the 303 code in the access_log.

My web2py directory is in /var/www/ and I have chown'd all files
apache:apache and chmod 777. I still get the error.

I _can_ create the application manually, so, I agree, it sounds like
apache isn't able to write but how can that be the case if all the
files are owned by apache and have rwx permissions? /var/www/web2py
is where web2py is installed and that's what's in my VirtualHost file.

Could it have something to do with HTTPS? Here is my VirtualHost
file:

<VirtualHost *:8080>

ServerName web2py.order-system.com
WSGIDaemonProcess web2py user=apache group=apache
WSGIProcessGroup web2py
WSGIScriptAlias / /var/www/web2py/wsgihandler.py

<Directory /var/www/web2py>
AllowOverride None
Order Allow,Deny
Deny from all
<Files wsgihandler.py>
Allow from all
</Files>
</Directory>

AliasMatch ^/([^/]+)/static/(.*) /var/www/web2py/applications/$1/
static/$2

<Directory /var/www/web2py/applications/*/static/>
Order Allow,Deny
Allow from all
</Directory>

<Location /admin>
Deny from all
</Location>

<LocationMatch ^/([^/]+)/appadmin>
Deny from all
</LocationMatch>

ErrorLog logs/web2py-error_log
CustomLog logs/web2py-access_log common

</VirtualHost>

LoadModule ssl_module modules/mod_ssl.so
NameVirtualHost *:443
Listen 443

<VirtualHost *:443>

ServerName web2py.order-system.com
SSLEngine on
SSLCertificateFile /etc/httpd/ssl/server.crt
SSLCertificateKeyFile /etc/httpd/ssl/server.key

WSGIProcessGroup web2py

WSGIScriptAlias / /var/www/web2py/wsgihandler.py

<Directory /var/www/web2py>
AllowOverride None
Order Allow,Deny
Allow from all
<Files wsgihandler.py>
Allow from all
</Files>
</Directory>

AliasMatch ^/([^/]+)/static/(.*) /var/www/web2py/applications/$1/
static/$2

<Directory /var/www/web2py/applications/*/static/>
Order Allow,Deny
Allow from all
</Directory>

ErrorLog logs/web2py-error_log
CustomLog logs/web2py-access_log common

</VirtualHost>

KMax

unread,
Mar 21, 2010, 10:01:33 PM3/21/10
to web2py-users
Hello
My web2py instalation (1.73 and newer) was affected by the same
issue.
Running on debian by wsgi apache2. Installed by unzipping
web2py_src.zip in to fresh folder and coping parameters_443.py.
Creation of new application give an error flash "unable to create
application."

Workaround was found accidently.
Starting web2py.by at console ( typing pass and quit ) solve issue
at apache.

Thank you.


On 3 мар, 00:13, snfctech <tschm...@sacfoodcoop.com> wrote:
> Fedora10 web2py1.76.1 apache2/mod_wsgi
>

> I thought all errors generated tickets?  When I try tocreatean app


> via the admin over HTTPS on a LAN all I get is an error flash "unable

> tocreateapplication."  It's not an apache permission issue because

ciastek

unread,
Mar 29, 2010, 10:27:19 AM3/29/10
to web2py-users
I've had the same problem ("unable to create application") on Ubuntu
JeOS 8.04.3 configured as shown at http://vimeo.com/10377947 [
web2py production deployment on vps.net (VIDEO) by mdipierro].
Ubuntu fully upgraded, web2py installed using setup-web2py-ubuntu.sh
script.
Running web2py from console once, resolved the problem.
IMHO the source of problem is absence of web2py/deposit and web2py/
site-packages directories.
mdipierro - web2py rox! :)
-- ciastek

On Mar 22, 4:01 am, KMax <mkostri...@gmail.com> wrote:
> Hello
>   My web2py instalation (1.73 and newer) was affected by the same
> issue.
>   Running on debian by wsgi apache2. Installed by unzipping
> web2py_src.zip in to fresh folder and coping parameters_443.py.
>   Creation of newapplicationgive an error flash "unabletocreateapplication."
>
>   Workaround was found accidently.
>   Starting web2py.by at console ( typing pass and quit ) solve issue
> at apache.
>
> Thank you.

> On 3 ÍÁÒ, 00:13, snfctech <tschm...@sacfoodcoop.com> wrote:
>
> > Fedora10 web2py1.76.1 apache2/mod_wsgi
>

> > I thought all errors generated tickets? šWhen I try tocreatean app


> > via the admin over HTTPS on a LAN all I get is an error flash "unable

> > tocreateapplication." šIt's not an apache permission issue because


> > it does the same thing if all my files and dirs have 777 permissions.
> > I don't get any apache errors in the error log and the only funny
> > thing I get in the access log is a 303 code from the POST request to

> > admin/default/site. šSomething must not be working out with

Yarko Tymciurak

unread,
Mar 29, 2010, 11:27:43 AM3/29/10
to web2py-users
On Mar 29, 9:27 am, ciastek <ciasteczk...@gmail.com> wrote:
> I've had the same problem ("unable to create application") on Ubuntu
> JeOS 8.04.3 configured as shown athttp://vimeo.com/10377947[

> web2py production deployment on vps.net (VIDEO) by mdipierro].
> Ubuntu fully upgraded, web2py installed using setup-web2py-ubuntu.sh
> script.
> Running web2py from console once, resolved the problem.

Just to be sure there is not mystery / this is clear:

When you start web2py from the console with no arguments, you are
asked to config various things (port, admin password);
You can also do this from the command line (in which case, no config-
gui comes up prior to starting the built-in server).

When you run from other than the built-in server, there is no setup:
the port and admin password must exist _somewhere_!

The way you create this information is to run from the console "once"
- because what this does is create a file:
parameters_{port_number}.py, which is then used at startup.

So (for example):

$ python web2py.py -a 'hello'

will create parameters_80.py (the default port is 80).

You can edit, or copy this file - if you want to use the same
password, but on port 432, just copy this file (for example) to:
parameters_432.py

In any case, the parameters file is used to supply "command-line"
parameters when not running from the command line.

Hope this takes the mystery out of it.

Regards,
Yarko

ciastek

unread,
Mar 30, 2010, 10:46:42 AM3/30/10
to web2py-users
Yarko, thanks for detailed description, but it's not a problem.

If there were no parameters_xxx.py file, I could not log in admin
interface. The problem is, that I can log in, but admin is unable to
create new application.

At the end of setup-web2py-ubuntu.sh file we can find:
cd /home/www-data/web2py
sudo -u www-data python -c "from gluon.main import save_password;
save_password(raw_input('admin passw
ord: '),443)"
This line asks for password and writes it in parameters_443.py file.

Running ./web2py creates: deposit/, site-package/, parameters_8000.py
and welcome.w2p
(BTW: As you can see default port is 8000)

Looks like as long as you don't run ./web2py, admin can't find
welcome.w2p to scaffold.

On Mar 29, 5:27 pm, Yarko Tymciurak <resultsinsoftw...@gmail.com>
wrote:

mdipierro

unread,
Mar 30, 2010, 11:38:41 AM3/30/10
to web2py-users
web2py.w2p is built when you first install web2py or when you upgrade.
This is trigggered by the presence of an empty file called NEWINSTALL,
If this file is present welcome.w2p is created and then file is
deleted.
Reply all
Reply to author
Forward
0 new messages