Reputation: 4419
I am using google app engine with python and I just implemented memcache and everything looks good on the user side. The data is being cached properly but when I look into the logs I see random error codes popping up each time I open a page. Now they are the same for a single page no matter how many times I open it and it is only being stored in memcache one time but two error codes come up each time. The first one is always -1 and the second is random. Some examples are 194, 214, 204, 77, 208, and 158. There is no more information besides the time.
Here is my code that is doing the actual caching and this happens every time a user puts a new post on my website:
class PostPage(BlogHandler):
def get(self, post_id, subject):
key = db.Key.from_path('Post', int(post_id), parent=blog_key())
key = str(key)
post = memcache.get(key)
if post is None:
logging.error('DB QUERY')
post = db.get(key)
memcache.set(key, post)
if not post:
self.error(404)
return
self.render("permalink.html", post = post)
Any idea what could be causing this? Is it my call to get Key.from_path?
Here is the actual log:
2012-07-02 22:52:21.331 /post/31001/profile-pages-down-for-maintenance 200 47ms 2kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5
E 2012-07-02 22:52:21.318 DB QUERY
E 2012-07-02 22:52:21.330 -1
E 2012-07-02 22:52:21.330 208
2012-07-02 22:52:18.311 /js/bootstrap.js 404 35ms 0kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5
2012-07-02 22:52:17.910 / 200 115ms 4kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5
2012-07-02 22:52:14.797 /js/bootstrap.js 404 34ms 0kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5
2012-07-02 22:52:14.499 /profile/17001 200 90ms 3kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5
2012-07-02 22:52:14.173 /profile 302 104ms 0kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5
2012-07-02 22:52:13.198 /js/bootstrap.js 404 36ms 0kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5
2012-07-02 22:52:12.823 / 200 138ms 4kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5
2012-07-02 22:51:59.664 /search?q=paragliding 200 35ms 2kb Mediapartners-Google
2012-07-02 22:51:57.902 /static/bootstrap.css 200 32ms 0kb
2012-07-02 22:51:57.860 /js/bootstrap.js 404 30ms 0kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5
2012-07-02 22:51:57.537 /search?q=paragliding 200 57ms 2kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5
2012-07-02 22:51:51.105 /js/bootstrap.js 404 30ms 0kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5
2012-07-02 22:51:50.838 / 200 119ms 4kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5
2012-07-02 22:50:49.812 /favicon.ico 404 96ms 0kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5
2012-07-02 22:48:43.633 /post/14009/more-fantastic-paragliding 200 1090ms 2kb Mediapartners-Google
E 2012-07-02 22:48:43.632 137
E 2012-07-02 22:48:43.632 365
2012-07-02 22:48:42.464 /robots.txt 404 29ms 0kb Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
2012-07-02 22:48:41.513 /js/bootstrap.js 404 31ms 0kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5
2012-07-02 22:48:41.288 /post/14009/more-fantastic-paragliding 200 48ms 2kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5
E 2012-07-02 22:48:41.287 137
E 2012-07-02 22:48:41.287 365
Upvotes: 0
Views: 171
Reputation: 31928
I don't think those are (real) errors, something is logging those numbers with log.error, look for log.error('%d' (or log.error('%s' ) in your code. possibly in your render() method.
Upvotes: 1