serverless-google-cloudfunctions icon indicating copy to clipboard operation
serverless-google-cloudfunctions copied to clipboard

Error on deploy: Invalid Credentials

Open casconed opened this issue 7 years ago • 3 comments

Attempting to deploy after following the quickstart:

Error: Invalid Credentials
    at createError (/Users/jmoore/Develop/serverless-messaging/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/Users/jmoore/Develop/serverless-messaging/node_modules/axios/lib/core/settle.js:18:12)
    at Unzip.handleStreamEnd (/Users/jmoore/Develop/serverless-messaging/node_modules/axios/lib/adapters/http.js:201:11)
    at emitNone (events.js:111:20)
    at Unzip.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:139:11)
    at process._tickDomainCallback (internal/process/next_tick.js:219:9)
From previous event:
    at PluginManager.invoke (/Users/jmoore/.npm-packages/lib/node_modules/serverless/lib/classes/PluginManager.js:391:22)
    at PluginManager.run (/Users/jmoore/.npm-packages/lib/node_modules/serverless/lib/classes/PluginManager.js:422:17)
    at variables.populateService.then.then (/Users/jmoore/.npm-packages/lib/node_modules/serverless/lib/Serverless.js:157:33)
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)
From previous event:
    at Serverless.run (/Users/jmoore/.npm-packages/lib/node_modules/serverless/lib/Serverless.js:144:8)
    at serverless.init.then (/Users/jmoore/.npm-packages/lib/node_modules/serverless/bin/serverless:44:28)
    at <anonymous>
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           8.14.0
     Serverless Version:     1.34.1

casconed avatar Dec 12 '18 01:12 casconed

Thanks for opening @casconed

Hmm, that's odd... 🤔. Could you post your serverless.yml here?

Thanks in advance

pmuens avatar Jan 02 '19 11:01 pmuens

Here you go @pmuens. Thanks for taking a look

service: gst # NOTE: Don't put the word "google" in here

provider:
  name: google
  runtime: nodejs
  project: serverless-messaging-staging
  # the path to the credentials file needs to be absolute
  credentials: /Users/jmoore/.gcloud/serverless-messaging-staging-caed4a1957d7.json

plugins:
  - serverless-google-cloudfunctions

# needs more granular excluding in production as only the serverless provider npm
# package should be excluded (and not the whole node_modules directory)
package:
  exclude:
    - node_modules/**
    - .gitignore
    - .git/**

functions:
  first:
    handler: http
    events:
      - http: path

casconed avatar Jan 02 '19 14:01 casconed

Thanks for providing more information @casconed 👍

Your serverless.yml file looks fine 🤔

After reading more about authentication ad Googles end it looks like the services cannot be accessed via the SDK which the plugins uses behind the scenes.

We've merged a doc update which proposes to lock down the role requirements. You can find it here --> https://github.com/serverless/serverless/pull/5490

Previously we've proposed to set the Project role to "Owner". Maybe the current credentials setup is too locked down and updating the role to "owner" fixes the problem.

pmuens avatar Jan 03 '19 09:01 pmuens