serverless / serverless

⚡ Serverless Framework – Effortlessly build apps that auto-scale, incur zero costs when idle, and require minimal maintenance using AWS Lambda and other managed cloud services.
https://serverless.com
MIT License
46.47k stars 5.72k forks source link

TypeError: Cannot read property 'Ref' of undefined #9500

Closed nrszysiak closed 3 years ago

nrszysiak commented 3 years ago

I'm trying to deploy & run Python AWS Lambda function on APIGateway with an use of a LocalStack framework. The issue seems to be kind of similar to #6497.

serverless.yml ```yaml service: [service_name] custom: logRetentionInDays: 14 prune: automatic: true number: 3 localstack: debug: true stages: - local endpointFile: localstack_endpoints.json provider: name: aws profile: ${opt:profile, 'stg'} runtime: python3.7 region: eu-west-1 memorySize: 128 stage: v1 endpointType: REGIONAL deploymentBucket: name: [deployment_bucker_prefix]-${opt:profile, 'stg'} apiGateway: restApiId: ${ssm:rest-api-id} restApiRootResourceId: ${ssm:rest-api-root-resource-id} package: individually: true functions: [function_name]: handler: [handler] name: [name] timeout: 30 environment: RDS_SECRET_NAME: ${ssm:RDS_SECRET_NAME} layers: - ${ssm:pymysql_layer_arn} - ${ssm:retrying_layer_arn} - ${ssm:lambda_utils_layer_arn} role: Fn::GetAtt: - lambdaRole - Arn package: include: - lambdas/** exclude: - "**/**" events: - http: path: [path] method: get request: parameters: paths: partner: true personal_number: true - schedule: name: [schedule_name] rate: rate(10 minutes) inputTransformer: inputTemplate: '{"pathParameters": {[params]}}' vpc: securityGroupIds: - ${ssm:private-security-group} subnetIds: - ${ssm:private-subnet-a-id} - ${ssm:private-subnet-b-id} - ${ssm:private-subnet-c-id} resources: Resources: lambdaRole: Type: AWS::IAM::Role Properties: RoleName: [role_name] AssumeRolePolicyDocument: Version: '2012-10-17' Statement: - Effect: Allow Principal: Service: - lambda.amazonaws.com Action: sts:AssumeRole Policies: - PolicyName: [policy_name] PolicyDocument: Version: '2012-10-17' Statement: - Effect: Allow Action: - logs:CreateLogGroup - logs:CreateLogStream - logs:PutLogEvents - rds:* - ssm:* - secretsmanager:* - ec2:CreateNetworkInterface - ec2:DescribeNetworkInterfaces - ec2:DeleteNetworkInterface Resource: "*" plugins: - serverless-prune-plugin - serverless-plugin-log-retention - serverless-localstack ```
sls deploy --stage local output ``` Serverless: config.options_stage: local Serverless: serverless.service.custom.stage: undefined Serverless: serverless.service.provider.stage: v1 Serverless: config.stage: local Serverless: Loading endpointJson from localstack_endpoints.json Serverless: Intercepting service CloudFormation Serverless: Intercepting service Lambda Serverless: Intercepting service S3 Serverless: Intercepting service ApiGateway Serverless: Using serverless-localstack Serverless: Deprecation warning: "provider.profile" is not accessible (configured behind variables which cannot be resolved at this stage). Starting with next major release, this will be communicated with a thrown error. Set "variablesResolutionMode: 20210326" in your service config, to adapt to this behavior now More Info: https://www.serverless.com/framework/docs/deprecations/#NEW_VARIABLES_RESOLVER Serverless: config.options_stage: local Serverless: serverless.service.custom.stage: undefined Serverless: serverless.service.provider.stage: v1 Serverless: config.stage: local Serverless: Using serverless-localstack Serverless: Reconfiguring service acm to use http://localhost:4566 Serverless: Reconfiguring service amplify to use http://localhost:4566 Serverless: Reconfiguring service apigateway to use http://localhost:4566 Serverless: Reconfiguring service apigatewayv2 to use http://localhost:4566 Serverless: Reconfiguring service application-autoscaling to use http://localhost:4566 Serverless: Reconfiguring service appsync to use http://localhost:4566 Serverless: Reconfiguring service athena to use http://localhost:4566 Serverless: Reconfiguring service autoscaling to use http://localhost:4566 Serverless: Reconfiguring service batch to use http://localhost:4566 Serverless: Reconfiguring service cloudformation to use http://localhost:4566 Serverless: Reconfiguring service cloudfront to use http://localhost:4566 Serverless: Reconfiguring service cloudsearch to use http://localhost:4566 Serverless: Reconfiguring service cloudtrail to use http://localhost:4566 Serverless: Reconfiguring service cloudwatch to use http://localhost:4566 Serverless: Reconfiguring service cloudwatchlogs to use http://localhost:4566 Serverless: Reconfiguring service codecommit to use http://localhost:4566 Serverless: Reconfiguring service cognito-idp to use http://localhost:4566 Serverless: Reconfiguring service cognito-identity to use http://localhost:4566 Serverless: Reconfiguring service docdb to use http://localhost:4566 Serverless: Reconfiguring service dynamodb to use http://localhost:4566 Serverless: Reconfiguring service dynamodbstreams to use http://localhost:4566 Serverless: Reconfiguring service ec2 to use http://localhost:4566 Serverless: Reconfiguring service ecr to use http://localhost:4566 Serverless: Reconfiguring service ecs to use http://localhost:4566 Serverless: Reconfiguring service eks to use http://localhost:4566 Serverless: Reconfiguring service elasticache to use http://localhost:4566 Serverless: Reconfiguring service elasticbeanstalk to use http://localhost:4566 Serverless: Reconfiguring service elb to use http://localhost:4566 Serverless: Reconfiguring service elbv2 to use http://localhost:4566 Serverless: Reconfiguring service emr to use http://localhost:4566 Serverless: Reconfiguring service es to use http://localhost:4566 Serverless: Reconfiguring service events to use http://localhost:4566 Serverless: Reconfiguring service firehose to use http://localhost:4566 Serverless: Reconfiguring service glacier to use http://localhost:4566 Serverless: Reconfiguring service glue to use http://localhost:4566 Serverless: Reconfiguring service iam to use http://localhost:4566 Serverless: Reconfiguring service iot to use http://localhost:4566 Serverless: Reconfiguring service iotanalytics to use http://localhost:4566 Serverless: Reconfiguring service iotevents to use http://localhost:4566 Serverless: Reconfiguring service iot-data to use http://localhost:4566 Serverless: Reconfiguring service iot-jobs-data to use http://localhost:4566 Serverless: Reconfiguring service kafka to use http://localhost:4566 Serverless: Reconfiguring service kinesis to use http://localhost:4566 Serverless: Reconfiguring service kinesisanalytics to use http://localhost:4566 Serverless: Reconfiguring service kms to use http://localhost:4566 Serverless: Reconfiguring service lambda to use http://localhost:4566 Serverless: Reconfiguring service logs to use http://localhost:4566 Serverless: Reconfiguring service mediastore to use http://localhost:4566 Serverless: Reconfiguring service neptune to use http://localhost:4566 Serverless: Reconfiguring service organizations to use http://localhost:4566 Serverless: Reconfiguring service qldb to use http://localhost:4566 Serverless: Reconfiguring service rds to use http://localhost:4566 Serverless: Reconfiguring service redshift to use http://localhost:4566 Serverless: Reconfiguring service route53 to use http://localhost:4566 Serverless: Reconfiguring service s3 to use http://localhost:4566 Serverless: Reconfiguring service s3control to use http://localhost:4566 Serverless: Reconfiguring service sagemaker to use http://localhost:4566 Serverless: Reconfiguring service sagemaker-runtime to use http://localhost:4566 Serverless: Reconfiguring service secretsmanager to use http://localhost:4566 Serverless: Reconfiguring service ses to use http://localhost:4566 Serverless: Reconfiguring service sns to use http://localhost:4566 Serverless: Reconfiguring service sqs to use http://localhost:4566 Serverless: Reconfiguring service ssm to use http://localhost:4566 Serverless: Reconfiguring service stepfunctions to use http://localhost:4566 Serverless: Reconfiguring service sts to use http://localhost:4566 Serverless: Reconfiguring service timestream to use http://localhost:4566 Serverless: Reconfiguring service transfer to use http://localhost:4566 Serverless: Reconfiguring service xray to use http://localhost:4566 Serverless: Reconfiguring service CloudFormation to use http://localhost:4566 Serverless: Reconfiguring service Lambda to use http://localhost:4566 Serverless: Reconfiguring service S3 to use http://localhost:4566 Serverless: Reconfiguring service ApiGateway to use http://localhost:4566 Serverless: config.options_stage: local Serverless: serverless.service.custom.stage: undefined Serverless: serverless.service.provider.stage: v1 Serverless: config.stage: local Serverless: Deprecation warning: Unresolved variable references will be communicated with a thrown error, starting from next major More Info: https://www.serverless.com/framework/docs/deprecations/#VARIABLES_ERROR_ON_UNRESOLVED Serverless Warning -------------------------------------- A valid SSM parameter to satisfy the declaration 'ssm:rest-api-id' could not be found. Serverless Warning -------------------------------------- A valid SSM parameter to satisfy the declaration 'ssm:rest-api-root-resource-id' could not be found. Serverless Warning -------------------------------------- A valid SSM parameter to satisfy the declaration 'ssm:pymysql_layer_arn' could not be found. Serverless Warning -------------------------------------- A valid SSM parameter to satisfy the declaration 'ssm:RDS_SECRET_NAME' could not be found. Serverless Warning -------------------------------------- A valid SSM parameter to satisfy the declaration 'ssm:retrying_layer_arn' could not be found. Serverless Warning -------------------------------------- A valid SSM parameter to satisfy the declaration 'ssm:lambda_utils_layer_arn' could not be found. Serverless Warning -------------------------------------- A valid SSM parameter to satisfy the declaration 'ssm:private-subnet-a-id' could not be found. Serverless Warning -------------------------------------- A valid SSM parameter to satisfy the declaration 'ssm:private-security-group' could not be found. Serverless Warning -------------------------------------- A valid SSM parameter to satisfy the declaration 'ssm:private-subnet-b-id' could not be found. Serverless Warning -------------------------------------- A valid SSM parameter to satisfy the declaration 'ssm:private-subnet-c-id' could not be found. Serverless: Configuration warning: Serverless: at 'functions['api-player-segmentation'].layers[0]': unsupported configuration format Serverless: at 'functions['api-player-segmentation'].layers[1]': unsupported configuration format Serverless: at 'functions['api-player-segmentation'].layers[2]': unsupported configuration format Serverless: at 'functions['api-player-segmentation'].vpc.securityGroupIds[0]': unsupported configuration format Serverless: at 'functions['api-player-segmentation'].vpc.subnetIds[0]': unsupported configuration format Serverless: at 'functions['api-player-segmentation'].vpc.subnetIds[1]': unsupported configuration format Serverless: at 'functions['api-player-segmentation'].vpc.subnetIds[2]': unsupported configuration format Serverless: Serverless: Learn more about configuration validation here: http://slss.io/configuration-validation Serverless: Serverless: Deprecation warning: Starting with next major, Serverless will throw on configuration errors by default. Adapt to this behavior now by adding "configValidationMode: error" to service configuration More Info: https://www.serverless.com/framework/docs/deprecations/#CONFIG_VALIDATION_MODE_DEFAULT Serverless: Deprecation warning: Support for "package.include" and "package.exclude" will be removed with next major release. Please use "package.patterns" instead More Info: https://www.serverless.com/framework/docs/deprecations/#NEW_PACKAGE_PATTERNS Serverless: Deprecation warning: Resolution of lambda version hashes was improved with better algorithm, which will be used in next major release. Switch to it now by setting "provider.lambdaHashingVersion" to "20201221" More Info: https://www.serverless.com/framework/docs/deprecations/#LAMBDA_HASHING_VERSION_V2 Serverless: Packaging service... Serverless: Excluding development dependencies... Type Error ---------------------------------------------- TypeError: Cannot read property 'Ref' of undefined at functionProperties.Layers.forEach (/usr/local/lib/node_modules/serverless/lib/plugins/aws/package/compile/functions.js:724:35) at Array.forEach () at extractLayerConfigurationsFromFunction (/usr/local/lib/node_modules/serverless/lib/plugins/aws/package/compile/functions.js:723:29) at AwsCompileFunctions.compileFunction (/usr/local/lib/node_modules/serverless/lib/plugins/aws/package/compile/functions.js:445:9) at LocalstackPlugin.compileFunction (/mnt/c/Users/nszys/PycharmProjects/aws-bigdata-api/api_player_segmentation/node_modules/serverless-localstack/src/index.js:172:50) at Promise.all.allFunctions.map (/usr/local/lib/node_modules/serverless/lib/plugins/aws/package/compile/functions.js:668:64) at Array.map () at AwsCompileFunctions.compileFunctions (/usr/local/lib/node_modules/serverless/lib/plugins/aws/package/compile/functions.js:668:37) at AwsCompileFunctions.tryCatcher (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:547:31) at Promise._settlePromise (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:604:18) at Promise._settlePromise0 (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:649:10) at Promise._settlePromises (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:729:18) at _drainQueueStep (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:93:12) at _drainQueue (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:86:9) at Async._drainQueues (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:102:5) at Immediate.Async.drainQueues (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:15:14) at runCallback (timers.js:705:18) at tryOnImmediate (timers.js:676:5) at processImmediate (timers.js:658:5) at process.topLevelDomainCallback (domain.js:126:23) For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable. Get Support -------------------------------------------- Docs: docs.serverless.com Bugs: github.com/serverless/serverless/issues Issues: forum.serverless.com Your Environment Information --------------------------- Operating System: linux Node Version: 10.19.0 Framework Version: 2.40.0 Plugin Version: 4.5.3 SDK Version: 4.2.2 Components Version: 3.9.2 ```

