Saturday, January 22, 2011

405 Error on Google App Engine

I was happily programming away on a new project on Google App Engine when I started getting 405 errors from all of my handlers. I would get the following in the dev app server log:

dev_appserver.py:3317] "GET / HTTP/1.1" 405 -

In the Firebug:

URL                   Status                
> GET localhost:8084  405 Method Not Allowed

In the browser when I tried to directly access pages they would render normally but if you looked at the headers I was still getting the 405 error and anything Ajax would fail. From looking around Google and StackOverflow there seemed to be a various reasons for this to fail, none of which seemed to be my issue.

What eventually turned out to be the issue was that I was trying to be a good OOP programmer and was calling up the inheritance tree for each of my methods. So HomeHandler.get() was calling BaseHandler.get() was calling webapp.RequestHandler.get(). Unfortunately, it seems that webapp.RequestHandler.get() does not exist or is at least not callable which resulted in the 405 status code. I changed my BaseHandler.get to not call webapp.RequestHandler.get and we were back in business.

Hopefull this blog post saves you some time.

No comments:

Post a Comment