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)
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.0is 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.0within the next 24 hours.It will be helpful if any maintainer of serverless can provide a minimal repro just with
aws-sdkso 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 yourpackage.jsonand force youraws-sdkversion to 2.1259.0 which seems to be the last one working. This way you can keepserverlessto the last version^3.25.0Same 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-sdkversion without success.Also tried with node 14, same issue.
Be aware: If you have
aws-sdkas 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.0within 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
I finally switched from global installation to a package.json installation.
My package.json is the following
and the pipeline script looks like this:
We are using
yarnto manage dependencies. Thepackage.jsonandyarn.lockfiles are versionned. With this config, it works.@MehranJanfeshan I didn’t close it (it’s other duplicate issue that was closed)
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.
We are using npm for managing the packages
Yeah, had to
npm install --save-dev aws-sdk@2.1259.0. Thanks guys