Installed version

Framework Core: 2.40.0
Plugin: 4.5.3
SDK: 4.2.2
Components: 3.9.2
pgrzesik commented 3 years ago

Hello @nrszysiak - could you please provide (anonymized) serverless.yml configuration as well as full output of the deploy command? Ideally if you could follow the issue template that is visible when creating a new ticket. It will help debugging your problem :bow:

nrszysiak commented 3 years ago

@pgrzesik The issue content have just been updated.

pgrzesik commented 3 years ago

According to the output, you have invalid configuration for layers:

Serverless:   at 'functions['api-player-segmentation'].layers[0]': unsupported configuration format
Serverless:   at 'functions['api-player-segmentation'].layers[1]': unsupported configuration format
Serverless:   at 'functions['api-player-segmentation'].layers[2]': unsupported configuration format

Could you ensure to provide valid configuration there?

nrszysiak commented 3 years ago

@pgrzesik I think the layers have loaded correctly they based on the logs. I updated the LocalStack plan to the PRO version, which natively supports adding lambdas by adding a root dir and layer path parameters in serveless.yml:

layers:
   test:
     path: layers

I've also added a pseudo-parameters plugin in the form of a serverless-pseudo-parameters plugin.

This is the output of the echo below:

echo "Deploying Serverless app to local environment"; \
        awslocal s3api create-bucket --bucket testbucket; \
        SLS_DEBUG=1 npm run deploy && \
        echo "Serverless app successfully deployed locally. Now trying to invoke the Lambda function with layer." && \
        awslocal lambda invoke --function-name api-player-segmentation-local-api-player-segmentation /tmp/out.tmp
Deploying Serverless app to local environment
{
    "Location": "/testbucket"
}

> deploy
> sls deploy --stage local

Serverless: To ensure safe major version upgrades ensure "frameworkVersion" setting in service configuration (recommended setup: "frameworkVersion: ^2.40.0")

Serverless: Load command interactiveCli
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command config:tabcompletion
Serverless: Load command config:tabcompletion:install
Serverless: Load command config:tabcompletion:uninstall
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command upgrade
Serverless: Load command uninstall
Serverless: Load command prune
Serverless: config.options_stage: local
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: v1
Serverless: config.stage: local
Serverless: Using serverless-localstack
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command generate-event
Serverless: Load command test
Serverless: Load command dashboard
Serverless: Load command output
Serverless: Load command output:get
Serverless: Load command output:list
Serverless: Load command param
Serverless: Load command param:get
Serverless: Load command param:list
Serverless: Load command studio
Serverless: Deprecation warning: "provider.profile" is not accessible (configured behind variables which cannot be resolved at this stage).
            Starting with next major release, this will be communicated with a thrown error.
            Set "variablesResolutionMode: 20210326" in your service config, to adapt to this behavior now
            More Info: https://www.serverless.com/framework/docs/deprecations/#NEW_VARIABLES_RESOLVER
Serverless: Deprecation warning: Support for "package.include" and "package.exclude" will be removed with next major release. Please use "package.patterns" instead
            More Info: https://www.serverless.com/framework/docs/deprecations/#NEW_PACKAGE_PATTERNS
Serverless: Deprecation warning: Resolution of lambda version hashes was improved with better algorithm, which will be used in next major release.
            Switch to it now by setting "provider.lambdaHashingVersion" to "20201221"
            More Info: https://www.serverless.com/framework/docs/deprecations/#LAMBDA_HASHING_VERSION_V2
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: config.options_stage: local
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: v1
Serverless: config.stage: local
Serverless: Using serverless-localstack
Serverless: Reconfiguring service acm to use http://localhost:4566
Serverless: Reconfiguring service amplify to use http://localhost:4566
Serverless: Reconfiguring service apigateway to use http://localhost:4566
Serverless: Reconfiguring service apigatewayv2 to use http://localhost:4566
Serverless: Reconfiguring service application-autoscaling to use http://localhost:4566
Serverless: Reconfiguring service appsync to use http://localhost:4566
Serverless: Reconfiguring service athena to use http://localhost:4566
Serverless: Reconfiguring service autoscaling to use http://localhost:4566
Serverless: Reconfiguring service batch to use http://localhost:4566
Serverless: Reconfiguring service cloudformation to use http://localhost:4566
Serverless: Reconfiguring service cloudfront to use http://localhost:4566
Serverless: Reconfiguring service cloudsearch to use http://localhost:4566
Serverless: Reconfiguring service cloudtrail to use http://localhost:4566
Serverless: Reconfiguring service cloudwatch to use http://localhost:4566
Serverless: Reconfiguring service cloudwatchlogs to use http://localhost:4566
Serverless: Reconfiguring service codecommit to use http://localhost:4566
Serverless: Reconfiguring service cognito-idp to use http://localhost:4566
Serverless: Reconfiguring service cognito-identity to use http://localhost:4566
Serverless: Reconfiguring service docdb to use http://localhost:4566
Serverless: Reconfiguring service dynamodb to use http://localhost:4566
Serverless: Reconfiguring service dynamodbstreams to use http://localhost:4566
Serverless: Reconfiguring service ec2 to use http://localhost:4566
Serverless: Reconfiguring service ecr to use http://localhost:4566
Serverless: Reconfiguring service ecs to use http://localhost:4566
Serverless: Reconfiguring service eks to use http://localhost:4566
Serverless: Reconfiguring service elasticache to use http://localhost:4566
Serverless: Reconfiguring service elasticbeanstalk to use http://localhost:4566
Serverless: Reconfiguring service elb to use http://localhost:4566
Serverless: Reconfiguring service elbv2 to use http://localhost:4566
Serverless: Reconfiguring service emr to use http://localhost:4566
Serverless: Reconfiguring service es to use http://localhost:4566
Serverless: Reconfiguring service events to use http://localhost:4566
Serverless: Reconfiguring service firehose to use http://localhost:4566
Serverless: Reconfiguring service glacier to use http://localhost:4566
Serverless: Reconfiguring service glue to use http://localhost:4566
Serverless: Reconfiguring service iam to use http://localhost:4566
Serverless: Reconfiguring service iot to use http://localhost:4566
Serverless: Reconfiguring service iotanalytics to use http://localhost:4566
Serverless: Reconfiguring service iotevents to use http://localhost:4566
Serverless: Reconfiguring service iot-data to use http://localhost:4566
Serverless: Reconfiguring service iot-jobs-data to use http://localhost:4566
Serverless: Reconfiguring service kafka to use http://localhost:4566
Serverless: Reconfiguring service kinesis to use http://localhost:4566
Serverless: Reconfiguring service kinesisanalytics to use http://localhost:4566
Serverless: Reconfiguring service kms to use http://localhost:4566
Serverless: Reconfiguring service lambda to use http://localhost:4566
Serverless: Reconfiguring service logs to use http://localhost:4566
Serverless: Reconfiguring service mediastore to use http://localhost:4566
Serverless: Reconfiguring service neptune to use http://localhost:4566
Serverless: Reconfiguring service organizations to use http://localhost:4566
Serverless: Reconfiguring service qldb to use http://localhost:4566
Serverless: Reconfiguring service rds to use http://localhost:4566
Serverless: Reconfiguring service redshift to use http://localhost:4566
Serverless: Reconfiguring service route53 to use http://localhost:4566
Serverless: Reconfiguring service s3 to use http://localhost:4566
Serverless: Reconfiguring service s3control to use http://localhost:4566
Serverless: Reconfiguring service sagemaker to use http://localhost:4566
Serverless: Reconfiguring service sagemaker-runtime to use http://localhost:4566
Serverless: Reconfiguring service secretsmanager to use http://localhost:4566
Serverless: Reconfiguring service ses to use http://localhost:4566
Serverless: Reconfiguring service sns to use http://localhost:4566
Serverless: Reconfiguring service sqs to use http://localhost:4566
Serverless: Reconfiguring service ssm to use http://localhost:4566
Serverless: Reconfiguring service stepfunctions to use http://localhost:4566
Serverless: Reconfiguring service sts to use http://localhost:4566
Serverless: Reconfiguring service timestream to use http://localhost:4566
Serverless: Reconfiguring service transfer to use http://localhost:4566
Serverless: Reconfiguring service xray to use http://localhost:4566
Serverless: config.options_stage: local
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: v1
Serverless: config.stage: local
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Layer test is already uploaded.
Serverless: Invoke aws:package:finalize
AWS Pseudo Parameters
Skipping automatic replacement of regions with account region!
Serverless: Invoke aws:common:moveArtifactsToPackage
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:deploy:deploy
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Skip uploading test
Serverless: Uploading service api-player-segmentation.zip file to S3 (1.51 KB)...
Serverless: Validating template...
Serverless: Skipping template validation: Unsupported in Localstack
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
.........
Serverless: Operation failed!
Serverless: View the full error output: https://eu-west-1.console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stack/detail?stackId=arn%3Aaws%3Acloudformation%3Aeu-west-1%3A000
000000000%3Astack%2Fapi-player-segmentation-local%2F8fa34a27

 Serverless Error ----------------------------------------

  ServerlessError: An error occurred: api-player-segmentation-local - undefined.
      at provider.request.then (/usr/local/lib/node_modules/serverless/lib/plugins/aws/lib/monitorStack.js:94:23)
      at process._tickCallback (internal/process/next_tick.js:68:7)

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              10.19.0
     Framework Version:         2.40.0
     Plugin Version:            4.5.3
     SDK Version:               4.2.2
     Components Version:        3.9.2

make: *** [Makefile:20: run] Error 1

This might be related to the service name and the stage. Any thoughts on this?

pgrzesik commented 3 years ago

Hello @nrszysiak :wave: Is that error and the end being returned by localstack running on your machine? I'm unfortunately no expert on the serverless-localstack integration - if it's tied directly to that integration, maybe it's a bug in the plugin itself?

nrszysiak commented 3 years ago

Hey @pgrzesik, correct - the error at the end occurs on my local machine.

pgrzesik commented 3 years ago

One extra question - did it start to happen recently (and worked previously), after upgrading the Framework for example or it's a whole new setup?

nrszysiak commented 3 years ago

@pgrzesik It's a completely new setup based on the existing serverless template. We have created the architecture with other Lambda services by testing them directly by implementing them in AWS. We wanted to change that by implementing LocalStack with a plugin for serverless, so this one never came out before because we didn't use LocalStack.

pgrzesik commented 3 years ago

Thanks for clarification @nrszysiak - it that case I believe the problem might be with serverless-localstack plugin - could you please report that issue on their side?

nrszysiak commented 3 years ago

Thanks @pgrzesik for the prompt reply. I'm already in contact with LocalStack community support.

pgrzesik commented 3 years ago

Please let us know if you find out anything @nrszysiak. I believe it's not an issue with the Framework itself in this case, but I don't want to rule anything out before we find out the root cause.

pgrzesik commented 3 years ago

Hello @nrszysiak - did you manage to resolve that problem with Localstack support?

nrszysiak commented 3 years ago

Hi @pgrzesik yes, I had to change Docker image version of localstack. Thanks for your support.

pgrzesik commented 3 years ago

Hey, thanks for an update :bow: