You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm migrating from the datastore-emulator to the firestore-emulator, for local development with Google Appengine. I need to reset the database between tests. To do it, I'm making a DELETE request (per the documentation) to the URI: http://HOST:PORT/emulator/v1/projects/PROJECT_ID/databases/(default)/documents. But that request is failing, with the emulator complaining the database is not set to Firestore Mode.
[REQUIRED] Environment info
firebase-tools: Not using firebase-tools, using cloud-firestore-emulator via gcloud CLI.
Your current Google Cloud CLI version is: 469.0.0
The latest available version is: 469.0.0
I've tried different project names, as well as "default".
[REQUIRED] Expected behavior
I expect it to clear the database for whatever project is specified, returning with a 200 OK message.
[REQUIRED] Actual behavior
I get the error:
[firestore] INFO: Exception when handling request: INVALID_ARGUMENT: Database mode not set to Firestore Mode. If using the gCloud CLI, please specify the --database-mode flag.
And the stack trace:
[firestore] INFO: Detected non-HTTP/2 connection.
[firestore] Mar 21, 2024 2:35:03 PM com.google.cloud.datastore.emulator.impl.util.WrappedStreamObserver onError
[firestore] WARNING: Operation failed: Database mode not set to Firestore Mode. If using the gCloud CLI, please specify the --database-mode flag.
[firestore] com.google.cloud.datastore.core.exception.ValidationException: Database mode not set to Firestore Mode. If using the gCloud CLI, please specify the --database-mode flag.
[firestore] at com.google.cloud.datastore.core.exception.ValidationException.validateAssertion(ValidationException.java:50)
[firestore] at com.google.cloud.datastore.emulator.impl.firestore.CloudFirestoreV1Router.getOrCreateBackend(CloudFirestoreV1Router.java:381)
[firestore] at com.google.cloud.datastore.emulator.impl.firestore.CloudFirestoreV1Router.clearData(CloudFirestoreV1Router.java:239)
[firestore] at com.google.cloud.datastore.emulator.firestore.EmulatorAuxiliaryGrpcAdapter$1.lambda$clearData$2(EmulatorAuxiliaryGrpcAdapter.java:91)
[firestore] at com.google.cloud.datastore.emulator.firestore.EmulatorAuxiliaryGrpcAdapter.unary(EmulatorAuxiliaryGrpcAdapter.java:52)
[firestore] at com.google.cloud.datastore.emulator.firestore.EmulatorAuxiliaryGrpcAdapter$1.clearData(EmulatorAuxiliaryGrpcAdapter.java:88)
[firestore] at com.google.firestore.emulator.v1.FirestoreEmulatorGrpc$MethodHandlers.invoke(FirestoreEmulatorGrpc.java:714)
[firestore] at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:182)
[firestore] at io.grpc.PartialForwardingServerCallListener.onHalfClose(PartialForwardingServerCallListener.java:35)
[firestore] at io.grpc.ForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:23)
[firestore] at io.grpc.ForwardingServerCallListener$SimpleForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:40)
[firestore] at io.grpc.Contexts$ContextualizedServerCallListener.onHalfClose(Contexts.java:86)
[firestore] at io.grpc.PartialForwardingServerCallListener.onHalfClose(PartialForwardingServerCallListener.java:35)
[firestore] at io.grpc.ForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:23)
[firestore] at io.grpc.ForwardingServerCallListener$SimpleForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:40)
[firestore] at io.grpc.Contexts$ContextualizedServerCallListener.onHalfClose(Contexts.java:86)
[firestore] at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:351)
[firestore] at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:861)
[firestore] at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
[firestore] at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
[firestore] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
[firestore] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
[firestore] at java.base/java.lang.Thread.run(Thread.java:1583)
[firestore]
[firestore] Mar 21, 2024 2:35:03 PM io.gapi.emulators.netty.HttpHandler$1 onError
[firestore] INFO: Exception when handling request: INVALID_ARGUMENT: Database mode not set to Firestore Mode. If using the gCloud CLI, please specify the --database-mode flag.```
The text was updated successfully, but these errors were encountered:
That said you'll notice that currently it is lacking a reset endpoint but good news is the next release of the emulator will add support for this! Please keep an eye out on the Datastore Mode emulator documentation for updates as well, thanks!
I'm migrating from the datastore-emulator to the firestore-emulator, for local development with Google Appengine. I need to reset the database between tests. To do it, I'm making a DELETE request (per the documentation) to the URI:
http://HOST:PORT/emulator/v1/projects/PROJECT_ID/databases/(default)/documents
. But that request is failing, with the emulator complaining the database is not set to Firestore Mode.[REQUIRED] Environment info
firebase-tools: Not using firebase-tools, using cloud-firestore-emulator via gcloud CLI.
Your current Google Cloud CLI version is: 469.0.0
The latest available version is: 469.0.0
...
│ Installed │ Cloud Datastore Emulator │ cloud-datastore-emulator │ 36.2 MiB │
│ Installed │ Cloud Firestore Emulator │ cloud-firestore-emulator │ 44.5 MiB │
...
Platform: macOS Version 14.3.1 (23D60)
[REQUIRED] Test case
Be able to clear the database when running in datastore mode
[REQUIRED] Steps to reproduce
I am starting the firestore emulator (in datastore-mode) with this CLI command (per the documentation):
make the curl request:
I've tried different project names, as well as "default".
[REQUIRED] Expected behavior
I expect it to clear the database for whatever project is specified, returning with a 200 OK message.
[REQUIRED] Actual behavior
I get the error:
[firestore] INFO: Exception when handling request: INVALID_ARGUMENT: Database mode not set to Firestore Mode. If using the gCloud CLI, please specify the --database-mode flag.
And the stack trace:
The text was updated successfully, but these errors were encountered: