urlfetch is timing out

2 views
Skip to first unread message

Sean

unread,
May 8, 2008, 4:57:21 PM5/8/08
to Google App Engine
I am trying to retrieve data within Python via the urlfetch.fetch()
method. As it happens, I'm coding on a slow internet connection and I
am receiving and an error:

File "/usr/local/google_appengine/google/appengine/api/urlfetch.py",
line 98, in fetch
raise DownloadError()
DownloadError

From what I have researched, this is probably due to the response
taking too long. Is there any way to prevent this error from
occurring? It would be nice for the app to be robust enough to allow
users on slower connections to not have an issue.

Thanks!

Sean

Madhukar Gurram

unread,
Jun 4, 2008, 4:27:53 PM6/4/08
to Google App Engine
I'm facing the same issue. It seems the timeout is 5 seconds for the
fetch. Is there a way to set the limit to a higher value so that it
works ?

Mahmoud

unread,
Jun 4, 2008, 5:10:55 PM6/4/08
to Google App Engine
I'm sure you can edit:
/usr/local/google_appengine/google/appengine/api/urlfetch.py
locally to increase the timeout value, to compensate for your dev box
being on a slow connection. However, you might want to put your fetch
inside a try/except block to handle the exception gracefully on
production

Madhukar Gurram

unread,
Jun 4, 2008, 5:23:20 PM6/4/08
to Google App Engine
For me, it works fine locallly and I get the DownloadError() on
production. It always loads fine locally and fails on production. I
need a way to increase the timeout limit on production.

Daniel O'Brien

unread,
Jun 4, 2008, 8:02:25 PM6/4/08
to Google App Engine
Increasing the timeout in production isn't possible at present, and
you'll always be bound by our overall request limits.

Mahmoud's advice is good practice both with the local and production
servers: DownloadError can be thrown under a number of circumstances
outside of your control, and in the case of timeouts or connection
errors it's an opportunity to to either recover or try again.

Daniel
Reply all
Reply to author
Forward
0 new messages