user3058197
user3058197

Reputation: 1052

Why does App Engine return at 404 when starting a version?

I am playing around with manual_scaling on a module of mine because it only needs to be run once/day (it's a basic cron job) and App Engine spins up multiple instances that I don't need.

The way it will work is I plan on having a second cron job that starts my version with

from google.appengine.api import modules
[other code here]
def get(self):
    modules.start_version('downloader','one')

For whatever reason, when I do this, App Engine returns a 404:

INFO     2014-05-25 17:14:10,598 module.py:639] downloader: "GET /_ah/start HTTP/1.1" 404 -

Although when I try to load a script that's only part of the downloader module, it works fine (and conversely stops working after I run modules.stop_version('downloader','one')

Even though the start/stop functionality I'd like is working fine, am I doing something incorrectly here?

Upvotes: 1

Views: 683

Answers (1)

Denise Draper
Denise Draper

Reputation: 1291

You are correct that the system works fine in spite of the 404 errors. But it is easy enough to get rid of them, if you would rather not see these errors: just supply a handler for the _ah/start request. I made mine return a simple text message:

class Noop(webapp2.RequestHandler):
    def get(self):
        self.response.headers['Content-Type'] = 'text/plain'
        self.response.out.write('#done\n')

app.router.add((r'/_ah/start',Noop))  # silence gao errors

Upvotes: 1

Related Questions