Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error while deploy serverless stack #3969

Closed
pravin-raha opened this issue May 5, 2021 · 5 comments
Closed

Getting error while deploy serverless stack #3969

pravin-raha opened this issue May 5, 2021 · 5 comments
Assignees
Labels
area: integration/serverless Issues related to the Serverless Framework status: resolved/stale Closed due to staleness type: bug Bug report

Comments

@pravin-raha
Copy link

Type of request: This is a ...

[X] bug report
[ ] feature request

Detailed description

I am following serverless-localstack example to test my server-less app.

serverless.yml

service:
  name: aws-node-typescript-sqs-standard

plugins:
  - serverless-webpack
  - serverless-localstack

custom:
  localstack:
    stages:
      # list of stages for which the plugin should be enabled
      - local
    host: http://localhost  # optional - LocalStack host to connect to
    edgePort: 4566  # optional - LocalStack edge port to connect to
    autostart: true  # optional - Start LocalStack in Docker on Serverless deploy
    lambda:
      # Enable this flag to improve performance
      mountCode: True
    docker:
      # Enable this

provider:
  name: aws
  runtime: nodejs12.x
  region: us-east-1
  deploymentBucket:
    name: test-node-typescript-bucket
    serverSideEncryption: AES256
  # role: DefaultLambdaRole
  iam:
    role: arn:aws:iam::000000000000:policy/aws-node-typescript-sqs-standard-local-us-east-1-lambdaRole
    deploymentRole: arn:aws:iam::000000000000:policy/aws-node-typescript-sqs-standard-local-us-east-1-lambdaRole

functions:
  sender:
    handler: handler.sender
    events:
      - http:
          method: post
          path: sender

  receiver:
    handler: handler.receiver
    events:
      - sqs:
          arn:
            Fn::GetAtt:
              - receiverQueue
              - Arn
resources:
  Resources:
    receiverQueue:
      Type: AWS::SQS::Queue
      Properties:
        QueueName: receiverQueue

###Error while executing: SLS_DEBUG=* sls deploy --stage local

  ServerlessError: An error occurred: aws-node-typescript-sqs-standard-local - undefined.
      at /home/pravin/.nvm/versions/node/v12.16.3/lib/node_modules/serverless/lib/plugins/aws/lib/monitorStack.js:94:23
      at processTicksAndRejections (internal/process/task_queues.js:97:5)

###Localstack logs

2021-05-04T14:54:41:WARNING:localstack.utils.cloudformation.template_deployer: Error calling <bound method ClientCreator._create_api_method.<locals>._api_call of <botocore.client.Lambda object at 0x7f96ca8e23d0>> with params: {'FunctionName': 'aws-node-typescript-sqs-standard-local-sender', 'Runtime': 'nodejs12.x', 'Role': 'arn:aws:iam::000000000000:policy/aws-node-typescript-sqs-standard-local-us-east-1-lambdaRole', 'Handler': 'handler.sender', 'Code': {'S3Bucket': '__local__', 'S3Key': '/mnt/e/project/codebase/serverless-examples/aws-node-typescript-sqs-standard'}, 'Timeout': 6, 'MemorySize': 1024} for resource: {'Type': 'AWS::Lambda::Function', 'Properties': {'Code': {'S3Bucket': '__local__', 'S3Key': '/mnt/e/project/codebase/serverless-examples/aws-node-typescript-sqs-standard'}, 'Handler': 'handler.sender', 'Runtime': 'nodejs12.x', 'FunctionName': 'aws-node-typescript-sqs-standard-local-sender', 'MemorySize': 1024, 'Timeout': 6, 'Role': 'arn:aws:iam::000000000000:policy/aws-node-typescript-sqs-standard-local-us-east-1-lambdaRole'}, 'DependsOn': ['SenderLogGroup'], 'LogicalResourceId': 'SenderLambdaFunction', 'PhysicalResourceId': None, '_state_': {}}
@duongpv7 duongpv7 self-assigned this May 6, 2021
@duongpv7
Copy link
Contributor

duongpv7 commented May 9, 2021

Hi @pravin-raha,
We tried reproducing this issue and found that this serverless.yml required webpack.config.js file.
Can you share this file?

@duongpv7 duongpv7 added the status: response required Waiting for a response from the reporter label May 9, 2021
@pravin-raha
Copy link
Author

webpack.conf.js

const path = require('path');
const slsw = require('serverless-webpack');

module.exports = {
  mode: slsw.lib.webpack.isLocal ? 'development' : 'production',
  entry: slsw.lib.entries,
  devtool: 'source-map',
  resolve: {
    extensions: ['.js', '.jsx', '.json', '.ts', '.tsx'],
  },
  output: {
    libraryTarget: 'commonjs',
    path: path.join(__dirname, '.webpack'),
    filename: '[name].js',
  },
  target: 'node',
  module: {
    rules: [
      // all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
      { test: /\.tsx?$/, loader: 'ts-loader' },
    ],
  },
};

@pravin-raha
Copy link
Author

@duongpv7 duongpv7 removed the status: response required Waiting for a response from the reporter label May 19, 2021
@nrszysiak
Copy link

@duongpv7 I'm seeing the same issue on my side. Did you manage to find any solution to that?

@github-actions
Copy link

Hello 👋! It looks like this issue hasn’t been active in longer than five months. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot added the status: stale To be closed soon due to staleness label May 18, 2022
@github-actions github-actions bot added status: resolved/stale Closed due to staleness and removed status: stale To be closed soon due to staleness labels Jun 1, 2022
@github-actions github-actions bot closed this as completed Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: integration/serverless Issues related to the Serverless Framework status: resolved/stale Closed due to staleness type: bug Bug report
Projects
None yet
Development

No branches or pull requests

4 participants