GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Error: Missing key, key or keyFile option must be provided! · Issue #261 · googleapis/google-cloud-node

Error: Missing key, key or keyFile option must be provided! #261

New issue
Copy link
New issue
Copy link
Closed
Closed
Error: Missing key, key or keyFile option must be provided!#261
Copy link
Assignees
stephenplusplus
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.
Milestone
Storage Stable

Description

@Lordink
Lordink
opened on Oct 17, 2014
Issue body actions

While using gcloud on my own local server, I write:

var gcloud = require('gcloud');
var bucket;

bucket = gcloud.storage.bucket({
    projectId: 'myProjectName',
    keyFilename: 'resources/key.json',
    bucketName: 'testnameorwhatever'
});

bucket.write('demo.txt', 'Hello World', function(err) {
        var stuff = err || 'Created demo.txt'
        console.log(stuff);
});

if I do specify the right path to the key, it gives this output (not thrown error, just console log):
[Error: Missing key, key or keyFile option must be provided!]
I do not understand this message. There is a key specified, and the path to it is right. I know that, as if I write the wrong keyFilename path, it throws ENOENT error 34. So, is it about the key description or something?

Activity

Next
  1. stephenplusplus commented on Oct 17, 2014

    @stephenplusplus
    stephenplusplus
    on Oct 17, 2014
    Contributor
    More actions

    Which version of gcloud-node are you using?

  2. Lordink commented on Oct 17, 2014

    @Lordink
    Lordink
    on Oct 17, 2014
    Author
    More actions

    the latest one, I guess. 0.8.1

  3. stephenplusplus commented on Oct 17, 2014

    @stephenplusplus
    stephenplusplus
    on Oct 17, 2014
    Contributor
    More actions

    Can you verify that in yourproject/node_modules/gcloud-node/package.json? :)

  4. Lordink commented on Oct 17, 2014

    @Lordink
    Lordink
    on Oct 17, 2014
    Author
    More actions

    Yeah, here is a fraction of it:

    {
      "name": "gcloud",
      "version": "0.8.1",
      "author": {
        "name": "Google Inc."
      },
      "description": "Google Cloud APIs Client Library for Node.js",
    ...
  5. stephenplusplus commented on Oct 17, 2014

    @stephenplusplus
    stephenplusplus
    on Oct 17, 2014
    Contributor
    More actions

    Thanks, I'll play around and try to find the 🐛

  6. Lordink commented on Oct 17, 2014

    @Lordink
    Lordink
    on Oct 17, 2014
    Author
    More actions

    Just in case I am dumb and use the wrong key, my key json has these fields in it:

    {"web":{"auth_uri":"https://accounts.google.com/o/oauth2/auth", "client_secret": ..., "token_uri":...

    and so on. Is that the right key? :)

  7. stephenplusplus commented on Oct 17, 2014

    @stephenplusplus
    stephenplusplus
    on Oct 17, 2014
    Contributor
    More actions

    Not dumb at all! There are a million things you can do in the Developers Console, it's very easy to get lost.

    I believe you are using a client ID for a webapp, where what we want is a service account. https://github.com/GoogleCloudPlatform/gcloud-node/#elsewhere step 4 should show how to do that.

    I'm going to close as I was able to reproduce the same error with a webapp key, and remedy it with a service key. If you run into anything else, ask away!

    Reacted by Emad Ehsan
  8. stephenplusplus
    closed this as completedon Oct 17, 2014
  9. ryanseys commented on Oct 17, 2014

    @ryanseys
    ryanseys
    on Oct 17, 2014
    Contributor
    More actions

    I'd say this issue comes down to a misunderstanding of the error message. The error itself is suggesting that a keyFile or key parameter should be specified, when really the error should suggest that they are likely using an invalid key file. Should we improve this err message?

    Reacted by Michael Prentice, Nikolai Stakheiko, Sed, Emad Ehsan and Saifoo Khan
    Reacted by Mike
  10. ryanseys commented on Oct 17, 2014

    @ryanseys
    ryanseys
    on Oct 17, 2014
    Contributor
    More actions

    Seems the error is created in gapitoken so we have no control over the error message, unless we do some of our own sanity checking when passing in the key / key file.

  11. thebergamo commented on Nov 5, 2014

    @thebergamo
    thebergamo
    on Nov 5, 2014
    More actions

    I'm try to use the same feature and I've the same error.

    Have a fix to this problem?

  12. stephenplusplus commented on Nov 5, 2014

    @stephenplusplus
    stephenplusplus
    on Nov 5, 2014
    Contributor
    More actions

    @marcacohen did you try #261 (comment)?

  13. thebergamo commented on Nov 5, 2014

    @thebergamo
    thebergamo
    on Nov 5, 2014
    More actions

    Nothing... I try to pass the client_email and the private_key manual, but I recive this error:

    12176:error:0906D06C:PEM routines:PEM_read_bio:no start line:openssl\crypto\pem\pem_lib.c:703:Expecting: ANY PRIVATE KEY

  14. stephenplusplus commented on Nov 5, 2014

    @stephenplusplus
    stephenplusplus
    on Nov 5, 2014
    Contributor
    More actions

    You generated a service account JSON key from the developer's console, and it looked like:

    {
      "private_key_id": "...",
      "private_key": "...",
      "client_email": "[email protected]",
      "client_id": "....apps.googleusercontent.com",
      "type": "service_account"
    }

    You instantiated gcloud like:

    require('gcloud')({
      credentials: {
        private_key: '...',
        client_email: '[email protected]'
      }
    });

    and got that error?

    More code that shows what you're doing and full stack traces would help me debug.

  15. thebergamo commented on Nov 5, 2014

    @thebergamo
    thebergamo
    on Nov 5, 2014
    More actions

    My JSON not is in this format.

    The private_key have only ~16 chars. I'm almost on madness to solve this problem. :(

  16. 57 remaining items

  17. sofisl
    added 2 commits that reference this issue on Feb 25, 2026

    refactor(ts): merge initial TypeScript conversion (#334)

    943b50c

    fix: drop support for node.js 4.x and 9.x (#261)

    f1f40b5
  18. codyoss
    added a commit that references this issue on Mar 5, 2026

    build: auto-approve renovate-bot PRs for minor updates (#1145) (#261)

    1b69f16
  19. sofisl
    added 2 commits that reference this issue on Mar 5, 2026

    build(tests): fix coveralls and enable build cop (#261)

    4d787a9

    build: add generated samples to .eslintignore (#261)

    ebd8a5e
  20. codyoss
    added 2 commits that reference this issue on Mar 9, 2026

    chore(deps): update dependency sinon to v10 (#261)

    ec65951

    chore(deps): update dependency sinon to v10 (#261)

    ab65d0b
  21. GautamSharda
    added 3 commits that reference this issue on Mar 11, 2026

    Fix the linter (#261)

    b50cee9

    chore(nodejs): remove api-extractor dependencies (#261)

    8246dc2

    chore(nodejs): remove api-extractor dependencies (#261)

    36ef236
  22. thiyaguk09
    added a commit that references this issue on Mar 18, 2026

    refactor(ts): merge initial TypeScript conversion (googleapis#334)

    03e06b0
  23. GautamSharda
    added 2 commits that reference this issue on Mar 23, 2026

    chore(deps): lock file maintenance (#261)

    1a04a3b

    chore(deps): lock file maintenance (#261)

    d0a43df
  24. shivanee-p
    added a commit that references this issue on Mar 27, 2026

    chore(deps): lock file maintenance (#261)

    7e85224
  25. thiyaguk09
    added a commit that references this issue on May 5, 2026

    chore(deps): lock file maintenance (googleapis#261)

    a8b0c9c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @stephenplusplus
    stephenplusplus

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

    Milestone

    • Storage Stable

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.