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

[go1.x runtime deprecation] Endpoint request timed out #41

Open
leonardyhuang opened this issue Sep 11, 2023 · 10 comments
Open

[go1.x runtime deprecation] Endpoint request timed out #41

leonardyhuang opened this issue Sep 11, 2023 · 10 comments

Comments

@leonardyhuang
Copy link

Due to the go1.x runtime deprecation, I am trying to use the custom runtime provided.al2.
However, the endpoint now gives the error "Endpoint request timed out" after deployment.

Any advice is appreciated.

Here is my configuration:

service: my-service

frameworkVersion: '3'

provider:
  name: aws
  runtime: provided.al2
  architecture: arm64

  stage: ${opt:stage, 'dev'}
  region: us-east-1

  environment: ${file(.env.${self:provider.stage}.yml)}

package:
  patterns:
    - '!./**'
    - './bin/**'

functions:
  receive:
    handler: receive/main.go
    events:
      - http:
          path: ${self:custom.functionPath.${self:provider.stage}}/receive
          method: post
    timeout: 30
    memorySize: 128
  verify:
    handler: verify/main.go
    events:
      - http:
          path: ${self:custom.functionPath.${self:provider.stage}}/receive
          method: get
    timeout: 30
    memorySize: 128

custom:
  go:
    supportedRuntimes: provided.al2
    buildProvidedRuntimeAsBootstrap: true
    cmd: GOARCH=arm64 GOOS=linux go build -tags lambda.norpc -ldflags="-s -w"

plugins:
  - serverless-go-plugin
@ivaylopivanov
Copy link

I'm also trying to migrate to provided.al2 but the deploy fails. I have multiple lambdas. I have noticed that using the provided.al2 runtime does not create any entry in the .bin folder. It creates one main.zip file in the .serverless folder without any bootstrap entry file. Please advise.

@danteay
Copy link

danteay commented Sep 21, 2023

there is an issue on the plugin when adding buildProvidedRuntimeAsBootstrap as true to use provided.al2 runtime, if you don't have declared old include and exclude package options. I'll send a PR in some hours to fix this

@danteay
Copy link

danteay commented Sep 21, 2023

I've also recommend to remove the package config and let the plugin build it for you.

@danteay
Copy link

danteay commented Oct 3, 2023

Here a PR with the fix!!!
#43

@ivaylopivanov
Copy link

Thank you @danteay, will check it next week and will let you know.

@ivaylopivanov
Copy link

@danteay it seems its working, thank you! Will be performing more tests and will report back if anything pops up. Just for future reference, these are the configs that I have

  go:
    cmd: GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" # compile command
    supportedRuntimes: ["provided.al2"]
    buildProvidedRuntimeAsBootstrap: true

The yaml doesn't contain the package include or exclude properties.

@jpsolofunds
Copy link

@ivaylopivanov how do you test it if the PR is still open?

@ivaylopivanov
Copy link

@ivaylopivanov how do you test it if the PR is still open?

You can install the plugin with npm pointing to a specific commit.

@danteay
Copy link

danteay commented Oct 23, 2023

@ivaylopivanov @jpsolofunds As my PR was ghosted I've forked and modified the plugin to just work with new AWS configuration and fix other issues that I've found in the process!!

Feel free to test it and give me feedback!!

(release will come soon)

https://github.com/Drafteame/serverless-plugin-go

@yktakaha4
Copy link

yktakaha4 commented Nov 21, 2023

In my case, applying this issue's workaround did not solve the problem.
The problem was caused by an old version of aws/aws-lambda-go (eg: v1.6.0 ) , and the timeout was resolved by upgrading to latest (eg: v1.41.0. )
https://github.com/aws/aws-lambda-go/releases/tag/v1.41.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants