Google App Engine Error Unknown Task Queue - google-app-engine

i just deployed the appengine application and when i do a rest get call to trigger the queue i am getting below UnknownQueueError. It appears that the exception is thrown at the the below source code line. Any ideas on what is causing the issue. I tested locally and it works perfectly fine.
q.add(task)
Exception
Exception on /tasks/stock/prices/dispatch [GET]
Traceback (most recent call last):
File "/base/data/home/apps/s~xxxxx-173913/internal-
api:20170716t091842.402709903291335684/lib/flask/app.py", line 1817,
in wsgi_app
response = self.full_dispatch_request()
File "/base/data/home/apps/s~xxxxx-173913/internal-
api:20170716t091842.402709903291335684/lib/flask/app.py", line 1477,
in full_dispatch_request
rv = self.handle_user_exception(e)
File "/base/data/home/apps/s~xxxx-173913/internal-
api:20170716t091842.402709903291335684/lib/flask/app.py", line 1381,
in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/base/data/home/apps/s~xxxxxx-173913/internal-
api:20170716t091842.402709903291335684/lib/flask/app.py", line 1475,
in full_dispatch_request
rv = self.dispatch_request()
File "/base/data/home/apps/s~xxxxxx-173913/internal-
api:20170716t091842.402709903291335684/lib/flask/app.py", line 1461,
in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/base/data/home/apps/s~xxxx-173913/internal-apixxx/
internal/tasks/stock_prices_dispa
tch.py", line 34, in run
q.add(task)
File"/base/data/home/runtimes/python27/python27_lib
/versions/1/google/appengine/api/taskqueue/taskqueue.py",
line 2128, in add
return self.add_async(task, transactional).get_result()
File"/base/data/home/runtimes/python27/python27_lib
/versions/1/google/appeng
ine/api/apiproxy_stub_map.py", line 613, in get_result
return self.__get_result_hook(self)
File "/base/data/home/runtimes/python27/
python27_lib/versions/1/google/appeng
ine/api/taskqueue/taskqueue.py", line 2162, in ResultHook
raise exception
UnknownQueueError
Source Code
task = Blueprint('tasks.stock.prices.dispatch', __name__)
#task.route('/tasks/stock/prices/dispatch')
def run():
q = taskqueue.Queue('push-queue')
from_date = request.args.get('from')
to_date = request.args.get('to')
with open(os.path.join(os.path.dirname(__file__),
"../resources/dow_30.csv")) as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
ticker = row['TICKER']
stock_code = row['StockCode']
task = taskqueue.Task(
url='/tasks/stock/prices/shard',
target='internal-api',
headers={'Content-Type' : 'application/json'},
payload=json.dumps({'ticker': ticker, 'stock_code': stock_code, 'from' : from_date, 'to' : to_date}))
logging.info("StockCode :=" + stock_code)
q.add(task)
return "OK"

