我有一个将文件上传到 Google App Engine 的应用程序。大多数计算机上的上传工作正常,但在一个系统(在不同的地理位置)上,我们在上传文件时不断收到 HTTP 503 错误。
该应用程序遵循 App Engine 文档。我们首先使用 BlobstoreService.createUploadUrl 创建上传 URL,将 URL 返回给客户端,然后客户端将文件提交到该 URL。
503错误的原因是什么以及如何解决?奇怪的是,它在该系统上不断复制,而同一个应用程序成功地从其他系统上传文件。
在下面的日志中,您可以看到: 1. 上传 URL 的请求/响应的 HTTP 标头, 2. 返回的上传 URL 3. 对该上传 URL 的请求/响应的 HTTP 标头。
GET /upload-url HTTP/1.1
Host: cl-test-grid.appspot.com
User-Agent: Drakma/1.2.6 (SBCL 1.0.57; Darwin; 10.8.0; http://weitz.de/drakma/)
Accept: */*
Connection: close
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Vary: Accept-Encoding
Date: Sun, 27 May 2012 05:30:03 GMT
Server: Google Frontend
Cache-Control: private
Connection: close
2012-05-27 05:30:02 upload-url: http://cl-test-grid.appspot.com/_ah/upload/AMmfu6b0LpFQeYiI5sZa6KcBy9_JpIreCEjYY-FEbd3b8wPApdW3_rUIETK-geaaw_x5xq3QHhcn_wd2Pykos07xIRJTZesBIX0jkI3L4-Ri3TiOqnbS3iM/ALBNUaYAAAAAT8G-M8FF5sO4mMkXVzZX8hTcUv0OQlIK/
POST /_ah/upload/AMmfu6b0LpFQeYiI5sZa6KcBy9_JpIreCEjYY-FEbd3b8wPApdW3_rUIETK-geaaw_x5xq3QHhcn_wd2Pykos07xIRJTZesBIX0jkI3L4-Ri3TiOqnbS3iM/ALBNUaYAAAAAT8G-M8FF5sO4mMkXVzZX8hTcUv0OQlIK/ HTTP/1.1
Host: cl-test-grid.appspot.com
User-Agent: Drakma/1.2.6 (SBCL 1.0.57; Darwin; 10.8.0; http://weitz.de/drakma/)
Accept: */*
Connection: close
Content-Type: multipart/form-data; boundary=----------6mlF09BtSz1OnI06GN22cqE9jBOi8L2ozKYqrT7fQy8dDDhwk2
Content-Length: 342917
HTTP/1.1 503 Service Unavailable
Server: HTTP Upload Server Built on May 23 2012 15:51:04 (1337813464)
Date: Sun, 27 May 2012 05:30:15 GMT
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate
Content-Length: 0
Content-Type: text/html
Connection: close