Hey 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.
this is really weird I could solve the problem by using this link I found in google groups
https://console.cloud.google.com/flows/enableapi?apiid=datastore.googleapis.com
What is weird is,before that link my api already showed datastore as enabled and I enabled it through the link in the getting started doc on google site. why it was not enabled even though it was showing as enabled?
Datastore recently updated their API and it now requires a different toggle. We'll get the docs updated, thank you for reporting.
@waprin do you mind taking this one?
ack
This should be resolved.
@jonparrott can you link the PR that resolved this ?
Is' a documentation change, so unfortunately there isn't a pubic commit I
can reference.
On Thu, Jul 20, 2017 at 12:52 PM Medya Gh notifications@github.com wrote:
@jonparrott https://github.com/jonparrott can you link the PR that
resolved this ?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/GoogleCloudPlatform/getting-started-python/issues/50#issuecomment-316811571,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAPUc9ytdRMazjqFgLcIhOzBYh1pyjgBks5sP6_lgaJpZM4IJUKk
.
then how can anyone confirm that this issue has been fixed?
We can confirm by checking the revision history on our internal VCS where there is an update to the documentation page to include enabling the datastore API.
so you did the documentation step by step and confirm now it works?
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.
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()
if you agree, I will make a PR for this issue.
Most helpful comment
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.