search icon indicating copy to clipboard operation
search copied to clipboard

Mapreduce tasks fail to start

Open davidwtbuxton opened this issue 8 years ago • 3 comments

Hi,

I'm using the ReindexMapReduceTask, but it fails to start when using the local dev server, and when deployed to App Engine.

The first error is a TypeError exception:

Internal Server Error: /tasks/reindex/
Traceback (most recent call last):
  File "/Users/dave/myproject/sitepackages/prod/django/core/handlers/base.py", line 149, in get_response
    response = self.process_exception_by_middleware(e, request)
  File "/Users/dave/myproject/sitepackages/prod/django/core/handlers/base.py", line 147, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Users/dave/myproject/bp/tasks/indexing.py", line 48, in reindex
    ReindexContentTask().start()
  File "/Users/dave/myproject/sitepackages/prod/djangae/contrib/mappers/pipes.py", line 162, in start
    pipe.with_params(target=self.target)
TypeError: get_deferred_target() takes no arguments (1 given)
ERROR    2017-02-17 18:29:39,936 base.py:284] Internal Server Error: /tasks/reindex/
Traceback (most recent call last):
  File "/Users/dave/myproject/sitepackages/prod/django/core/handlers/base.py", line 149, in get_response
    response = self.process_exception_by_middleware(e, request)
  File "/Users/dave/myproject/sitepackages/prod/django/core/handlers/base.py", line 147, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Users/dave/myproject/bp/tasks/indexing.py", line 48, in reindex
    ReindexContentTask().start()
  File "/Users/dave/myproject/sitepackages/prod/djangae/contrib/mappers/pipes.py", line 162, in start
    pipe.with_params(target=self.target)
TypeError: get_deferred_target() takes no arguments (1 given)

And then after fixing that, it fails with a KeyError exception:

ERROR    2017-02-17 18:34:00,962 base.py:284] Internal Server Error: /tasks/reindex/
Traceback (most recent call last):
  File "/Users/myproject/sitepackages/prod/django/core/handlers/base.py", line 149, in get_response
    response = self.process_exception_by_middleware(e, request)
  File "/Users/myproject/sitepackages/prod/django/core/handlers/base.py", line 147, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Users/myproject/myproject/tasks/indexing.py", line 48, in reindex
    ReindexContentTask().start()
  File "/Users/myproject/sitepackages/prod/djangae/contrib/mappers/pipes.py", line 163, in start
    pipe.start(base_path=PIPELINE_BASE_PATH, queue_name=queue_name)
  File "/Users/myproject/sitepackages/prod/mapreduce/pipeline_base.py", line 21, in start
    return pipeline.Pipeline.start(self, **kwargs)
  File "/Users/myproject/sitepackages/prod/pipeline/pipeline.py", line 673, in start
    self, idempotence_key, str(e)))
PipelineSetupError: Error starting djangae.contrib.mappers.pipes.DjangaeMapperPipeline(*('myproject.tasks.indexing.ReindexContentTask', 'djangae.contrib.mappers.thunks.thunk_map', 'djangae.contrib.mappers.readers.DjangoInputReader'), **{'params': {'_map': 'myproject.tasks.indexing.ReindexContentTask.map', 'args': (), 'db': 'default', 'kwargs': {}, 'model': 'myproject.Content', 'namespace': None}, 'shards': 1})#ea53b46c87f148f8bde2ee065eaa3182: KeyError('gLovneKdxm',)

I think the second error is because I used the wrong API to get the target. Should be using the module name, rather than the current version name.

davidwtbuxton avatar Feb 17 '17 18:02 davidwtbuxton

N.B. Using current head https://github.com/potatolondon/search/tree/78b63fda9756a598e9607aab9d61c084b108b75c

davidwtbuxton avatar Feb 17 '17 18:02 davidwtbuxton

Think the second error may be solved by this recent commit in the pipeline repo:

https://github.com/GoogleCloudPlatform/appengine-pipelines/commit/2f1930b0be21a40077676c6fc19a6b95801caa9e

Hasn't been released to PyPI yet, but you can install with pip like:

pip install --target libs https://github.com/GoogleCloudPlatform/appengine-pipelines/archive/master.zip#subdirectory=python/src

davidwtbuxton avatar Feb 17 '17 23:02 davidwtbuxton

For background see cl/126706214

Bloody Google open source.

davidwtbuxton avatar Feb 17 '17 23:02 davidwtbuxton