serverless-localstack icon indicating copy to clipboard operation
serverless-localstack copied to clipboard

deployment of serverless 1.65.0 returns error ECONNREFUSED 127.0.0.1:4567

Open terios opened this issue 4 years ago • 3 comments

since updating to the latest version (1.65.0) of serverless I am getting an error message after deploying to Localstack.

Serverless: config.options_stage: development
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: ${opt:stage, 'development'}
Serverless: config.stage: development
Serverless: Using serverless-localstack
Serverless: Reconfiguring service apigateway to use http://localhost:4567
Serverless: Reconfiguring service cloudformation to use http://localhost:4581
Serverless: Reconfiguring service cloudwatch to use http://localhost:4582
Serverless: Reconfiguring service lambda to use http://localhost:4574
Serverless: Reconfiguring service dynamodb to use http://localhost:4569
Serverless: Reconfiguring service kinesis to use http://localhost:4568
Serverless: Reconfiguring service route53 to use http://localhost:4580
Serverless: Reconfiguring service firehose to use http://localhost:4573
Serverless: Reconfiguring service stepfunctions to use http://localhost:4585
Serverless: Reconfiguring service es to use http://localhost:4578
Serverless: Reconfiguring service s3 to use http://localhost:4572
Serverless: Reconfiguring service ses to use http://localhost:4579
Serverless: Reconfiguring service sns to use http://localhost:4575
Serverless: Reconfiguring service sqs to use http://localhost:4576
Serverless: Reconfiguring service sts to use http://localhost:4592
Serverless: Reconfiguring service iam to use http://localhost:4593
Serverless: Reconfiguring service ssm to use http://localhost:4583
Serverless: Reconfiguring service rds to use http://localhost:4594
Serverless: Reconfiguring service ec2 to use http://localhost:4597
Serverless: Reconfiguring service elasticache to use http://localhost:4598
Serverless: Reconfiguring service kms to use http://localhost:4599
Serverless: Reconfiguring service secretsmanager to use http://localhost:4584
Serverless: Reconfiguring service logs to use http://localhost:4586
Serverless: Reconfiguring service cloudwatchlogs to use http://localhost:4586
Serverless: Reconfiguring service iot to use http://localhost:4589
Serverless: Reconfiguring service cognito-idp to use http://localhost:4590
Serverless: Reconfiguring service cognito-identity to use http://localhost:4591
Serverless: Reconfiguring service ecs to use http://localhost:4601
Serverless: Reconfiguring service eks to use http://localhost:4602
Serverless: Reconfiguring service xray to use http://localhost:4603
Serverless: Reconfiguring service appsync to use http://localhost:4605
Serverless: Reconfiguring service cloudfront to use http://localhost:4606
Serverless: Reconfiguring service athena to use http://localhost:4607
Serverless: Warning: Unable to find plugin named: TypeScriptPlugin
Serverless: config.options_stage: development
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: development
Serverless: config.stage: development
Serverless: config.options_stage: development
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: development
Serverless: config.stage: development
Serverless: Using deployment bucket 'shift-planner-asyncjobs'
Serverless: Compiling with Typescript...
Serverless: Using local tsconfig.json
Serverless: Typescript compiled.
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Service files not changed. Skipping deployment...
Service Information
service: shift-planner-asyncjobs
stage: development
region: eu-west-1
stack: shift-planner-asyncjobs-development
resources: 5
api keys:
  None
endpoints:
  None
functions:
  shiftPublishedEmails: shift-planner-asyncjobs-development-shiftPublishedEmails
layers:
  None

Stack Outputs
ServerlessDeploymentBucketName: shift-planner-asyncjobs
ShiftPublishedEmailsLambdaFunctionQualifiedArn: ShiftPublishedEmailsLambdaVersionFBinxqNcQ4hoU4l1I0378dVUKpD30oJdG3FSg4Xf0

