Yeah

This has been a problem at various stages with appengine and importing. 
 Depending on when/how you do imports
a DeadlineExceeded error can lead to problems importing stuff later.  For 
instance an import has a dependancy on a
failed import.

Once this happens (especially large stack apps - django, pyramid)  then you 
are hosed.

Are you using warmup requests.  By using them and doing all your imports in 
the warmup request and don't catch errors during import
means the instance won't get scheduled for service unless it starts up 
cleanly.

I have have code in place that also deals with import errors, by 
redirecting the user back to the page, and then consuming all memory so 
that the instance gets destroyed before it can service another request.  

Hope this helps

Rgds

Tim

On Monday, June 25, 2012 6:23:28 PM UTC+8, Ian Lewis wrote:
>
> Pamela, 
>
> Specifically Takashi is probably asking if you have any naked except 
> blocks: 
>
> try: 
>     # Do something 
> except: 
>     # Do a dance 
>
>
> People often do stuff like: 
>
> try: 
>     import json 
> except: 
>     import simplejson 
>
> If you have some of these, then you could be catching 
> DeadlineExceededErrors that occured 
> (they can occur basically anywhere on appengine). The instance should 
> get killed if one of 
> these errors occurs but it's best to handle it correctly in your code. 
>
> That kind of thing can cause problems. You need to do this instead. 
>
> try: 
>    ... 
> except Exception: 
>    ... 
>
> Some libraries are known to have these kinds of try except blocks. 
> Older versions of Jinja2 and werkzeug for example. 
>
> Ian 
>
> On Mon, Jun 25, 2012 at 3:37 PM, Takashi Matsuo <[email protected]> 
> wrote: 
> > Hi Pamela- 
> > 
> > I have not heard any similar issues for now, and there was no outage 
> > at that time period. 
> > I found that the instance which had continuously threw that exception 
> > initially encountered DeadlineExceededError. 
> > 
> > Could you tell me how you're handling exceptions? There might be a 
> > culprit that caused that instance got into the weird state. 
> > 
> > -- Takashi 
> > 
> > On Sat, Jun 23, 2012 at 10:59 AM, Pamela Fox <[email protected]> 
> wrote: 
> >> My app went down for 10 minutes, and when I look at the logs, I see a 
> lot 
> >> of: 
> >> 
> >> "Traceback (most recent call last): 
> >>   File 
> >> 
> "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py",
>  
>
> >> line 187, in Handle 
> >>     handler = _config_handle.add_wsgi_middleware(self._LoadHandler()) 
> >>   File 
> >> 
> "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py",
>  
>
> >> line 225, in _LoadHandler 
> >>     handler = __import__(path[0]) 
> >>   File 
> >> 
> "/base/data/home/apps/s~everyday-app/3.359804434352768230/application/__init__.py",
>  
>
> >> line 21, in <module> 
> >>     import urls 
> >>   File 
> >> 
> "/base/data/home/apps/s~everyday-app/3.359804434352768230/application/urls.py",
>  
>
> >> line 6, in <module> 
> >>     from application import app, views, util 
> >> ImportError: cannot import name views" 
> >> 
> >> But then it stopped happening and is fine now. Was this an app engine 
> issue 
> >> where it didn't have all the files available for some reason? Or is 
> this 
> >> something that I need to be changing on my end? 
> >> 
> >> My app runs on Python 2.7 with the Flask framework, and this is the 
> first 
> >> I've seen of this error. 
> >> 
> >> Thanks! 
> >> 
> >> -- 
> >> You received this message because you are subscribed to the Google 
> Groups 
> >> "Google App Engine" group. 
> >> To post to this group, send email to [email protected]. 
>
> >> To unsubscribe from this group, send email to 
> >> [email protected]. 
> >> For more options, visit this group at 
> >> http://groups.google.com/group/google-appengine?hl=en. 
> > 
> > 
> > 
> > -- 
> > Takashi Matsuo | Developer Advocate | [email protected] 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Google App Engine" group. 
> > To post to this group, send email to [email protected]. 
> > To unsubscribe from this group, send email to 
> [email protected]. 
> > For more options, visit this group at 
> http://groups.google.com/group/google-appengine?hl=en. 
> > 
>
>
>
> -- 
> Ian 
>
> http://www.ianlewis.org/ 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/Q1hKAleIUOgJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to