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

Local Datastore problems since version 0.30.0 #1220

Closed
susanlinsfu opened this issue Apr 9, 2016 · 11 comments
Closed

Local Datastore problems since version 0.30.0 #1220

susanlinsfu opened this issue Apr 9, 2016 · 11 comments
Assignees
Labels
api: datastore Issues related to the Datastore API. type: question Request for information or clarification. Not an issue.

Comments

@susanlinsfu
Copy link

Using a version prior to version 0.30.0 everything worked. This is how I would insert a record into my local datastore:

var projectId = process.env.DATASTORE_PROJECT_ID;
var host = process.env.DATASTORE_EMULATOR_HOST;
var gcloud = require('gcloud');

var datastore = gcloud.datastore;
var dataset = datastore.dataset({
  projectId: projectId,
  apiEndpoint: host
});

var key = dataset.key('Company');
dataset.save({
  key: key,
  data: {
    rating: '10'
  }
}, function(err) {
  console.log(key.path); // [ 'Company', 5669468231434240 ]
  console.log(key.namespace); // undefined
});

The record would show up in the datastore.

I then updated to version 0.30.0 (tried also the newest and the same issue occurred). When I try to connect and insert/get (any operation) an entity I am unable to. I get the following error from my nodejs console:

E0408 22:51:33.856966404 39870 parsing.c:472] Unknown frame type 50

The code I am using to insert records for 0.30.0+ is:

var projectId = process.env.DATASTORE_PROJECT_ID;
var host = process.env.DATASTORE_EMULATOR_HOST;

var gcloud = require('gcloud')({
  projectId: projectId
});

var datastore = gcloud.datastore({
    apiEndpoint: host
});

var key = datastore.key('Company');
datastore.save({
  key: key,
  data: {
    rating: '10'
  }
}, function(err) {
  console.log(key.path); // [ 'Company', 5669468231434240 ]
  console.log(key.namespace); // undefined
});  

My local datastore was installed today using the command gcloud components install gcd-eumulator so it is the version as of April/8th/2016.

I tried this on two separate environments (Ubuntu 15.04 and Windows 10) and the same error was occurring for environments.

@susanlinsfu susanlinsfu changed the title Local Data store problems since version 0.30.0 Local Datastore problems since version 0.30.0 Apr 9, 2016
@stephenplusplus
Copy link
Contributor

See the Important things section from the release notes.

@pcostell is there any documentation around using the gcd.sh emulator?

@stephenplusplus stephenplusplus added type: question Request for information or clarification. Not an issue. api: datastore Issues related to the Datastore API. labels Apr 9, 2016
@dhermes
Copy link
Contributor

dhermes commented Apr 9, 2016

We just went through this in gcloud-python. The issue is the path contains an extra datastore. I'm AFK but will try to get you the PR where I fixed it

@dhermes
Copy link
Contributor

dhermes commented Apr 9, 2016

@stephenplusplus
Copy link
Contributor

Oh, cool. Thanks! Will this work with the gcloud SDK emulator or is the gcd.sh still required?

@pcostell
Copy link
Contributor

pcostell commented Apr 9, 2016

IIRC, node uses gRPC, right?

gRPC is not built into the emulator that ships with the gcloud command line
tool. I'm working on getting all of this fixed, but until then people can
use a special gRPC only gcd.sh tool:
https://storage.googleapis.com/gcd/tools/gcd-grpc-1.0.0.zip

On Sat, Apr 9, 2016, 7:57 AM Stephen Sawchuk [email protected]
wrote:

Oh, cool. Thanks! Will this work with the gcloud SDK emulator or is the
gcd.sh still required?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#1220 (comment)

@stephenplusplus
Copy link
Contributor

We do use gRPC, yes. I was just wondering if there was any documentation that we can point folks to after they download the .sh file.

@pcostell
Copy link
Contributor

pcostell commented Apr 9, 2016

Ah sorry didn't see the important not sections. You still need the special
tool, but you shouldn't have to mess with the path like anyone using
proto-over-http.

Sorry, we are working on either better docs and getting it into gcloud CLI,
but it is moving slower than expected.

On Sat, Apr 9, 2016, 9:03 AM Patrick Costello [email protected] wrote:

IIRC, node uses gRPC, right?

gRPC is not built into the emulator that ships with the gcloud command
line tool. I'm working on getting all of this fixed, but until then people
can use a special gRPC only gcd.sh tool:
https://storage.googleapis.com/gcd/tools/gcd-grpc-1.0.0.zip

On Sat, Apr 9, 2016, 7:57 AM Stephen Sawchuk [email protected]
wrote:

Oh, cool. Thanks! Will this work with the gcloud SDK emulator or is the
gcd.sh still required?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#1220 (comment)

@stephenplusplus
Copy link
Contributor

No problem, thanks for clarifying.

@susanlinsfu I'm going to close the issue, but if you run into any issues using the gcd.sh emulator, feel free to ask any questions here.

@susanlinsfu
Copy link
Author

Thanks. I got it running with gcd.sh tool and it is working now, but noticed there is no admin tool? I ran http://localhost:8080/_ah/admin and nothing was found. Does the admin console exist with this tool?

Cheers

@pcostell
Copy link
Contributor

pcostell commented Apr 9, 2016

Unfortunately it does not yet have an admin page.

If you need it, you can turn off gcd then point the version of gcd in the
emulator against your directory and use that viewer. They share the same
underlying data storage system, but you shouldn't run them at the same time
as they will likely try to over we rite each other.

Some technical background: the old gcd.sh tool (and in fact the production
v1beta2 system) was built on top of App Engine. Because of this, we were
able to just expose the App Engine local development admin console that you
could use to access your Datastore. The new version of gch.sh is a complete
rewrite, which means it should be much smaller and faster than the old
version (which needed most of the App Engine sdk to run). But it also means
we also need to rewrite these admin features.
-Patrick

On Sat, Apr 9, 2016, 9:39 AM susanlinsfu [email protected] wrote:

Thanks. I got it running with gcd.sh tool and it is working now, but
noticed there is no admin tool? I ran http://localhost:8080/_ah/admin and
nothing was found. Does the admin console exist with this tool?

Cheers


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#1220 (comment)

@susanlinsfu
Copy link
Author

Thank you for the explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

4 participants