Skip to content

GAE + GCE support #210

Description

@stephenplusplus

GAE

GAE support is still underway so I'll leave this part out for now.

GCE

I created an instance:

$ gcloud compute instances create silliestcloud --scopes https://www.googleapis.com/auth/datastore https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/devstorage.full_control

And initiate gcloud like this:

var gcloud = require('gcloud');

var dataset = new gcloud.datastore.Dataset();
var bucket = new gcloud.storage.Bucket({
  bucketName: 'sillycloud'
});

When accessing a file from my bucket, everything goes smoothly. However, when trying to run a query on my dataset, I get a 403:

Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.

I'm able to retrieve a token without an issue, but still receive that error after making the request. Any idea if this is a problem with my project/account, or a problem with gcloud?

After reading Authenticating from Google Compute Engine, I saw a line:

When you create a Google Compute Engine project, Google Compute Engine also creates a service account for that project. This service account authenticates the project to other Google services but you can also use the service account to authenticate your instances to other APIs. This is ideal for cases when you have applications running within instances that need to programmatically talk between services but don't need access to user data.

Any chance our need for the userinfo.email scope could qualify for "user data"?

Activity

  1. proppy commented on Sep 15, 2014

    @proppy
    Contributor

    @stephenplusplus did you enable the Google Cloud Datastore API for your project?

  2. stephenplusplus commented on Sep 15, 2014

    @stephenplusplus
    ContributorAuthor

    Yes, and I should mention I've been getting this error for the last couple days, but at first I was able to access without any errors. It also works if I specify the credentials manually:

    new gcloud.datastore.Dataset({
      credentials: { /* contents of json key file */ }
    });
  3. silvolu commented on Sep 16, 2014

    @silvolu
    Contributor

    @stephenplusplus I now have a GCE instance running sillycloud, and I cannot reproduce your issue. I'll keep it around and monitor it for some days.

  4. stephenplusplus commented on Sep 16, 2014

    @stephenplusplus
    ContributorAuthor

    Hmm. Well, that's good to hear, since that means our GCE support wasn't compromised, but disappointing that I don't know how to fix.

    I wonder if you tried making a change to see if you can surpass the limit that I'm exceeding. If you want to run an experiment, pasting the below as the getUsers function (https://github.com/stephenplusplus/sillycloud/blob/master/actions.js#L10) should run the query once every 100 ms until it reaches 20 attempts (as written, feel free to change timesToRun and intervalMs).

    function getUsers(req, res) {
      var ran = 0;
      var timesToRun = 20;
      var intervalMs = 100;
      var query = dataset.createQuery(['Users']);
      var interval = setInterval(function() {
        if (++ran <= timesToRun) {
          dataset.runQuery(query, function(err, results) {
            if (ran === timesToRun) {
              _handleResponse(res)(err, results);
            }
          }
        } else {
          clearInterval(interval);
        }
      }, intervalMs);
    }

    Just an idea. I'm desperate to find a fix to this. Thanks for testing!

    // edit: if you know of a less abusive way to get to the same ends, that's probably better :)

  5. modified the milestone: on Sep 18, 2014
  6. stephenplusplus commented on Sep 21, 2014

    @stephenplusplus
    ContributorAuthor

    GCE resolved 👍

    GAE still being worked on in #233.

  7. added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Feb 2, 2015
  8. modified the milestones: Core Stable, on Feb 2, 2015
  9. 58 remaining items

  10. added a commit that references this issue on Mar 5, 2026
  11. added a commit that references this issue on Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

🚨This issue needs some love.coretriage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions