Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7398707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:54:14+00:00 2026-05-29T03:54:14+00:00

I’m getting a deadlineexceedederror when trying to create a kml file by a cron

  • 0

I’m getting a deadlineexceedederror when trying to create a kml file by a cron that starts a task. The error message is

    2012-01-30 16:07:47.902 /createkml/ 500 5012ms 0kb AppEngine-Google; (+http://code.google.com/appengine)

    0.1.0.2 - - [30/Jan/2012:10:07:47 -0800] "POST /createkml/ HTTP/1.1" 500 0 "http://www.koolbusiness.com/createkmltask/" "AppEngine-Google; (+http://code.google.com/appengine)" "www.koolbusiness.com" ms=5013 cpu_ms=3305 api_cpu_ms=295 cpm_usd=0.091855 queue_name=default task_name=7177535986681131286 instance=00c61b117cf890b99ca52a6b9e7c5f048e72

    I 2012-01-30 16:07:42.959

    creating file

    E 2012-01-30 16:07:47.853

    ApplicationError: 5 
    Traceback (most recent call last):
      File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1511, in __call__
        rv = self.handle_exception(request, response, e)
      File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1505, in __call__
        rv = self.router.dispatch(request, response)
      File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1253, in default_dispatcher
        return route.handler_adapter(request, response)
      File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1077, in __call__
        return handler.dispatch()
      File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 547, in dispatch
        return self.handle_exception(e, self.app.debug)
      File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 545, in dispatch
        return method(*args, **kwargs)
      File "/base/data/home/apps/s~montaoproject/gralumo.356457066048686089/main.py", line 1575, in post
        result = urlfetch.fetch(url)
      File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/urlfetch.py", line 263, in fetch
        return rpc.get_result()
      File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 592, in get_result
        return self.__get_result_hook(self)
      File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/urlfetch.py", line 371, in _get_fetch_result
        raise DeadlineExceededError(str(err))

DeadlineExceededError: ApplicationError: 5 

My code is

class CreateKMLTask(webapp2.RequestHandler):

    def get(self):
        logging.info('creating KML task')
        taskqueue.add(url=r'/createkml/')
        self.redirect('/')

class CreateKMLHandler(webapp2.RequestHandler):

    def post(self):

        # Create the file
        logging.info('creating file')
        file_name = \
            files.blobstore.create(mime_type='application/octet-stream')

        url = 'http://montaoproject.appspot.com/list.kml'

        result = urlfetch.fetch(url)
        if not result.content:
            return

        # Open the file and write to it
        logging.info('opening file')

        with files.open(file_name, 'a') as f:
            f.write(result.content)

        # Finalize the file. Do this before attempting to read it.

        files.finalize(file_name)

        # Get the file's blob key
        logging.info('getting blob key of file')

        blob_key = files.blobstore.get_blob_key(file_name)
        logging.info('new blob key:'+str(blob_key))
        im = Image.get_by_id(4468185)
        im.primary_image = blob_key
        im.put()
        logging.info('new image key:'+str(im.primary_image))
        logging.info('finished KML handling and put image')


    webapp2.Route(r'/createkml/', handler=CreateKMLHandler,
                  name='createkml'),
    webapp2.Route(r'/createkmltask/', handler=CreateKMLTask,
                  name='createkmltask')

My cron.yaml:

cron:

 - description: daily mailout

   url: /report/daily

   schedule: every 24 hours

 - description: daily mailout

   url: /report/montaodaily

   schedule: every 24 hours

 - description: refresh kml

   url: /createkmltask/

   schedule: every 24 hours

What I’m trying to do is refresh to KML file to a new blob that has the same File ID as before so the call will be the same. What can I do to resolve my timeout problem? I think it should work.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T03:54:15+00:00Added an answer on May 29, 2026 at 3:54 am

    This timeout is fetching the url; you can see this in the stack trace. The fetch function defaults to a 5-second timeout.

    The URL Fetch docs say you can increase the timeout by passing deadline as an additional argument. For example, deadline=60 would give you a 60-second timeout.

    So, try result = urlfetch.fetch(url, deadline=60)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create an if statement in PHP that prevents a single post
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.