Serverless: Recoverable error occurred (connect ECONNREFUSED 127.0.0.1:4567), sleeping for ~6 seconds. Try 1 of 4
Serverless: Recoverable error occurred (connect ECONNREFUSED 127.0.0.1:4567), sleeping for ~7 seconds. Try 2 of 4
Serverless: Recoverable error occurred (connect ECONNREFUSED 127.0.0.1:4567), sleeping for ~4 seconds. Try 3 of 4
Serverless: Recoverable error occurred (connect ECONNREFUSED 127.0.0.1:4567), sleeping for ~7 seconds. Try 4 of 4

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

  connect ECONNREFUSED 127.0.0.1:4567

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

  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              12.16.1
     Framework Version:         1.65.0
     Plugin Version:            3.4.1
     SDK Version:               2.3.0
     Components Version:        2.22.3

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] deploy-localstack: `node --max-old-space-size=4096 node_modules/serverless/bin/serverless --stage development deploy --verbose`
npm ERR! Exit status 1here is the serverless file:
service:
  name: shift-planner-asyncjobs

plugins:
  - serverless-deployment-bucket
  - serverless-localstack
  - serverless-plugin-typescript
  - serverless-offline

provider:
  name: aws
  runtime: nodejs12.x
  region: 'eu-west-1'
  stage: ${opt:stage, 'development'}
  memorySize: 512
  deploymentBucket:
    name: shift-planner-asyncjobs
    serverSideEncryption: AES256
  tracing:
    apiGateway: true
    lambda: true
  environment:
    ENV: ${self:provider.stage, 'development'}
    REGION: 'eu-west-1'

custom:
  localstack:
    stages:
      - development
    debug: true
    host: 'http://localhost'

functions:
  publishedEmails:
    handler: handler.someHandler
    events:
      - sqs:
          arn:
            Fn::Join:
              - ':'
              - - arn
                - aws
                - sqs
                - Ref: AWS::Region
                - Ref: AWS::AccountId
                - queueName

I compared the logs of the two versions and seems like in the version 1.65.0 i am missing this part here :

Serverless: Using custom endpoint for S3: http://localhost:4572
Serverless: Using custom endpoint for CloudFormation: http://localhost:4581
Serverless: Using custom endpoint for S3: http://localhost:4572
Serverless: Using custom endpoint for S3: http://localhost:4572
Serverless: Using custom endpoint for Lambda: http://localhost:4574
Serverless: Using custom endpoint for STS: http://localhost:4592
Serverless: Uploading CloudFormation file to S3...
Serverless: Using custom endpoint for S3: http://localhost:4572
Serverless: Uploading artifacts...
Serverless: Uploading service shift-planner-asyncjobs.zip file to S3 (7.57 MB)...
Serverless: Using custom endpoint for S3: http://localhost:4572
Serverless: Validating template...
Serverless: Skipping template validation: Unsupported in Localstack
Serverless: Creating Stack...
Serverless: Using custom endpoint for CloudFormation: http://localhost:4581
Serverless: Overriding S3 templateUrl to http://localhost:4572
Serverless: Checking Stack create progress...
Serverless: Using custom endpoint for CloudFormation: http://localhost:4581
CloudFormation - CREATE_COMPLETE - AWS::CloudFormation::Stack - shift-planner-asyncjobs-development
Serverless: Stack create finished...
Serverless: Using custom endpoint for CloudFormation: http://localhost:4581
Serverless: Using custom endpoint for CloudFormation: http://localhost:4581

after checking the code in the repo, I noticed that most of these logs come from the function 'interceptRequest(service, method, params)'

the lambda function works as expected, but this error message keeps on popping off after each deploy. prior I was using serverless 1.53.0 and everything was smooth

┆Issue is synchronized with this Jira Task by Unito

terios avatar Mar 05 '20 14:03 terios

Getting a similar problem.

DanielWFrancis avatar Jun 08 '20 19:06 DanielWFrancis

Plus 1, getting this issue, and my sls deploy error is

The specified bucket is not valid

jameswoodley avatar Jun 25 '20 15:06 jameswoodley

This error was driving me crazy. Not sure what caused it, but enabling sudo option for docker (see config below) did the trick.

autostart: true  
    lambda:
      mountCode: false
    docker:
      sudo: true

"serverless-localstack": "^0.4.24",

asilluron avatar Jul 17 '20 04:07 asilluron

Closing the ticket due to inactivity. From the conversation it also seems the issue was resolved.

steffyP avatar Oct 13 '23 09:10 steffyP