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

curl: (52) Empty reply from server #42

Open
rking788 opened this issue Jul 24, 2021 · 2 comments
Open

curl: (52) Empty reply from server #42

rking788 opened this issue Jul 24, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@rking788
Copy link

I recently ran into an issue trying to test a Lambda function locally with the provided base images. My handler is written in Go. Testing with both public.ecr.aws/lambda/go:1 and public.ecr.aws/lambda/provided:al2 gives the same error when attempting to curl the handler locally.

Here are the directions I was attempting to follow to test my function locally. https://gallery.ecr.aws/lambda/go (the Usage tab)

I ended up here after finding this workaround: #26. It's my understanding that these steps shouldn't be needed when working with one of the provided Docker images. If there is a better repository to file this issue please let me know. Thanks.

@Don-CA
Copy link

Don-CA commented Oct 21, 2021

For al2, after many false starts, I copied the executable to the bootstrap location, ignoring the task root stuff and it works.


FROM public.ecr.aws/lambda/provided:al2 as build
# install compiler
RUN yum install -y golang
RUN go env -w GOPROXY=direct
# cache dependencies
ADD go.mod go.sum ./
RUN go mod download
# build
ADD . .
RUN go build -o /bootstrap
# copy artifacts to a clean image
FROM public.ecr.aws/lambda/provided:al2
COPY --from=build /bootstrap ${LAMBDA_RUNTIME_DIR}/bootstrap
CMD [ "main" ]

@ghost ghost added the bug Something isn't working label Aug 17, 2022
@fertrevino
Copy link

the same happens with images such as public.ecr.aws/lambda/nodejs:18 despite following the instructions in the usage tab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants