{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/337","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/337/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/337/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/337/events","html_url":"https://github.com/GoogleCloudPlatform/gcloud-golang/issues/337","id":174315681,"number":337,"title":"datastore: GetAll is terminated by RST_STREAM","user":{"login":"andrewladd","id":8398247,"avatar_url":"https://avatars.githubusercontent.com/u/8398247?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewladd","html_url":"https://github.com/andrewladd","followers_url":"https://api.github.com/users/andrewladd/followers","following_url":"https://api.github.com/users/andrewladd/following{/other_user}","gists_url":"https://api.github.com/users/andrewladd/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewladd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewladd/subscriptions","organizations_url":"https://api.github.com/users/andrewladd/orgs","repos_url":"https://api.github.com/users/andrewladd/repos","events_url":"https://api.github.com/users/andrewladd/events{/privacy}","received_events_url":"https://api.github.com/users/andrewladd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-08-31T16:14:14Z","updated_at":"2016-09-01T21:06:04Z","closed_at":null,"body":"Good afternoon, \r\n\r\nWhen trying to use datastore.Client.GetAll in production (ie communicating with Google Datastore rather than an emulator), I receive this message: \r\n\r\n`rpc error: code = 13 desc = stream terminated by RST_STREAM with error code: 2`\r\n\r\nThe context in which I'm using the function is simple: return a list of entities that are stored under a known parent, and sort them by an integer. Here's my code: \r\n\r\n```\r\nHistory struct {\r\n    Id string\r\n}\r\n\r\nEntry struct {\r\n\tPosition    float64\r\n\tState       string\r\n\tPatchTime   float64\r\n}\r\n\r\nfunc dbGetChatHistory(id string, ctx context.Context, client *datastore.Client) ([]*Entry, AppErr) {\r\n\r\n\thistoryKey := datastore.NewKey(ctx, \"History\", id, 0, nil)\r\n\r\n\tentries := []*Entry{}\r\n\r\n\tq := datastore.NewQuery(\"Entry\").\r\n\t\tAncestor(historyKey).\r\n\t\tOrder(\"-PatchTime\")\r\n\r\n\t_, err := client.GetAll(ctx, q, &entries)\r\n\tif err != nil {\r\n\t\tlog.Panicf(\"Error has occured while getting history: %s\", err)\r\n\t\treturn []*Entry{}, AppErr {\r\n\t\t\tCode: 500,\r\n\t\t\tMsg: \"Error has occured while getting history\",\r\n\t\t}\r\n\t}\r\n\r\n\treturn entries, AppErr{}\r\n}\r\n```\r\nI've tried running this query within a transaction (which I don't think is necessary, as this is an ancestor query), as well as setting up the `entries` array a few different ways (ie using `make` to allocate space, using `var entires []*Entry', etc). \r\n\r\nThe weirdest part about this whole thing is that it works with the provided emulator; while on my machine, I'm able to use GetAll freely. However, while running this on Google Container Engine, communicating with Datastore, it fails. \r\n\r\nWhat could I be missing? Is this a problem with DataStore?"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/comments/244212408","html_url":"https://github.com/GoogleCloudPlatform/gcloud-golang/issues/337#issuecomment-244212408","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/337","id":244212408,"user":{"login":"andrewladd","id":8398247,"avatar_url":"https://avatars.githubusercontent.com/u/8398247?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewladd","html_url":"https://github.com/andrewladd","followers_url":"https://api.github.com/users/andrewladd/followers","following_url":"https://api.github.com/users/andrewladd/following{/other_user}","gists_url":"https://api.github.com/users/andrewladd/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewladd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewladd/subscriptions","organizations_url":"https://api.github.com/users/andrewladd/orgs","repos_url":"https://api.github.com/users/andrewladd/repos","events_url":"https://api.github.com/users/andrewladd/events{/privacy}","received_events_url":"https://api.github.com/users/andrewladd/received_events","type":"User","site_admin":false},"created_at":"2016-09-01T21:06:04Z","updated_at":"2016-09-01T21:06:04Z","body":"@okdave Yep! Here's where I set up the context and client objects, where `env` is gathered as an environment variable and `projId` is just a placeholder: \r\n\r\n```\r\nctx := context.Background()\r\nctx = datastore.WithNamespace(ctx, env)\r\nclient, err := datastore.NewClient(ctx, projId)\r\n```\r\nThese get passed down into my router, and in turn into the functions that communicate with the database.\r\n\r\nThe only difference should be the `env` variable; everything else is consistent.  "}}
{"actor":{"display_login":"andrewladd"}}