I tried to run the auto upgrade to the latest version.  Worked on 
Windows/Rocket several times.  Would not work on my linode vps because of 
various permissions problems.  Not a big deal.

Uploaded and unzipped the zip file in /var/web2py.   Set permissions so 
that www-data is the group for all files with rw access.

My constant result is uWSGI Error Python Application not found.  Prior to 
the update, this had never occurred. In the update, I did not modify my 
uWSGI config at all.

Here is the uWSGI log:


*** Starting uWSGI 1.2.3 (32bit) on [Tue Jan 15 11:41:15 2013] ***
compiled with version: 4.6.1 on 17 May 2012 23:33:21
detected number of CPU cores: 4
current working directory: /
writing pidfile to /var/run/uwsgi.pid
detected binary path: /usr/local/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
setgid() to 33
setuid() to 33
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
uwsgi socket 0 bound to UNIX address /tmp/web2py.sock fd 3
Python version: 2.7.2+ (default, Oct  4 2011, 20:29:37)  [GCC 4.6.1]
*** Python threads support is disabled. You can enable it with 
--enable-threads ***
Python main interpreter initialized at 0x8d69538
your server socket listen backlog is limited to 100 connections
*** Operational MODE: preforking ***
added /var/web2py/ to pythonpath.
Traceback (most recent call last):
  File "/var/web2py/wsgihandler.py", line 33, in <module>
    import gluon.main
ImportError: No module named gluon.main
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 23798)
spawned uWSGI worker 1 (pid: 23799, cores: 1)
spawned uWSGI worker 2 (pid: 23800, cores: 1)
spawned uWSGI worker 3 (pid: 23801, cores: 1)
spawned uWSGI worker 4 (pid: 23802, cores: 1)


You can see in the log that the import of gluon.main fails.  I tried a very 
old hint from Massimo to hard code the path to web2py in wsgihandler.py. 
 This is what lines of wsgihandler.py up to that point look like:

login as: root
root@96.126.123.83's password:
Welcome to Ubuntu 11.10 (GNU/Linux 3.0.18-linode43 i686)

 * Documentation:  https://help.ubuntu.com/
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipie...@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)


This is a WSGI handler for Apache
Requires apache+mod_wsgi.

In httpd.conf put something like:

    LoadModule wsgi_module modules/mod_wsgi.so
    WSGIScriptAlias / /path/to/wsgihandler.py

"""

# change these parameters as required
LOGGING = False
SOFTCRON = False

import sys
import os

path = '/var/web2py'
os.chdir(path)
sys.path = [path] + [p for p in sys.path if not p == path]

sys.stdout = sys.stderr

import gluon.main

if LOGGING:
    application = gluon.main.appfactory(wsgiapp=gluon.main.wsgibase,
                                        logfilename='httpserver.log',
                                        profilerfilename=None)
else:
    application = gluon.main.wsgibase

if SOFTCRON:
    from gluon.settings import global_settings
    global_settings.web2py_crontype = 'soft'



I also set the sys.path for python to include both web2py and web2py/gluon 
in my uwsgi init script:  PYTHONPATH=/var/web2py:/var/web2py/gluon.  After 
doing this the uwsgi log reports added /var/web2py:/varweb2py/gluon to 
pythonpath.  This resulted in a different import error--now it can't find 
wsgihandler ("ImportError: No module named wsgihandler").

This is very frustrating.  Everything worked perfectly with earlier version 
of web2py.  Config is just massively fragile with so many moving parts.

Sorry for the long post.  Thanks for your help.




-- 



Reply via email to