Re: web2py 2.0.2 possible bug

121 views
Skip to first unread message

Andrew Replogle

unread,
Aug 30, 2012, 2:02:37 PM8/30/12
to web2py-d...@googlegroups.com
I got that too in the openshift template, but because I moved the gluon dir to another location and added it to the python path with sys.path.append(). I ended up just making a symlink into web2py/ to fix that particular issue. 

Are you maintaining the standard web2py structure?

On Thursday, August 30, 2012 12:46:19 PM UTC-5, Francisco Costa wrote:
using ngix + uwsgi I get this:

  File "/opt/web2py/gluon/languages.py", line 250, in read_possible_plurals
    for pname in os.listdir(pdir):
OSError: [Errno 2] No such file or directory: '/gluon/contrib/rules'
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 ***



I think absolutepath is not good

massimo....@gmail.com

unread,
Aug 30, 2012, 2:22:21 PM8/30/12
to web2py-d...@googlegroups.com
Can you suggest a patch?


From my Android phone on T-Mobile. The first nationwide 4G network.


-------- Original message -------- Subject: Re: [web2py-dev] Re: web2py 2.0.2 possible bug From: Francisco Costa To: web2py-d...@googlegroups.com CC:

On Thu, Aug 30, 2012 at 7:02 PM, Andrew Replogle <andrew....@gmail.com> wrote:
I got that too in the openshift template, but because I moved the gluon dir to another location and added it to the python path with sys.path.append(). I ended up just making a symlink into web2py/ to fix that particular issue. 

Are you maintaining the standard web2py structure?

yes
 

On Thursday, August 30, 2012 12:46:19 PM UTC-5, Francisco Costa wrote:
using ngix + uwsgi I get this:

  File "/opt/web2py/gluon/languages.py", line 250, in read_possible_plurals
    for pname in os.listdir(pdir):
OSError: [Errno 2] No such file or directory: '/gluon/contrib/rules'
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 ***



I think absolutepath is not good

--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
 
 

--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
 
  

Michele Comitini

unread,
Aug 30, 2012, 3:12:02 PM8/30/12
to web2py-d...@googlegroups.com

Why mount point is ""?

massimo....@gmail.com

unread,
Aug 30, 2012, 3:18:04 PM8/30/12
to web2py-d...@googlegroups.com
I may have a solution in a minute...



From my Android phone on T-Mobile. The first nationwide 4G network.


-------- Original message -------- Subject: Re: [web2py-dev] Re: web2py 2.0.2 possible bug From: Michele Comitini To: web2py-d...@googlegroups.com CC:

Massimo DiPierro

unread,
Aug 30, 2012, 3:55:02 PM8/30/12
to web2py-d...@googlegroups.com
Should be fixed in trunk. Releasing 2.0.3 later today. Can you check asap?

Massimo DiPierro

unread,
Sep 9, 2012, 10:15:50 AM9/9/12
to web2py-d...@googlegroups.com
These are all permission issues or you are running from the wrong folder.

On Sep 9, 2012, at 5:13 AM, Francisco Costa wrote:

these errors are still active

On Friday, August 31, 2012 10:40:04 AM UTC+1, Francisco Costa wrote:
also this line 109 at gluon/main.py

    version_info = open(pjoin(global_settings.gluon_parent, 'VERSION'), 'r')
IOError: [Errno 2] No such file or directory: '/VERSION'


On Friday, August 31, 2012 10:28:57 AM UTC+1, Francisco Costa wrote:
Hi Massimo,
the problem now is on "/applications"

added /opt/web2py/ to pythonpath.
Traceback (most recent call last):
  File "/opt/web2py/wsgihandler.py", line 33, in <module>
    import gluon.main
  File "/opt/web2py/gluon/main.py", line 60, in <module>
    create_missing_folders()
  File "/opt/web2py/gluon/admin.py", line 463, in create_missing_folders
    os.mkdir(path)
OSError: [Errno 13] Permission denied: '/applications'

Jonathan Lundell

unread,
Sep 9, 2012, 10:58:08 AM9/9/12
to web2py-d...@googlegroups.com
On 9 Sep 2012, at 7:15 AM, Massimo DiPierro <massimo....@gmail.com> wrote:
> These are all permission issues or you are running from the wrong folder.

The problem here is that gluon_parent at this point (in this install) should be /opt/web2py, and the joined path should be /opt/web2py/VERSION.

That suggests that it's being run from / and web2py is using the cwd as gluon_parent. The logic for this stuff is a little complicated, but the bottom line is that most of the handlers (look at wsgihandler.py, for example) chdir to the directory containing the handler, which is also the directory containing gluon and (usually) applications.

So unless someone is setting env.web2py_path to '/', it's hard to see how the traceback below makes sense. I can suggest some places to put prints or logging calls...

Ricardo Pedroso

unread,
Sep 9, 2012, 12:32:46 PM9/9/12
to web2py-d...@googlegroups.com
> On Sep 9, 2012, at 5:13 AM, Francisco Costa wrote:
>
> these errors are still active
>
> On Friday, August 31, 2012 10:40:04 AM UTC+1, Francisco Costa wrote:
>>
>> also this line 109 at gluon/main.py
>>
>> version_info = open(pjoin(global_settings.gluon_parent, 'VERSION'),
>> 'r')
>> IOError: [Errno 2] No such file or directory: '/VERSION'
>>
>>
>> On Friday, August 31, 2012 10:28:57 AM UTC+1, Francisco Costa wrote:
>>>
>>> Hi Massimo,
>>> the problem now is on "/applications"
>>>
>>> added /opt/web2py/ to pythonpath.
>>> Traceback (most recent call last):
>>> File "/opt/web2py/wsgihandler.py", line 33, in <module>
>>> import gluon.main
>>> File "/opt/web2py/gluon/main.py", line 60, in <module>
>>> create_missing_folders()
>>> File "/opt/web2py/gluon/admin.py", line 463, in create_missing_folders
>>> os.mkdir(path)
>>> OSError: [Errno 13] Permission denied: '/applications'
>>> 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 ***

Just gessing...
But it seems that uwsgi is doing a chdir('/') (is a common practice
when daemonizing) that is affecting web2py.

Ricardo

Jonathan Lundell

unread,
Sep 9, 2012, 12:53:02 PM9/9/12
to web2py-d...@googlegroups.com
The handlers chdir to os.path.dirname(os.path.abspath(__file__)). Perhaps we should use that trick in settings, instead (mutatis mutandis) to set gluon_parent directly, rather than allowing a default to cwd. Right now, settings does this:

global_settings.gluon_parent = \
os.environ.get('web2py_path', os.getcwd())

Why isn't __file__ authoritative?

global_settings.applications_parent = global_settings.gluon_parent


I'm a little wary of breaking something so fundamental, but it'd be nice to simplify matters somewhat.

Jonathan Lundell

unread,
Sep 9, 2012, 1:15:50 PM9/9/12
to web2py-d...@googlegroups.com
On 9 Sep 2012, at 9:54 AM, Francisco Costa <ma...@franciscocosta.com> wrote:
I need the Spoller from uwsgi,
so in my app I have a module that imports stuff for sending Email

from gluon.tools import Mail

when I comment this line the error goes away, so I suppose that importing gluon is somewhere trying to create the /applications

Could you please try logging the cwd (os.getcwd()) just before and after that import call? 
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
0 new messages