0

I tried to ask this on the GAE group, but got nothing, and I'm getting nowhere fast with this problem...

I have an installed app submitting files to my GAEj app, via the blobstore service. This all works fine on the dev server, but in production, the blobstore accepts the upload, then calls my app with the URL supplied to blobstoreService.createUploadUrl(), correctly passes along all the parameters that my client supplied along with the uploaded file to this URL, but returns an empty map for the blobstoreService.getUploadedBlobs() call, at which point my app crashes, and GAE returns a 500 to my client. This would all be much easier to debug if the blobstore gave some indication, somewhere, of what was going wrong.

Also, I don't see any created blobs in the dashboard, so I know they're not being created.

Thanks! -----EDIT----- Here is a fiddler http capture of the data:

POST http://MYAPP.appspot.com/_ah/upload/?oauth_token=1%2FTRaFrr7-6m55jqdJBnFovQwS51WsrmNKmhHfTNxEWro&oauth_consumer_key=anonymous&oauth_nonce=I5HbpgtW&oauth_signature_method=HMAC-SHA1&oauth_signature=Ls7CWohqj2829nJV8bIGj2EkDCQ%3D&oauth_version=1.0&oauth_timestamp=1288878313/AMmfu6YAKuBqyq8M8zQ5hpHUAY88LJjYmbPj6Y7663GrW5qa8dYwWLWXpRHtktu_C1dyozhoH8CS2It6hjNQTbBsoFgFcERR_8680rpcv0fnZ1rl_P_0mDw/ALBNUaYAAAAATNK7QSoSJ5sWOxotMwyHoShtadRvqw8P/ HTTP/1.1
Content-Type: multipart/form-data; boundary=-----------------------------28947758029299
User-Agent: MyAppClient
Host: MYAPP.appspot.com
Content-Length: 4678
Expect: 100-continue

-------------------------------28947758029299
Content-Disposition: form-data; name="UploadToken"

aglvcGVua2xlaW9yGgsSEkdvb2dsZUFjY291bnRzVXNlchihnAEM
-------------------------------28947758029299
Content-Disposition: form-data; name="LastInChain"

True
-------------------------------28947758029299
Content-Disposition: form-data; name="CardID"

6f1e4c6a-54b6-49a6-96fc-22e08db3dde4
-------------------------------28947758029299
Content-Disposition: form-data; name="MediaType"

Image
-------------------------------28947758029299
Content-Disposition: form-data; name="HtmlKey"

img0.jpg
-------------------------------28947758029299
Content-Disposition: form-data; name="Position"

0
-------------------------------28947758029299
Content-Disposition: form-data; name="ParentID"

4d386a6e-b742-4249-a2f0-ff33a2300ff0
-------------------------------28947758029299
Content-Disposition: form-data; name="file"; filename="img0.jpg";
Content-Type: image/jpg

�����JFIF��`�`�����C�
*BINARYSTUFFREMOVEDFROMHERE*    

-------------------------------28947758029299--
tempy
  • 1,567
  • 2
  • 18
  • 28
  • Does everything work if you use a standard HTML form to upload to your app? It seems likely your client-side code isn't producing well-formed uploads, and the dev_appserver is being more flexible than the production code. – Nick Johnson Nov 04 '10 at 13:45
  • I am currently in the process of making a normal HTML form to see if that changes anything. I just edited my question to include a capture of the file upload. I've spent quite a bit of time comparing it to what's expected by the RFC, and it seems fine. – tempy Nov 04 '10 at 14:00
  • I've noticed the following in the dashboard logs: "POST /mediaupload HTTP/1.1" 500 3791 - "MYAPP,gzip(gfe)", all requests seem to consist of two numbers, the first one being the resulting http code and the second number, in this case always "3791", I could not find any clue to its meaning. Could this number possibly be some error code from the blobstore? – tempy Nov 04 '10 at 15:06

1 Answers1

1

I finally fixed my problem, the villain in my case was a semi-colon.

The line

"Content-Disposition: form-data; name="file"; filename="img0.jpg";"

should instead be:

"Content-Disposition: form-data; name="file"; filename="img0.jpg""

Though this is certainly my mistake, I really wish that the blobstore would fail in a less opaque way, and also that the parser would behave identically on development and production.

Between my mistake, and this question: AppEngine BlobStore upload failing with a request that works in the Development Environment I guess the blobstore parser can be a temperamental animal. =)

Community
  • 1
  • 1
tempy
  • 1,567
  • 2
  • 18
  • 28