When i deployed the application i forgot to deploy queue.yaml. Once i did the below ( provided by #DanCornilescu) it resolved the issue.
gcould app deploy <path_to_your_queue.yaml>

Related

I am facing a Flask error (Attribute error: init)

I am new to flask and I am having some problems one of them being,
When I try to start running the below app on the server I get an error saying Attribute error: init
I have no clue what to do next even after a lot of googling.
from flask import *
from models import db, EmployeeModel
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///theemp.db"
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
db.init_app(app)
#Linking instance from Models and creating a DB file before the user accesses the server
#app.before_first_request
def create_table():
db.create_all()
#Create view
#app.route("/data/create", methods=["GET", "POST"])
def create():
if request.method == "GET":
return render_template("create.html")
if request.method == "POST":
employee_id = request.form["employee_id"]
name = request.form["name"]
age = request.form["age"]
position = request.form["position"]
employee = EmployeeModel(employee_id=employee_id, name=name, age=age, position=position)
db.session.add(employee)
db.commit()
return redirect(url_for("data"))
if __name__=="__main__":
app.run(debug=True)
Here is the exception I get.
Traceback (most recent call last):
File "/home/detective/FlaskProjects/EmployeeCRUD/emp/bin/flask", line 8, in <module>
sys.exit(main())
File "/home/detective/FlaskProjects/EmployeeCRUD/emp/lib/python3.10/site-packages/flask/cli.py", line 1047, in main
cli.main()
File "/home/detective/FlaskProjects/EmployeeCRUD/emp/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/detective/FlaskProjects/EmployeeCRUD/emp/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/detective/FlaskProjects/EmployeeCRUD/emp/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/detective/FlaskProjects/EmployeeCRUD/emp/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/detective/FlaskProjects/EmployeeCRUD/emp/lib/python3.10/site-packages/click/decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/home/detective/FlaskProjects/EmployeeCRUD/emp/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/detective/FlaskProjects/EmployeeCRUD/emp/lib/python3.10/site-packages/flask/cli.py", line 911, in run_command
raise e from None
File "/home/detective/FlaskProjects/EmployeeCRUD/emp/lib/python3.10/site-packages/flask/cli.py", line 897, in run_command
app = info.load_app()
File "/home/detective/FlaskProjects/EmployeeCRUD/emp/lib/python3.10/site-packages/flask/cli.py", line 308, in load_app
app = locate_app(import_name, name)
File "/home/detective/FlaskProjects/EmployeeCRUD/emp/lib/python3.10/site-packages/flask/cli.py", line 218, in locate_app
__import__(module_name)
File "/home/detective/FlaskProjects/EmployeeCRUD/myapp.py", line 7, in <module>
db.init(app)
File "/home/detective/FlaskProjects/EmployeeCRUD/emp/lib/python3.10/site-packages/flask_sqlalchemy/extension.py", line 988, in __getattr__
raise AttributeError(name)
AttributeError: init

DeadlineExceededError despite using ndb.put_multi_async

I have the following POST method in my api. After sending a big JSON collection around 350 entries to the api, I get an DeadlineExceedError exception.
I already am utilising the ndb.multi_put_async. I don't know what else I could do to speed this up?
def post(self):
arguments = self.reqparser.parse_args()
json_records = arguments.get('records')
user = User.query(User.email == request.authorization.username).get()
if user:
records_put_list = []
events_put_list = []
for json_record in json_records:
record_id = json_record['record_id']
rec = Record.get_or_insert(record_id,
user=user.key,
record_date=record_date,
timestamp=record_timestamp)
for json_event in json_record['events']:
event = Event.get_or_insert(json_event['event_id'],
parent=rec.key,
user=user.key,
is_deleted=json_event['is_deleted'])
if event.timestamp < json_event['timestamp']:
event.user = user.key
event.record = rec.key
event.date_time = event_dt
event.timestamp = json_event['timestamp']
event.parent = rec.key
events_put_list.append(event)
ndb.put_multi_async(records_put_list)
ndb.put_multi_async(events_put_list)
return '', 201
else:
return '', 401
This is the exception. Any advice what I could do?
Traceback (most recent call last):
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 266, in Handle
result = handler(dict(self._environ), self._StartResponse)
File "/base/data/home/apps/s~feeltracker1/1-0-1-0.376950929493492366/lib/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/base/data/home/apps/s~feeltracker1/1-0-1-0.376950929493492366/lib/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/base/data/home/apps/s~feeltracker1/1-0-1-0.376950929493492366/lib/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/base/data/home/apps/s~feeltracker1/1-0-1-0.376950929493492366/lib/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/base/data/home/apps/s~feeltracker1/1-0-1-0.376950929493492366/lib/flask_restful/__init__.py", line 397, in wrapper
resp = resource(*args, **kwargs)
File "/base/data/home/apps/s~feeltracker1/1-0-1-0.376950929493492366/lib/flask/views.py", line 84, in view
return self.dispatch_request(*args, **kwargs)
File "/base/data/home/apps/s~feeltracker1/1-0-1-0.376950929493492366/lib/flask_restful/__init__.py", line 487, in dispatch_request
resp = meth(*args, **kwargs)
File "/base/data/home/apps/s~feeltracker1/1-0-1-0.376950929493492366/application/http_basic_auth.py", line 36, in decorated
return f(*args, **kwargs)
File "/base/data/home/apps/s~feeltracker1/1-0-1-0.376950929493492366/application/rest_api_view.py", line 362, in post
is_deleted=json_event['is_deleted'])
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/model.py", line 3401, in _get_or_insert
return cls._get_or_insert_async(*args, **kwds).get_result()
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 325, in get_result
self.check_success()
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 320, in check_success
self.wait()
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 304, in wait
if not ev.run1():
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/eventloop.py", line 235, in run1
delay = self.run0()
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/eventloop.py", line 197, in run0
callback(*args, **kwds)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 474, in _on_future_completion
self._help_tasklet_along(ns, ds_conn, gen, val)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 371, in _help_tasklet_along
value = gen.send(val)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/context.py", line 1015, in transaction
ok = yield tconn.async_commit(options)
DeadlineExceededError
You are not using the right logic. Do not put the get_or_insert in the loop - that is never going to work for anything except the smallest number of records (and is generally an anti-pattern to avoid). Instead create the entities and append them to the list inside the loop. Once this is done, the put_multi will then take this list and handle all the puts in parallel. There is a question about how many items in a put_multi list is tolerable, but 350 is far from what I remember as a limit.
You can use a Task API to split this processing job into smaller batches (e.g. 100 entries per task - you can find the optimum number).

Should Exception catch DeadlineExceededError exceptions?

I have the code like below:
try:
response = urlfetch.Fetch(url, deadline=60, headers=headers, follow_redirects=False)
except Exception, error_message:
logging.exception('Failed, exception happened - %s' % error_message)
but sometimes it fails with DeadlineExceededError? Should not this DeadlineExceededError be caught by my code?
The exception details:
Traceback (most recent call last):
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 266, in Handle
result = handler(dict(self._environ), self._StartResponse)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in __call__
rv = self.router.dispatch(request, response)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher
return route.handler_adapter(request, response)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1102, in __call__
return handler.dispatch()
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 570, in dispatch
return method(*args, **kwargs)
File "/base/data/home/apps/s~myapp/1.375970700643773844/myapp.py", line 424, in get
url, response = call_api(origin=origin, destination=destination, date=date_.strftime('%Y-%m-%d'))
File "/base/data/home/apps/s~myapp/1.375970700643773844/myapp.py", line 288, in call_api
response = urlfetch.Fetch(url, deadline=60, headers=headers, follow_redirects=False)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/urlfetch.py", line 270, in fetch
return rpc.get_result()
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 612, in get_result
return self.__get_result_hook(self)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/urlfetch.py", line 375, in _get_fetch_result
rpc.check_success()
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 585, in check_success
self.__rpc, err)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 196, in Call
for key, function, srv, num_args in self.__content:
DeadlineExceededError
To answer your specific question, "Should not this DeadlineExceededError be caught by my code?":
The DeadlineExceededError class extends BaseException instead of Exception, so your except clause will never be called.
from google.appengine.runtime import DeadlineExceededError
my_error = DeadlineExceededError()
isinstance(my_error, Exception) # False
isinstance(my_error, BaseException) # True
First approach
Try excepting the DeadlineExceededError class by importing
from google.appengine.runtime import DeadlineExceededError and doing it like this:
try:
response = urlfetch.Fetch(url, deadline=60, headers=headers, follow_redirects=False)
except DeadlineExceededError, error_message:
logging.exception('Failed, exception happened - %s' % error_message)
Read more about it on the documentation.
Second Approach
I've faced this error before, and an approach I've followed was not to set which exception class I was trying to catch. I just called except.
try:
response = urlfetch.Fetch(url, deadline=60, headers=headers, follow_redirects=False)
except:
logging.exception('First failure')
# try again your request as suggested by the documentation
try:
response = urlfetch.Fetch(url, deadline=60, headers=headers, follow_redirects=False)
except:
logging.exception('Second failure')
return None
But I wasn't able to catch the error message, and instead of just logging an error message, I tried the request once again when the exception was raised, as the link I posted above suggests.
Some good links you should read
You should read this about Dealing with DeadlineExceedError.
There is also Backends, which allow you to avoid this request timer; with backends, there is no time limit for generating and returning a request.
Hope this helps you.

App Engine Development Environment - db.get() ReferenceProperty Query random error

I have the following datastore model:
class FeatureCategory(db.Model):
name_eng = db.StringProperty(required=True)
name_spa = db.StringProperty()
name_por = db.StringProperty()
device_type = db.ReferenceProperty(DeviceType, required=True, collection_name='feature_categories')
class Feature(db.Model):
name = db.StringProperty(required=True)
category = db.ReferenceProperty(FeatureCategory, required=True, collection_name='features')
desc_eng = db.StringProperty()
desc_spa = db.StringProperty()
desc_por = db.StringProperty()
I've been experiencing errors when after doing a couple of db.get(db.Key('key_string')) and to the Referenced object like:
feats = dbmodel.Feature.all()
for feat in feats:
cat = feat.category
in the development environment. If I stop the server and restart, it will work for some queries and be back to throwing the error below. Any ideas how can I fix this?
Traceback (most recent call last):
File "/Applications/Development/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1536, in __call__
rv = self.handle_exception(request, response, e)
File "/Applications/Development/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1530, in __call__
rv = self.router.dispatch(request, response)
File "/Applications/Development/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1278, in default_dispatcher
return route.handler_adapter(request, response)
File "/Applications/Development/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1102, in __call__
return handler.dispatch()
File "/Applications/Development/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 572, in dispatch
return self.handle_exception(e, self.app.debug)
File "/Applications/Development/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 570, in dispatch
return method(*args, **kwargs)
File "/Users/danielgarcia/Documents/workspace/rfpbuilder/src/get.py", line 50, in get
cat = feat.category
File "/Applications/Development/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/db/__init__.py", line 3686, in __get__
instance = get(reference_id)
File "/Applications/Development/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/db/__init__.py", line 1536, in get
return get_async(keys, **kwargs).get_result()
File "/Applications/Development/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 592, in get_result
return self.__get_result_hook(self)
File "/Applications/Development/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/datastore/datastore_rpc.py", line 1467, in __get_hook
entities = rpc.user_data(entities)
File "/Applications/Development/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/datastore.py", line 600, in local_extra_hook
return extra_hook(result)
File "/Applications/Development/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/db/__init__.py", line 1506, in extra_hook
model = cls1.from_entity(entity)
File "/Applications/Development/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/db/__init__.py", line 1441, in from_entity
return cls(None, _from_entity=entity, **entity_values)
File "/Applications/Development/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/db/__init__.py", line 973, in __init__
prop.__set__(self, value)
File "/Applications/Development/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/db/__init__.py", line 613, in __set__
value = self.validate(value)
File "/Applications/Development/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/db/__init__.py", line 2815, in validate
value = super(StringProperty, self).validate(value)
File "/Applications/Development/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/db/__init__.py", line 640, in validate
raise BadValueError('Property %s is required' % self.name)
BadValueError: Property name is required
Please indent the code next time. The error message Property name is required indicates that some of your Feature entity don't have name property, which is marked as required in your model.

How to solve my deadlineexceedederror for a GAE cron task?

I'm getting a deadlineexceedederror when trying to create a kml file by a cron that starts a task. The error message is
2012-01-30 16:07:47.902 /createkml/ 500 5012ms 0kb AppEngine-Google; (+http://code.google.com/appengine)
0.1.0.2 - - [30/Jan/2012:10:07:47 -0800] "POST /createkml/ HTTP/1.1" 500 0 "http://www.koolbusiness.com/createkmltask/" "AppEngine-Google; (+http://code.google.com/appengine)" "www.koolbusiness.com" ms=5013 cpu_ms=3305 api_cpu_ms=295 cpm_usd=0.091855 queue_name=default task_name=7177535986681131286 instance=00c61b117cf890b99ca52a6b9e7c5f048e72
I 2012-01-30 16:07:42.959
creating file
E 2012-01-30 16:07:47.853
ApplicationError: 5
Traceback (most recent call last):
File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1511, in __call__
rv = self.handle_exception(request, response, e)
File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1505, in __call__
rv = self.router.dispatch(request, response)
File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1253, in default_dispatcher
return route.handler_adapter(request, response)
File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1077, in __call__
return handler.dispatch()
File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 547, in dispatch
return self.handle_exception(e, self.app.debug)
File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 545, in dispatch
return method(*args, **kwargs)
File "/base/data/home/apps/s~montaoproject/gralumo.356457066048686089/main.py", line 1575, in post
result = urlfetch.fetch(url)
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/urlfetch.py", line 263, in fetch
return rpc.get_result()
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 592, in get_result
return self.__get_result_hook(self)
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/urlfetch.py", line 371, in _get_fetch_result
raise DeadlineExceededError(str(err))
DeadlineExceededError: ApplicationError: 5
My code is
class CreateKMLTask(webapp2.RequestHandler):
def get(self):
logging.info('creating KML task')
taskqueue.add(url=r'/createkml/')
self.redirect('/')
class CreateKMLHandler(webapp2.RequestHandler):
def post(self):
# Create the file
logging.info('creating file')
file_name = \
files.blobstore.create(mime_type='application/octet-stream')
url = 'http://montaoproject.appspot.com/list.kml'
result = urlfetch.fetch(url)
if not result.content:
return
# Open the file and write to it
logging.info('opening file')
with files.open(file_name, 'a') as f:
f.write(result.content)
# Finalize the file. Do this before attempting to read it.
files.finalize(file_name)
# Get the file's blob key
logging.info('getting blob key of file')
blob_key = files.blobstore.get_blob_key(file_name)
logging.info('new blob key:'+str(blob_key))
im = Image.get_by_id(4468185)
im.primary_image = blob_key
im.put()
logging.info('new image key:'+str(im.primary_image))
logging.info('finished KML handling and put image')
webapp2.Route(r'/createkml/', handler=CreateKMLHandler,
name='createkml'),
webapp2.Route(r'/createkmltask/', handler=CreateKMLTask,
name='createkmltask')
My cron.yaml:
cron:
- description: daily mailout
url: /report/daily
schedule: every 24 hours
- description: daily mailout
url: /report/montaodaily
schedule: every 24 hours
- description: refresh kml
url: /createkmltask/
schedule: every 24 hours
What I'm trying to do is refresh to KML file to a new blob that has the same File ID as before so the call will be the same. What can I do to resolve my timeout problem? I think it should work.
Thanks
This timeout is fetching the url; you can see this in the stack trace. The fetch function defaults to a 5-second timeout.
The URL Fetch docs say you can increase the timeout by passing deadline as an additional argument. For example, deadline=60 would give you a 60-second timeout.
So, try result = urlfetch.fetch(url, deadline=60)

Resources