Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>We recently hit this problem with a <code>threadsafe: false</code> project, and were able to resolve the issue by changing how were were importing the <code>context</code> module. Kevin explains the issue well in <a href="https://code.google.com/p/appengine-mapreduce/issues/detail?id=127" rel="nofollow">this bug report</a>.</p> <blockquote> <p>kevin.mo...@gmail.com Maybe this will help someone else, but I was seeing this issue and just figured it out for my use case. In our project, we have the mapreduce library in subfolders "libs/external/mapreduce" and not the root of our project.</p> <p>The library imports context (among other things) from itself as <code>from mapreduce import context</code>. So to make it work we are using import manipulation like so:</p> <pre><code>import os, sys sys.path.append(os.path.join(os.path.dirname(__file__), 'libs/external')) </code></pre> <p>However, in a few places in our code we were still importing context like so: </p> <pre><code>from libs.external.mapreduce import context </code></pre> <p>This will actually cause context to get imported twice and <code>mapreduce.context.Context._local</code> will get set twice, thus having two different instances of <code>thread._local</code>. When <code>Context._set</code> is called to store the context for later retrieval in a mapper function or something, it will be using the original <code>thread._local</code> instance.</p> <p>Later when our mapper module imports context again, it gets a new <code>thread._local</code> instance. When we were then <code>calling context.get()</code> it was returning the new instance which didn't actually have the context:</p> <pre><code>AttributeError: 'NoneType' object has no attribute 'mapreduce_spec' </code></pre> <p>Switching all our imports to <code>from mapreduce import context</code> fixed it for us.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload