Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

503 and 400 on uploading images in Google App Engine

Recently I experienced two problems in uploading files to my Java gae app. I'm using the tecnique described in the blobstore doc.

  1. With regular files, occasionally (let's say 15% of times) the client receives a "503 Service Unavailable".
  2. With high resolution images (example 7000x10000) the client always receives a "400 Bad Request".

On both cases on the server there are no error messages logged, the blobs are written correctly, but the successPath url (the callback of createUploadUrl) is never called. It seems that the GAE endpoint handling the upload crashes for some reasons.

My client is a js XMLHttpRequest, wrapped in GWT:

public native void uploadWithXMLHttpRequest(UploadForm uploadForm) /*-{
    var fd = new FormData();
    var files = [email protected]::getFiles()();  
    for (var i = 0; i < files.length; i++) {
        fd.append("uploadFile"+i, files[i]);
    }
    var xhr = new XMLHttpRequest();
    //xhr.upload.addEventListeners... omitted
    xhr.open("POST", [email protected]::getUploadUrl()());
    xhr.send(fd);
}

Any ideas for possible causes and solutions/workarounds? Thx.

like image 765
bebo Avatar asked Nov 14 '22 05:11

bebo


1 Answers

This issue is being discussed in a GAE ticket opened by another user having the same problem: https://code.google.com/p/googleappengine/issues/detail?id=7619 (btw, the bug tracker system has a "start" feature, which allows you to vote for the ticket and receive notifications)

like image 69
user431640 Avatar answered Mar 12 '23 03:03

user431640