serverless: "Request is missing Authentication Token" after upgrade to 3.25.0

Message from maintainers:

Upgrade to v3.25.1

This issue is caused by recent regression in AWS SDK. Please increase visibility by adding thumbs up at https://github.com/aws/aws-sdk-js/issues/4286 and https://github.com/aws/aws-sdk-js/issues/4285


Are you certain it’s a bug?

  • Yes, it looks like a bug

Is the issue caused by a plugin?

  • It is not a plugin issue

Are you using the latest v3 release?

  • Yes, I’m using the latest v3 release

Is there an existing issue for this?

  • I have searched existing issues, it hasn’t been reported yet

Issue description

After I have upgraded from 2.24.1 to 3.25.0 I do get the following error while I deploy:

“Request is missing Authentication Token”

Service configuration (serverless.yml) content

N/A

Command name and used flags

serverless deploy --stage=staging

Command output

yarn run v1.22.19
$ cd microservices/core && serverless deploy --verbose

Deploying portal to stage dev (eu-central-1)

Packaging
Using configuration:
{
  "webpackConfig": "./../../webpack.config.js",
  "includeModules": false,
  "packager": "yarn",
  "packagerOptions": {},
  "keepOutputDirectory": false,
  "concurrency": 8
}
Removing /home/test/Projekte/test-project/.webpack
[Webpack] Building with Webpack
[Webpack] Packaging modules
Zip service: /home/test/Projekte/test-project/.webpack/service [324 ms]
[Webpack] Copying existing artifacts
Setting artifact for function 'info' to '.serverless/portal.zip'
Setting artifact for function 'version' to '.serverless/portal.zip'
Setting artifact for function 'onPreSignUp' to '.serverless/portal.zip'
Setting artifact for function 'onPostConfirmation' to '.serverless/portal.zip'
Setting artifact for function 'onCustomMessage' to '.serverless/portal.zip'
Remove /home/test/Projekte/test-project/.webpack
Generating custom CloudFormation resources
Removing /home/test/Projekte/test-project/.webpack done
Retrieving CloudFormation stack

✖ Stack portal-dev failed to deploy (32s)
Environment: linux, node 14.19.0, framework 3.25.0 (local), plugin 6.2.2, SDK 4.3.2
Credentials: Local, "default" profile
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
Request is missing Authentication Token

1 deprecation found: run 'serverless doctor' for more details
error Command failed with exit code 1.

Environment information

Running "serverless" from node_modules
Framework Core: 3.25.0 (local) 3.1.1 (global)
Plugin: 6.2.2
SDK: 4.3.2

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 20
  • Comments: 69 (5 by maintainers)

Most upvoted comments

I finally got it to work from my side. Make sure to understand if you are using serverless npm installed globally or as a local project in your packages. When your serverless is installed through npm install -global, you can also fix the correct aws-sdk as following:

npm i -g serverless@2.72.2 aws-sdk@2.1259.0 (tested and finally working) or npm i -g serverless@3.25.0 aws-sdk@2.1259.0 (not tested, but assuming this also fixes the issue here)

Release aws-sdk@v2.1263.0 is out, and I verified that “Request is missing Authentication Token” error is no longer thrown.

https://github.com/andrmoel/serverless-aws-bug/pull/2

@medikoo Release v3.25.2 after reverting commit https://github.com/serverless/serverless/commit/cb810854a619429b8ec2a4c1dbbd77bb273d015d?

We have a fix available in https://github.com/aws/aws-sdk-js/pull/4288 using the repro which @andrmoel provided. We’ll mostly merge and aim to release it with v2.1263.0 within the next 24 hours.

It will be helpful if any maintainer of serverless can provide a minimal repro just with aws-sdk so that we can understand why this issue is happening and post relevant comments in the SDK codebase. We suspect it’s either caused by setting AWS global configuration, or multiple client initializations at once, in the serverless code.

We are formalizing our plans to enter AWS SDK for JavaScript v2 into maintenance mode in 2023. For more details, check our README in Version 2.x Support.

@trivikr great thanks for fast action! 💯 🎉

@medikoo why did you close it? There is no clear solution yet; even downgrading doesn’t work.

It’s a regression in AWS-SDK. To increase visibility please comment (and +1) https://github.com/aws/aws-sdk-js/issues/4286 and https://github.com/aws/aws-sdk-js/issues/4285

As the issue is only with aws-sdk, you can add the following resolution to your package.json and force your aws-sdk version to 2.1259.0 which seems to be the last one working. This way you can keep serverless to the last version ^3.25.0

"dependencies": {
  ...
  "aws-sdk": "2.1259.0"
  ...
},
"resolutions": {
  "aws-sdk": "2.1259.0"
},

Same issue here. Using the following in CircleCI : yarn global add serverless@3.17. There is no package.json with our application, it is a PHP application, we only use Node during deployment.

I tried different Serverless Framework version (3.24, 3.21, etc) and got the same results. I also tried to force the aws-sdk version without success.

Environment: linux, node 16.18.1, framework 3.17.0, plugin 6.2.2, SDK 4.3.2

Also tried with node 14, same issue.

Clean install meaning?

yarn remove serverless
yarn add serverless@version

Be aware: If you have aws-sdk as dependency in your package.json, you also need to remove this one otherwise it won’t get downgraded.

Verified that fix from https://github.com/aws/aws-sdk-js/pull/4288 fixes “Request is missing Authentication Token” issue.

Refer Pull request in https://github.com/trivikr/serverless-aws-bug/pull/1 We’re aiming to release this fix in v2.1263.0 within the next 24 hours.

Just released v3.25.1 version of the Framework, which fixes AWS SDK to the last working version. Please upgrade and the issue should be fixed

Same issue here. Using the following in CircleCI : yarn global add serverless@3.17. There is no package.json with our application, it is a PHP application, we only use Node during deployment.

I tried different Serverless Framework version (3.24, 3.21, etc) and got the same results. I also tried to force the aws-sdk version without success.

Environment: linux, node 16.18.1, framework 3.17.0, plugin 6.2.2, SDK 4.3.2

Also tried with node 14, same issue.

I finally switched from global installation to a package.json installation.

My package.json is the following

{
  "name": "application",
  "version": "1.0.0",
  "dependencies": {
    "serverless": "3.17.0",
    "aws-sdk": "2.1243.0"
  },
  "resolutions": {
    "serverless/aws-sdk": "2.1243.0"
  }
}

and the pipeline script looks like this:

yarn --frozen-lockfile
yarn run sls deploy --verbose --stage mystage

We are using yarn to manage dependencies. The package.json and yarn.lock files are versionned. With this config, it works.

@medikoo why did you close it? There is no clear solution yet; even downgrading doesn’t work.

@MehranJanfeshan I didn’t close it (it’s other duplicate issue that was closed)

I finally got it to work from my side. Make sure to understand if you are using serverless npm installed globally or as a local project in your packages. When your serverless is installed through npm install -global, you can also fix the correct aws-sdk as following:

npm i -g serverless@2.72.2 aws-sdk@2.1259.0 (tested and finally working) or npm i -g serverless@3.25.0 aws-sdk@2.1259.0 (not tested, but assuming this also fixes the issue here)

this worked very well, thanks

I experience the same error and failure of deployments. Everything used to work up until this morning and untouched modules started breaking.

@sbmvirdi @coder-pikachu please check your yarn.lock file.

You should find:

...

serverless@^3.24.1:
  version "3.24.1" # > > > > THIS MUST BE 3.24.1 < < < <
  resolved "https://registry.yarnpkg.com/serverless/-/serverless-3.24.1.tgz#2d361e97192d4565131e8b11e90dc033d2d1a74f"
  
...

aws-sdk@^2.1247.0, aws-sdk@^2.814.0:
  version "2.1253.0" # > > > > THIS MUST NOT BE 2.1262.0 < < < <
  resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1253.0.tgz#28ac12775f4d1589e366db6f2b162d8ea150c2ad"

...

We are using npm for managing the packages

Yeah, had to npm install --save-dev aws-sdk@2.1259.0. Thanks guys