Pb with tw and external resources file in production

7 views
Skip to first unread message

Philippe Lafaye

unread,
Feb 26, 2008, 10:34:47 AM2/26/08
to toscawidge...@googlegroups.com
Hi everybody !

I have a strange problem with toscawidget (used into pylons project) and the
access of external resources (css, js).

You can see the illustration of this problem on this page:
http://i18nforms.emencia.net/bug/

When you try to load the page, urls for external resources are sometime ok and
sometimes "resources not found". You could see it more specifically if you try
to load directly this resources (for example:
http://i18nforms.emencia.net/toscawidgets/resources/toscawidgets.widgets.tabber/static/tabber.js?v=1197045633)
Try to load (and re-load) it many times (5 or 6 times should be sufficient)
and you'll see that sometime the file is accessible and sometime not.

This example are run on a fedora box with apache2/mod_wsgi. Strangely, if I run
the application directly with paste server on the same box, all works fine.
More strangely, on an other box (on debian) all works fine with
apache2/mod_wsgi. Environments are almost the same. It's an apache2 on
the 2 boxes (2.0.54 on fedora 2.2.3 on debian) with mod_wsgi2.0c4. I use all
the latest egg version of toscawidget/pylons from the cheeseshop (except lxml
I use 2.0alpha4 on debian and 1.3.6 on fedora).

I try to find on the toscawidget source code where this problem could be
appear with no success ...

In an second time, I have an other question about the packaging of toscawidget
packages. This url are a simple illustration of 2 widgets I developed for
manipulate i18n data on a form. I export them easily into an specifically
python/toscawidget package. But when I generate the egg file the template file
into the template folder is ignored. I imagine that I need to add a specific
instruction into the setup.py file but I don't find documentation about that.
This template is a mako template and his extension is .mak.

Thanks for the help !

--
Philippe Lafaye

Philippe Lafaye

unread,
Mar 7, 2008, 7:15:25 AM3/7/08
to toscawidge...@googlegroups.com
2008/2/26, Philippe Lafaye <rage...@gmail.com>:

> I have a strange problem with toscawidget (used into pylons project) and the
> access of external resources (css, js).
>
> You can see the illustration of this problem on this page:
> http://i18nforms.emencia.net/bug/
>
> When you try to load the page, urls for external resources are sometime ok and
> sometimes "resources not found". You could see it more specifically if you try
> to load directly this resources (for example:
> http://i18nforms.emencia.net/toscawidgets/resources/toscawidgets.widgets.tabber/static/tabber.js?v=1197045633)
> Try to load (and re-load) it many times (5 or 6 times should be sufficient)
> and you'll see that sometime the file is accessible and sometime not.
>
> This example are run on a fedora box with apache2/mod_wsgi. Strangely, if I run
> the application directly with paste server on the same box, all works fine.
> More strangely, on an other box (on debian) all works fine with
> apache2/mod_wsgi. Environments are almost the same. It's an apache2 on
> the 2 boxes (2.0.54 on fedora 2.2.3 on debian) with mod_wsgi2.0c4. I use all
> the latest egg version of toscawidget/pylons from the cheeseshop (except lxml
> I use 2.0alpha4 on debian and 1.3.6 on fedora).
>
> I try to find on the toscawidget source code where this problem could be
> appear with no success ...

So nobody have an answer or tips about this problem ?

--
Philippe Lafaye

Graham Dumpleton

unread,
Mar 8, 2008, 6:08:25 AM3/8/08
to ToscaWidgets-discuss


On Mar 7, 11:15 pm, "Philippe Lafaye" <rage2...@gmail.com> wrote:
> 2008/2/26, Philippe Lafaye <rage2...@gmail.com>:
>
>
>
> >  I have a strange problem with toscawidget (used into pylons project) and the
> >  access of external resources (css, js).
>
> >  You can see the illustration of this problem on this page:
> >  http://i18nforms.emencia.net/bug/
>
> >  When you try to load the page, urls for external resources are sometime ok and
> >  sometimes "resources not found". You could see it more specifically if you try
> >  to load directly this resources (for example:
> >  http://i18nforms.emencia.net/toscawidgets/resources/toscawidgets.widg...)
> >  Try to load (and re-load) it many times (5 or 6 times should be sufficient)
> >  and you'll see that sometime the file is accessible and sometime not.
>
> >  This example are run on a fedora box with apache2/mod_wsgi. Strangely, if I run
> >  the application directly with paste server on the same box, all works fine.
> >  More strangely, on an other box (on debian) all works fine with
> >  apache2/mod_wsgi. Environments are almost the same. It's an apache2 on
> >  the 2 boxes (2.0.54 on fedora 2.2.3 on debian) with mod_wsgi2.0c4. I use all
> >  the latest egg version of toscawidget/pylons from the cheeseshop (except lxml
> >  I use 2.0alpha4 on debian and 1.3.6 on fedora).
>
> >  I try to find on the toscawidget source code where this problem could be
> >  appear with no success ...
>
> So nobody have an answer or tips about this problem ?

Are you using mod_wsgi embedded mode or daemon mode? If using daemon
mode, do you run the processes as the same user as you run the Paste
server? If using embedded mode the environment the process will
inherit is going to be somewhat different to what your code when run
as you will be. Make sure you have at least read:

http://code.google.com/p/modwsgi/wiki/ApplicationIssues

as it covers various issues related to process environments when
running under Apache.

To narrow down what the problem is, suggest you make sure you are
using mod_wsgi daemon mode and run a single multithreaded process
only. Make sure that process run as you.

If you can't work out how to do this, suggest you go over to Google
group for mod_wsgi and raise your problem there instead.

May be a good idea to come over to mod_wsgi group any way and repost
your problem. Important to properly explain your Apache configuration
for mod_wsgi however as well as properly explain the problem. Don't
just expect people to work it out from a web page somewhere you post,
need to see evidence of problems from Apache access/error logs so it
can be debugged.

Graham

Alberto Valverde

unread,
Apr 1, 2008, 3:54:40 AM4/1/08
to toscawidge...@googlegroups.com
Philippe Lafaye wrote:
> Hi everybody !
>
> I have a strange problem with toscawidget (used into pylons project) and the
> access of external resources (css, js).
>
> You can see the illustration of this problem on this page:
> http://i18nforms.emencia.net/bug/
>
> When you try to load the page, urls for external resources are sometime ok and
> sometimes "resources not found". You could see it more specifically if you try
> to load directly this resources (for example:
> http://i18nforms.emencia.net/toscawidgets/resources/toscawidgets.widgets.tabber/static/tabber.js?v=1197045633)
> Try to load (and re-load) it many times (5 or 6 times should be sufficient)
> and you'll see that sometime the file is accessible and sometime not.
>
> This example are run on a fedora box with apache2/mod_wsgi. Strangely, if I run
> the application directly with paste server on the same box, all works fine.
> More strangely, on an other box (on debian) all works fine with
> apache2/mod_wsgi. Environments are almost the same. It's an apache2 on
> the 2 boxes (2.0.54 on fedora 2.2.3 on debian) with mod_wsgi2.0c4. I use all
> the latest egg version of toscawidget/pylons from the cheeseshop (except lxml
> I use 2.0alpha4 on debian and 1.3.6 on fedora).
>
> I try to find on the toscawidget source code where this problem could be
> appear with no success ...

This looks like a problem related to the URL->Path mappings TW generates
for static resources being done differently by different processes and
is surely a bug, I've filed a ticket
http://trac.turbogears.org/ticket/1777 for it.

Alberto

Reply all
Reply to author
Forward
0 new messages