Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FirestoreAdminClient with emulator #941

Open
pgridharan opened this issue Jul 24, 2024 · 2 comments
Open

FirestoreAdminClient with emulator #941

pgridharan opened this issue Jul 24, 2024 · 2 comments
Assignees
Labels
api: firestore Issues related to the googleapis/python-firestore API.

Comments

@pgridharan
Copy link

pgridharan commented Jul 24, 2024

Hi,

I'm not sure if this is a bug or not a feature, but using the FirestoreAdminClient with the emulator does not work 😅

Environment details

  • OS type and version: MacOS 14.5 with Docker 26.1.4, Compose v2.27.1-desktop.1, Docker Desktop 4.31.0
  • Python version: Python 3.11.9
  • pip version: pip 24.0 from /usr/local/lib/python3.11/site-packages/pip (python 3.11)
  • google-cloud-firestore version: 2.17.0

Steps to reproduce

  1. Set FIRESTORE_EMULATOR_HOST
  2. Use FirestoreAdminClient instance

Code example

FIRESTORE_EMULATOR_HOST=0.0.0.0:8080
load_dotenv()

print(os.getenv("FIRESTORE_EMULATOR_HOST"))                # Will print `0.0.0.0:8080`
admin_client = FirestoreAdminClient()
request = firestore_admin_v1.types.ListDatabasesRequest(
    parent=f"projects/test-project",
)
client.list_databases(request=request)                     # This should not matter since the emulator only supports one project AFAIK

Stack trace

google.api_core.exceptions.PermissionDenied: 403 Cloud Firestore API has not been used in project test-project before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/firestore.googleapis.com/overview?project=test-project then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/python-firestore API. label Jul 24, 2024
@tom-andersen
Copy link

Thank you for the question. I am going to find someone with more Python knowledge to answer.

@pgridharan
Copy link
Author

Is there any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/python-firestore API.
Projects
None yet
Development

No branches or pull requests

3 participants