Retrieving All Recently Created Entities
Error Code 202
On high traffic App Engine applications, you may occasionally see a request fail with error code 202. You’ll see the following text in your logs:
A problem was encountered with the process that handled this request, causing it to exit. This is likely to cause a new process to be used for the next request to your application. (Error code 202)
The request log will look similar to the picture below:
Error code 202 is an internal App Engine failure code: an unknown error occurred within App Engine or its associated services, not from your application. This is not an error that your application can catch or recover from, nor is the application at fault for this error. The current request will fail, but the client is free to retry the request. If this request is from the task queue service, the task queue will automatically retry the request if you set the appropriate settings while creating the task.
A note about error codes: the code 202 relates to App Engine; it is NOT a HTTP status code. When a request encounters this internal error, it fails with the HTTP status code 500 (as you can see from the above picture).
HTTP Basic Access Authorization In Golang
One of the simplest and oldest methods of authorization is HTTP Basic authorization. While it isn’t as secure as the Users service of App Engine or the OAuth authorization model, it’s easy to implement and looks visually impressive depending on the user’s browser.
Here’s a picture of the HTTP Basic authorization prompt in IE10 on Windows 8:
The variable authorization contains a base64 encoded hash generated by the user’s browser, created by concatenating the username and password together with a colon: username:password. R represents a http.Request reference, c is appengine.Context, and w is http.ResponseWriter.
//Get the authorization header.
authorization_array := r.Header["Authorization"]
if len(authorization_array) > 0 {
authorization := strings.TrimSpace(authorization_array[0])
c.Infof("Authorization: ", authorization)
} else {
w.Header().Set("WWW-Authenticate", "Basic realm=\"user\"")
http.Error(w, http.StatusText(401), 401)
}
YouTube Error Page
When designing web sites it’s always important to make every page – even error pages – user friendly. As an example, here’s a picture of YouTube’s error page. The reference to highly trained monkeys always makes me laugh.
Searching Twitter
HTTP GET Using The Low Level Java App Engine API
Capitalization In Cron Scheduling
A note on cron: schedules must be recorded in all lowercase letters. The following picture shows an application upload failure because the S in Saturday is capitalized in cron.
However the all lowercase version schedule: every saturday 9:00 works.