Skip to content

storage: Followed the simple storage example and keep getting an error #71

Description

@shacharz
  1. Enabled the storage api and storage json api
  2. Created the json private key
  3. var gcloud = require('gcloud'),
    bucket = new gcloud.storage.Bucket({
    bucketName: 'BUCKET_NAME',
    keyFilename: 'path/to/key.json'
    });

And tried different methods:
bucket.list(function(err, files, nextQuery) {
// if more results, nextQuery will be non-null.
console.log("callback returned");
});

//
//bucket.writeBuffer("testLog.txt", { data: 'Hello World' }, function(err){
// console.log("callback returned");
//});

All return with "getaddrinfo ENOTFOUND" message

Activity

  1. self-assigned this
    on Jul 31, 2014
  2. silvolu commented on Jul 31, 2014

    @silvolu
    Contributor

    Looking at it.

  3. silvolu commented on Jul 31, 2014

    @silvolu
    Contributor

    I think the problem is that the path to the key is invalid, @shacharz can you update to 0.1.0 and try again? You should get a less cryptic error. Note that the interfaces to write to storage change in 0.1.0, so instead of bucket.writeBuffer("testLog.txt", { data: 'Hello World' }, callback) you should use bucket.write("testLog.txt", { data: 'Hello World' }, callback).

  4. rakyll commented on Jul 31, 2014

    @rakyll
    Contributor

    It seems like you're depending on 0.0.5 which used to require a pem key and service account email. The auth falls back to Compute Engine's metaserver to retrieve an access token and errors while resolving the name.

    Upgrade to 0.1.0 to be able to use keyFilename.

  5. shacharz commented on Aug 3, 2014

    @shacharz
    Author

    Reinstalled gCloud, this time the npm is updated to 0.1.0.
    The error was indeed less cryptic, path to key was invalid (directory separators need to be '' and not '').
    Thanks

  6. added
    api: storageIssues related to the Cloud Storage API.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Feb 2, 2015
  7. added this to the Storage Stable milestone on Feb 2, 2015
  8. 72 remaining items

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

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.api: storageIssues related to the Cloud Storage API.triage 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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions