Lambda was unable to decrypt the environment variables due to an internal service erro

Hello,

I have a lambda used for authorization ,
i do remove and deploy and once i test the lambada i get an error "Lambda was unable to decrypt the environment variables due to an internal service error. "

sudo sls deploy -s dev
IN: before:package:cleanup
IN: before:aws:common:validate:validate
IN: after:aws:common:validate:validate
IN: before:aws:common:cleanupTempDir:cleanup
IN: after:aws:common:cleanupTempDir:cleanup
IN: after:package:cleanup
IN: before:package:initialize
IN: after:package:initialize
IN: before:package:setupProviderConfiguration
IN: after:package:setupProviderConfiguration
IN: before:package:createDeploymentArtifacts
Serverless: Packaging serviceā€¦
Serverless: Excluding development dependenciesā€¦
Serverless: Excluding development dependenciesā€¦
Serverless: Excluding development dependenciesā€¦
IN: after:package:createDeploymentArtifacts
IN: before:package:compileLayers
IN: after:package:compileLayers
IN: before:package:compileFunctions
IN: after:package:compileFunctions
IN: before:package:compileEvents
IN: after:package:compileEvents
IN: before:package:finalize
IN: before:aws:package:finalize:mergeCustomProviderResources
AWS Pseudo Parameters
IN: after:aws:package:finalize:mergeCustomProviderResources
IN: before:aws:package:finalize:saveServiceState
IN: before:aws:common:moveArtifactsToPackage:move
IN: after:aws:common:moveArtifactsToPackage:move
IN: after:aws:package:finalize:saveServiceState
IN: after:package:finalize
IN: before:aws:common:validate:validate
IN: after:aws:common:validate:validate
IN: before:deploy:deploy
IN: before:aws:deploy:deploy:createStack
Serverless: Creating Stackā€¦
Serverless: Checking Stack create progressā€¦
ā€¦
Serverless: Stack create finishedā€¦
IN: after:aws:deploy:deploy:createStack
IN: before:aws:deploy:deploy:checkForChanges
IN: after:aws:deploy:deploy:checkForChanges
IN: before:aws:deploy:deploy:uploadArtifacts
Serverless: Uploading CloudFormation file to S3ā€¦
Serverless: Uploading artifactsā€¦
Serverless: Uploading service authorizer.zip file to S3 (14.63 MB)ā€¦
Serverless: Uploading service defaultAuthorizer.zip file to S3 (14.63 MB)ā€¦
Serverless: Uploading service authorizerToken.zip file to S3 (14.63 MB)ā€¦
IN: after:aws:deploy:deploy:uploadArtifacts
IN: before:aws:deploy:deploy:validateTemplate
Serverless: Validating templateā€¦
IN: after:aws:deploy:deploy:validateTemplate
IN: before:aws:deploy:deploy:updateStack
Serverless: Updating Stackā€¦
Serverless: Checking Stack update progressā€¦
ā€¦
Serverless: Stack update finishedā€¦
IN: after:aws:deploy:deploy:updateStack
IN: before:aws:info:validate
IN: after:aws:info:validate
IN: before:aws:info:gatherData
IN: after:aws:info:gatherData
IN: before:aws:info:displayServiceInfo
Service Information
service: authorizerManager
stage: dev
region: eu-west-1
stack: authorizerManager-dev
resources: 12
IN: after:aws:info:displayServiceInfo
IN: before:aws:info:displayApiKeys
api keys:
None
IN: after:aws:info:displayApiKeys
IN: before:aws:info:displayEndpoints
endpoints:
None
IN: after:aws:info:displayEndpoints
IN: before:aws:info:displayFunctions
functions:
authorizer: authorizerManager-dev-authorizer
defaultAuthorizer: authorizerManager-dev-defaultAuthorizer
authorizerToken: authorizerManager-dev-authorizerToken
IN: after:aws:info:displayFunctions
IN: before:aws:info:displayLayers
layers:
None
IN: after:aws:info:displayLayers
IN: before:aws:info:displayStackOutputs
IN: after:aws:info:displayStackOutputs
IN: after:deploy:deploy
IN: before:deploy:finalize
IN: before:aws:deploy:finalize:cleanup
IN: after:aws:deploy:finalize:cleanup
Serverless: Run the ā€œserverlessā€ command to setup monitoring, troubleshooting and testing.
IN: after:deploy:finalize
if deploy manna-authorization-service write his arn to ssm (System Management Parameters)
region: eu-west-1
stage: dev
ServiceName: authorizerManager
funcArn: arn:aws:lambda:eu-west-1:231291004448:function:authorizerManager-dev-authorizer
Save Lambda authorizer ARN into ssm/AuthorizeLambdaFunctionQualifiedArn-dev finish successfully!!!


Sleeping for 7 seconds, current time Mon Jan 06 2020 13:51:19 GMT+0000 (Coordinated Universal Time)
wake up, current time Mon Jan 06 2020 13:51:26 GMT+0000 (Coordinated Universal Time)
Start run cloud integration test
LOG_TO_FILE is true

manna-authorization-service Applicative user authorization
1) Integration test - applicative authorization with configured username/psw
2) Integration test - applicative authorization with wrong credentials returns should fail

manna-authorization-service default Authorizer test
3) Integration test - get last used token and check Authorization

manna-authorization-service default Authorizer test negative
4) Integration test - request without token must fail with Deny

manna-authorization-service token Authorizer (skips account validation) test negative
āœ“ Integration test - request without token must fail (977ms)

1 passing (3s)
4 failing

  1. manna-authorization-service Applicative user authorization
    Integration test - applicative authorization with configured username/psw:

    AssertionError [ERR_ASSERTION]: 'Lambda was unable to decrypt the environment variables due to an internal service error. ā€™ == ā€˜Unauthorizedā€™

    • expected - actual

    -Lambda was unable to decrypt the environment variables due to an internal service error.
    +Unauthorized

    at Context.it (tests/manna-authorization-service.intg.js:30:20)
    at process._tickCallback (internal/process/next_tick.js:68:7)

  2. manna-authorization-service Applicative user authorization
    Integration test - applicative authorization with wrong credentials returns should fail:

    AssertionError [ERR_ASSERTION]: 'Lambda was unable to decrypt the environment variables due to an internal service error. ā€™ == ā€˜Unauthorizedā€™

    • expected - actual

    -Lambda was unable to decrypt the environment variables due to an internal service error.
    +Unauthorized

    at Context.it (tests/manna-authorization-service.intg.js:42:20)
    at process._tickCallback (internal/process/next_tick.js:68:7)

  3. manna-authorization-service default Authorizer test
    Integration test - get last used token and check Authorization:
    Error: the string "Lambda was unable to decrypt the environment variables due to an internal service error. " was thrown, throw an Error :slight_smile:
    at process._tickCallback (internal/process/next_tick.js:68:7)

  4. manna-authorization-service default Authorizer test negative
    Integration test - request without token must fail with Deny:

    AssertionError [ERR_ASSERTION]: 'Lambda was unable to decrypt the environment variables due to an internal service error. ā€™ == ā€˜Unauthorizedā€™

    • expected - actual

    -Lambda was unable to decrypt the environment variables due to an internal service error.
    +Unauthorized

    at Context.it (tests/manna-default-auth-service.intg.js:45:20)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Exception -----------------------------------------------