title: google.cloud.exceptions.NotFound: 404 The project does not exist or it does not contain an active Cloud Datastore database
body: <p>I am trying to use <code>google cloud datastore emulator</code> for testing some datastore code.</p>
  
  <pre><code>class GoogleDBHandler:
  
      def __init__(self, datastore_client, kind):
  
          self.client = datastore_client
          self.kind = kind
  
      def get_tables(self):
          # [START kind_run_query]
          query = self.client.query(kind='__kind__')
          query.keys_only()
  
          kinds = [entity.key.name for entity in query.fetch()]
          # [END kind_run_query]
  
          return kinds
  
   # starting testing google cloud datastore
      gc_datastore_client = datastore.Client()
  
      gc_datastore_handler = GoogleDBHandler(gc_datastore_client, kind='vendor')
  
      tab = gc_datastore_handler.get_tables()[0]
  </code></pre>
  
  <p>I got the following error,</p>
  
  <pre><code>google.cloud.exceptions.NotFound: 404 The project project_name does not exist or it does not contain an active Cloud Datastore database.
  </code></pre>
  
  <p>I have run the following commands before the testing,</p>
  
  <pre><code>gcloud beta auth application-default login
  
  gcloud beta emulators datastore start
  </code></pre>
  
  <p>I am wondering what is the issue here.</p>
  
  <p>PS. it is interesting that when I ran the data emulator and testing some code for the first time, it worked without any issue.</p>
  
  <p>UPDATE</p>
  
  <p>The issue has been solved as the <code>App Engine</code> was switched off, and it must always be on when using the <code>datastore emulator</code>.</p>