Skip to content

Cannot Deploy #3151

Closed
Closed

Description

@erikerikson

This is a Bug Report

Description

PR #3125 broke our ability to deploy. The root issue is that we do not have rights to iam:GetUser (and actually don't have users at all) (concretely, we have an explicit deny on "iam:*User*"). This means that the call fails and we cannot deploy.

For bug reports:

  • What went wrong?

Issued sls deploy
Error <role>/AWSCodeBuild is not authorized to perform: iam:GetUser on resource: arn:aws:sts::<account-id>:assumed-role/<role>/AWSCodeBuild observed.

  • What did you expect should have happened?

Successful deploy

[Container] 2017/01/27 01:00:49 Deploying Retail Stream in /tmp/src[...]/src/retail-stream
<sls deploy -s ${STAGE}>
[Container] 2017/01/27 01:00:51 Serverless: Packaging service...
[Container] 2017/01/27 01:00:51 Serverless: Uploading CloudFormation file to S3...
[Container] 2017/01/27 01:00:51 Serverless: Uploading service .zip file to S3 (175.58 KB)...
[Container] 2017/01/27 01:00:51 Serverless: Updating Stack...
[Container] 2017/01/27 01:00:52
[Container] 2017/01/27 01:00:52
Serverless Error ---------------------------------------
[Container] 2017/01/27 01:00:52
[Container] 2017/01/27 01:00:52
Stack Trace --------------------------------------------
arn:aws:sts::<account-id>:assumed-role/code-bui
[Container] 2017/01/27 01:00:52
Stack Trace --------------------------------------------
[Container] 2017/01/27 01:00:52 arn:aws:sts::<account-id>:assumed-role/<role>/AWSCodeBuild
[Container] 2017/01/27 01:00:52 o
[Container] 2017/01/27 01:00:52 Get Support --------------------------------------------
[Container] 2017/01/27 01:00:52
[Container] 2017/01/27 01:00:52 Bugs: github.com/serverless/serverless/issues
<role>/AWSCodeBuild is not authorized to perform: iam:GetUser on resource: arn:aws:sts::<account-id>:assumed-role/<role>/AWSCodeBuild
[Container] 2017/01/27 01:00:52 at Response.<anonymous> (/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:162:20)
[Container] 2017/01/27 01:00:52 at Request.<anonymous> (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:355:18)
[Container] 2017/01/27 01:00:52 at Request.callListeners (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
[Container] 2017/01/27 01:00:52 at Request.emit (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
[Container] 2017/01/27 01:00:52 at Request.emit (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:668:14)
[Container] 2017/01/27 01:00:52 at Request.transition (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:22:10)
[Container] 2017/01/27 01:00:52 at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/state_machine.js:14:12)
[Container] 2017/01/27 01:00:52 at /usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/state_machine.js:26:10
[Container] 2017/01/27 01:00:52 at Request.<anonymous> (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:38:9)
[Container] 2017/01/27 01:00:52 at Request.<anonymous> (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:670:12)
[Container] 2017/01/27 01:00:52 at Request.callListeners (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
[Container] 2017/01/27 01:00:52 at Request.emit (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
[Container] 2017/01/27 01:00:52 at Request.emit (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:668:14)
[Container] 2017/01/27 01:00:52 at Request.transition (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:22:10)
[Container] 2017/01/27 01:00:52 at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/state_machine.js:14:12)
[Container] 2017/01/27 01:00:52 at /usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/state_machine.js:26:10
[Container] 2017/01/27 01:00:52 From previous event:
[Container] 2017/01/27 01:00:52 at /usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:150:14
[Container] 2017/01/27 01:00:52 at doCall (/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:129:9)
[Container] 2017/01/27 01:00:52 at /usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:140:14
[Container] 2017/01/27 01:00:52 From previous event:
[Container] 2017/01/27 01:00:52 at BbPromise (/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:127:38)
[Container] 2017/01/27 01:00:52 at AwsProvider.request (/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:143:12)
[Container] 2017/01/27 01:00:52 at AwsProvider.getAccountId (/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:230:17)
[Container] 2017/01/27 01:00:52 at /usr/local/lib/node_modules/serverless/lib/plugins/aws/info/getStackInfo.js:48:31
[Container] 2017/01/27 01:00:52 From previous event:
[Container] 2017/01/27 01:00:52 at AwsInfo.getStackInfo (/usr/local/lib/node_modules/serverless/lib/plugins/aws/info/getStackInfo.js:48:6)
[Container] 2017/01/27 01:00:52 From previous event:
[Container] 2017/01/27 01:00:52 at AwsInfo.<anonymous> (/usr/local/lib/node_modules/serverless/lib/plugins/aws/info/index.js:36:14)
[Container] 2017/01/27 01:00:52 From previous event:
[Container] 2017/01/27 01:00:52 at AwsInfo.hooks.deploy:deploy (/usr/local/lib/node_modules/serverless/lib/plugins/aws/info/index.js:30:10)
[Container] 2017/01/27 01:00:52 at /usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:160:50
[Container] 2017/01/27 01:00:52 at processImmediate [as _immediateCallback] (timers.js:383:17)
[Container] 2017/01/27 01:00:52 From previous event:
[Container] 2017/01/27 01:00:52 at PluginManager.run (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:160:22)
[Container] 2017/01/27 01:00:52 at Serverless.run (/usr/local/lib/node_modules/serverless/lib/Serverless.js:91:31)
[Container] 2017/01/27 01:00:52 at /usr/local/lib/node_modules/serverless/bin/serverless:21:50

Additional Data

  • Serverless Framework Version you're using: Serverless Version: 1.5.1
  • Operating System: Ubuntu (AWS CodeBuild "NodeJs 4.3.2" Build)
  • Stack Trace: above
  • Provider Error messages: above

Activity

  1. erikerikson commented on Jan 27, 2017

    @erikerikson
    ContributorAuthor

    FWIW, we can successfully obtain the Account ID by executing the following:
    aws sts get-caller-identity --output text --query 'Account'

  2. added this to the 1.6 milestone on Jan 27, 2017
  3. pmuens commented on Jan 27, 2017

    @pmuens
    Contributor

    Hey @erikerikson thank you very much for this detailed description and the fix (will look into it next up).

    Glad to have the fix in place before the next release which will prevent many deployments from breaking! 💪 💥

    P.S. I'll PR a fix soon which removes the whole arn displaying in the info plugin ("Just in case...")

  4. pmuens commented on Jan 27, 2017

    @pmuens
    Contributor

    Should be resolved because #3152 was merged.

  5. erikerikson commented on Jan 27, 2017

    @erikerikson
    ContributorAuthor

    Thank you so much for jumping on this and getting it through!

  6. pmuens commented on Jan 28, 2017

    @pmuens
    Contributor

    Thanks for fixing this right away @erikerikson! 💯 👍

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions