0

Google Cloud PlatformにデータベースとしてFireStoreを使用するアプリケーションがあります。プロジェクトが存在しないか、アクティブクラウドデータストアが含まれていません

FireStoreにレコードを挿入しようとするとこのエラーが発生します。

google.api_core.exceptions.NotFound: 404 The project "book-shop-c73ec" does not 
exist or it does not contain an active Cloud Datastore database. Please visit ht 
tp://console.cloud.google.com to create a project or https://console.cloud.googl 
e.com/datastore/setup?project="book-shop-c73ec" to add a Cloud Datastore databas 
e. Note that Cloud Datastore always has an associated App Engine app and this ap 
p must not be disabled. 

これは私が使用しているサンプルコードです。

from google.cloud import firestore 

# Add a new document 
db = firestore.Client() 
doc_ref = db.collection(u'users').document(u'alovelace') 
doc_ref.set({ 
    u'first': u'Ada', 
    u'last': u'Lovelace', 
    u'born': 1815 
}) 

# Then query for documents 
users_ref = db.collection(u'users') 
docs = users_ref.get() 

for doc in docs: 
    print(u'{} => {}'.format(doc.id, doc.to_dict())) 

私のアプリケーションは、App Engineの上で有効になっている:

enter image description here

そして、私はデータストア]タブに移動したときに、私はFireStoreを指摘しています。

enter image description here

私はここに任意のステップを逃しましたか?

見つけたlinkしかし、私がすでに行ったアプリエンジンでアプリを有効にすることを提案しているだけです。

答えて

0

Windows上の自分の環境変数でエラーに過ぎませんでした。

私の代わりに

set GCLOUD_PROJECT="project-name" 

set GCLOUD_PROJECT=project-name 
にそれを設定していました
関連する問題