-
Notifications
You must be signed in to change notification settings - Fork 370
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
Latest release of the SDK does not work with Google Datastore emulator #5365
Comments
Thanks for reporting this. I'll look into it on Monday. |
Thanks @jskeet. Looked into this further. Seems like it's not using Http/2 when connecting to the emulator. The following workaround seems to work for me. private DatastoreDb BuildDateDatastoreDbForProduction() =>
new DatastoreDbBuilder
{
ProjectId = _identityStoreConfiguration.ProjectId,
EmulatorDetection = _identityStoreConfiguration.EmulatorDetection
}.Build();
private DatastoreDb BuildDatastoreDbForLocalEmulator()
{
return DatastoreDb.Create(_identityStoreConfiguration.ProjectId, string.Empty, new DatastoreClientImpl(
new Datastore.DatastoreClient(
new Channel(endpoint[0], int.Parse(endpoint[1]), ChannelCredentials.Insecure)),
new DatastoreSettings()));
} May provide a hint. Will have a look through the code in this repo as well. Sorry, just been lazy about it. Looks like it's just the builder that needs fixing. |
It should absolutely be using gRPC (and therefore HTTP 2) talking to the emulator. I'm hoping it'll be easy to sort out on Monday. |
Just starting to investigate this now. That's not a way I've used for starting the emulator before - I've always used the approach documented here. Please could you let me know what your DATASTORE_EMULATOR_HOST and DATASTORE_PROJECT_ID environment variables are set to? |
Okay, I've reproduced the error with the code below, with the following steps:
Code: using Google.Api.Gax;
using Google.Cloud.Datastore.V1;
using System;
namespace Issue5365
{
class Program
{
static void Main()
{
var db = new DatastoreDbBuilder
{
EmulatorDetection = EmulatorDetection.EmulatorOnly,
ProjectId = "Test",
}.Build();
var key = db.CreateKeyFactory("test").CreateKey(1L);
var result = db.Lookup(key);
Console.WriteLine("Test complete");
}
}
} Looking further now. |
Okay, I've got it now - we weren't setting the credentials. This is a pleasantly-trivial fix - I hope to be able to get a fix created very soon, and then a release shortly afterwards. |
Changes in this release: - [Commit 0790924](googleapis@0790924): fix: Add gRPC compatibility constructors - [Commit a009b4b](googleapis@a009b4b): fix: Specify insecure credentials when connecting to the emulator. Fixes [issue 5365](googleapis#5365). - [Commit 0ca05f5](googleapis@0ca05f5): feat: Regenerate all APIs using protoc 3.13 and Grpc.Tools 2.31 - [Commit 6bde7a3](googleapis@6bde7a3): docs: Regenerate all APIs with service comments in client documentation - [Commit f83bdf1](googleapis@f83bdf1): fix: Regenerate all APIs with proper timeout handling - [Commit 42b9797](googleapis@42b9797): chore: set Ruby namespace in proto options - [Commit 947a573](googleapis@947a573): docs: Regenerate all clients with more explicit documentation - [Commit 03279b9](googleapis@03279b9): docs: Fix documentation for string_value. The value does not have to be at least 1MB, but rather, at most 1MB.
Changes in this release: - [Commit 0790924](0790924): fix: Add gRPC compatibility constructors - [Commit a009b4b](a009b4b): fix: Specify insecure credentials when connecting to the emulator. Fixes [issue 5365](#5365). - [Commit 0ca05f5](0ca05f5): feat: Regenerate all APIs using protoc 3.13 and Grpc.Tools 2.31 - [Commit 6bde7a3](6bde7a3): docs: Regenerate all APIs with service comments in client documentation - [Commit f83bdf1](f83bdf1): fix: Regenerate all APIs with proper timeout handling - [Commit 42b9797](42b9797): chore: set Ruby namespace in proto options - [Commit 947a573](947a573): docs: Regenerate all clients with more explicit documentation - [Commit 03279b9](03279b9): docs: Fix documentation for string_value. The value does not have to be at least 1MB, but rather, at most 1MB.
This has been released as part of Google.Cloud.Datastore.V1 version 3.1.0 - please let me know if you still have any problems with it. |
Environment details
Steps to reproduce
Fails with:
Now, this is the odd bit. If I
downgrade
to the older version of the SDK i.e.Google.Cloud.Datastore.V1 2.2.0
, it all works fine. I am using the latest GCloud SDK/emulator. Tried with an older version of the SDK, does not work. This is definitely broken in the latest version of the SDK.Please help.
The text was updated successfully, but these errors were encountered: