400 The Cloud Datastore API is not enabled for the project
See original GitHub issueHey guys I did everything step by step, from a fresh installation, and redid at least 3 times to confirm.
each time I get this error for 2-structured-data
for both localhost and also when I deploy it in appspot
in appspot it shows:
An internal error occurred: 400 The Cloud Datastore API is not enabled for the project .... See logs for full stacktrace.
and in localhost it shows:
gcloud.exceptions.BadRequest
gcloud.exceptions.BadRequest: 400 The Cloud Datastore API is not enabled for the project river-daylight-128422
Traceback (most recent call last)
File "/home/medya/.local/lib/python3.4/site-packages/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/home/medya/.local/lib/python3.4/site-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/home/medya/.local/lib/python3.4/site-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/medya/.local/lib/python3.4/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/home/medya/.local/lib/python3.4/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/medya/.local/lib/python3.4/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/medya/.local/lib/python3.4/site-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/medya/.local/lib/python3.4/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/home/medya/.local/lib/python3.4/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/home/medya/.local/lib/python3.4/site-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/medya/workspace/getting-started-python/2-structured-data/bookshelf/crud.py", line 26, in list
books, next_page_token = get_model().list(cursor=token)
File "/home/medya/workspace/getting-started-python/2-structured-data/bookshelf/model_datastore.py", line 56, in list
entities, more_results, cursor = it.next_page()
File "/home/medya/.local/lib/python3.4/site-packages/gcloud/datastore/query.py", line 424, in next_page
transaction_id=transaction and transaction.id,
File "/home/medya/.local/lib/python3.4/site-packages/gcloud/datastore/connection.py", line 271, in run_query
_datastore_pb2.RunQueryResponse)
File "/home/medya/.local/lib/python3.4/site-packages/gcloud/datastore/connection.py", line 117, in _rpc
data=request_pb.SerializeToString())
File "/home/medya/.local/lib/python3.4/site-packages/gcloud/datastore/connection.py", line 94, in _request
raise make_exception(headers, error_status.message, use_json=False)
gcloud.exceptions.BadRequest: 400 The Cloud Datastore API is not enabled for the project river-daylight-128422
The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.
To switch between the interactive traceback and the plaintext one, you can click on the "Traceback" headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side.
You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection:
dump() shows all variables in the frame
dump(obj) dumps all that's known about the object
and for the record, I did create a service account json crediential and downloaded it, but the tutorial never said where should I put that json file.
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
The Cloud Datastore API is not enabled for the project
Hi, I'm going through the tutorial for the bookshelf app. I've run into an error when I try to run locally or deploy:...
Read more >GCP Firestore API is not available for Cloud Datastore projects
I had The Cloud Firestore API is not available for Datastore Mode projects with an empty Firestore. I've solved the error with the...
Read more >Enabling an API in your Google Cloud project
In the Google Cloud console, go to APIs & services for your project. ... In the page that displays information about the API,...
Read more >Use the Cloud Firestore REST API - Firebase
Useful for automating data structure migrations or synchronizing indexes between projects. Also enables retrieval of document metadata, such as the list of all ......
Read more >Turn Google Cloud on or off for users
Who can create projects. By default, project creation is on for users in your organization. · Use of the OS Login API. By...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi this is funny, I followed the google docs for datastore step by step and run this example, 3 years after I opened this issue, and I got the same error, and when I googled it I found my own issue from 3 years ago 😃
anyways, this issue is still there.
I was able to fix the issue by replacing
"return datastore.Client(current_app.config['PROJECT_ID'])"
to
return datastore.Client()
this line here
if you agree, I will make a PR for this issue.
Generally that’s how we verify fixes that involve pre-requisites - start a new project, click the enable API button, create credentials, and run the user-journey tests.