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 6193711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:10:03+00:00 2026-05-24T03:10:03+00:00

In my GAE code I upload several files to 3rd party (not mine) server:

  • 0

In my GAE code I upload several files to 3rd party (not mine) server:

for argument in files_arguments:
    files_counter +=1
    file_size = len(self.request.get(argument))/(1024.0*1024.0)
    if file_size <= 1:
        files.append(MultipartParam('file1', self.request.get(argument), 'file'+str(files_counter)+'.jpg', 'application/x-www-form-urlencoded'))
        # sending file
        data, headers = multipart_encode(files)
        # try 3 times to send the file
        for i in range(3):
            try:
                result = urlfetch.fetch(url=self.request.get('upload_url'), 
                                        payload=''.join(data),
                                        method=urlfetch.POST,
                                        headers=headers,
                                        deadline=10
                                        )              
                break
            except DownloadError:
                logging.error('(POST) ... DownloadError during file upload, attempt ' + str(i))
                pass
            except DeadlineExceededError:
                logging.error('(POST) ... DeadlineExceededError during file upload, attempt ' + str(i))
                pass
        if result.status_code == 200:

and on ~10th file I am getting that DeadlineExceededError.
What can I do to avoid that?

  • 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-24T03:10:04+00:00Added an answer on May 24, 2026 at 3:10 am
    • If you have not done so already; re-factor your code so that you can defer the execution to a task. The deadline for Tasks is 10 minutes vs the 30 seconds for a normal request.
    • Further split down your problem so that each file upload is in it’s own task. This also has the added benefit of making your ‘retries’ code redundant as tasks can automatically retry when they fail.
    • If each upload takes longer than 10mins, then you will have to look at using Backends to handle the long-running processes.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My GAE application receives several files in the upload (can be from 0 to
Unfortunately, GAE requires restart of the server on each code change. Is it possible
I would like to keep normal html/javascript code on GAE server, but during page
I have a server side code to process uploaded binary files: class UploadHandler(webapp.RequestHandler): def
GAE not works with: import com.google.appengine.repackaged.com.google.common.base.Hash; import com.google.appengine.repackaged.com.google.common.io.ByteStreams; and my code: byte[] inputBytes; try
On GAE this line of code: file_name = files.blobstore.create(mime_type='image/png') drops google.appengine.runtime.DeadlineExceededError Here is the
I have this little set of Python code on the GAE, trying to upload
My GAE app runs fine from my computer, but when I upload it, I
From the GAE getting started guide Because the App Engine datastore is not a
I follow this article to update data to gae localhost server from MySQL. This

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.