Skip to content

Must specify userName when calling with non-User credentials #3140

Closed

Description

@paulSambolin

This is a Bug Report

Description

We are deploying serverless from AWS Codebuild and with the most recent update the deployment fails with the error Must specify userName when calling with non-User credentials

Fixing the package @1.5.0 fixes the issue and at first glance I think #3070 might have caused the issue since Codebuild uses Docker images in the background but I have not dug enough to figure out the root of it. Deploying from our Docker images still works on v1.5.1, this issue is only affecting our Codebuild deployments.

StackTrace and Error (apologies for the codebuild output format)

20:25:29 Must specify userName when calling with non-User credentials

20:25:29 Stack Trace --------------------------------------------

20:25:29 at Response.<anonymous> (/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:162:20)

20:25:29 at Request.<anonymous> (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:355:18)

20:25:29 at Request.callListeners (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/sequential_executor.js:105:20)

20:25:29 at Request.emit (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/sequential_executor.js:77:10)

20:25:29 at Request.emit (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:668:14)

20:25:29 at Request.transition (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:22:10)

20:25:29 at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/state_machine.js:14:12)

20:25:29 at /usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/state_machine.js:26:10

20:25:29 at Request.<anonymous> (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:38:9)

20:25:29 at Request.<anonymous> (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:670:12)

20:25:29 at Request.callListeners (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/sequential_executor.js:115:18)

20:25:29 at Request.emit (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/sequential_executor.js:77:10)

20:25:29 at Request.emit (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:668:14)

20:25:29 at Request.transition (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:22:10)

20:25:29 at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/state_machine.js:14:12)

20:25:29 at /usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/state_machine.js:26:10

Activity

  1. jackwarner commented on Jan 25, 2017

    @jackwarner

    Same problem here!

  2. pmuens commented on Jan 26, 2017

    @pmuens
    Contributor

    @paulSambolin thanks for opening this up and @jackwarner for approving this bug...

    #3070 is written in a way that it usually shouldn't affect the Docker build at all 🤔

    Could you maybe share something about your CodeBuild setup?
    So it was working with Serverless v1.5.0, but fails with Serverelss v1.5.1?

  3. pmuens commented on Jan 26, 2017

    @pmuens
    Contributor

    Another question: Are you pulling Serverless from npm when using CodeBuild or are you using the latest master version from GitHub?

  4. paulSambolin commented on Jan 26, 2017

    @paulSambolin
    ContributorAuthor

    Hey @pmuens, we are pulling from npm and the build started failing a few days ago but I didn't have time to investigate until yesterday. We are using AWS's nodejs4.3.2 Codebuild image and our buildspec is below. As I said, deployment from our local docker images still work on 1.5.1, only fails to deploy from codebuild.

    #buildspec.yml
    version:  0.1
    
    phases:
      install:
        commands:
          - npm install -g [email protected] 2>&1 >/dev/null
          - aws cloudformation list-exports --query 'Exports[?Name==`gs-svc-avatar-security-'"$STAGE"'`].Value' --output text > rolearn.txt
    
      pre_build:
        commands:
          - npm install
    
      build:
        commands:
          - SLS_DEBUG=true serverless deploy --stage $STAGE --serviceName gs.svc.avatar --lambdaRoleARN $(cat rolearn.txt)
  5. paulSambolin commented on Jan 26, 2017

    @paulSambolin
    ContributorAuthor

    Update: Github install has the same error :(

    I will try the github install as that has worked for me before. Will reply in a bit

  6. dannycohn commented on Jan 26, 2017

    @dannycohn
    Contributor

    I just switched from 1.5.0 to github master, as I need the SNS existing topic support that was merged this week. This issue appeared after I made the switch.

  7. pmuens commented on Jan 27, 2017

    @pmuens
    Contributor

    Thanks for the responses!

    I think @erikerikson found the solution for this problem and PRed a bugfix here: #3152

  8. pmuens commented on Jan 27, 2017

    @pmuens
    Contributor

    @paulSambolin the current master should include the fix.

    Does it work for you?

  9. paulSambolin commented on Jan 27, 2017

    @paulSambolin
    ContributorAuthor

    @pmuens Yes it does! I commented on the PR, guess I should have mentioned it here as well. Thanks for looking into it!

  10. pmuens commented on Jan 27, 2017

    @pmuens
    Contributor

    Awesome! Glad to hear that!

    Will be released on Monday. Thanks for confirming!

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions