-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Cannot sam local start-api with an image without doing sam build first #3148
Comments
@Soviut All our examples are setup to use So update the |
Closing for inactivity, feel free to reopen if you have additional information or questions. |
|
I ran into this same exact issue, which still seems to be a problem. I think the issue stems from the misleading documentation in AWS SAM CLI and output from
But this "reload" functionality is not doing what is being described. I see that this was addressed in a comment at one point in #901 (comment) in which the issue is that this is "hot reload" is not "hot rebuild". Putting aside the fact that hot reload is nothing without the concept of a recompile, this is certainly confusing, since the documentation above explicitly contradicts this statement ("changes will be reflected automatically"). This should be clarified. As a sidenote, the real fix would be to have some auto rebuild, which was mentioned in the above comment as #921 ( PS: the confusion regarding this ghost "rebuild" is compounded by even more contradictory logs later down the line-- specifically, when you hit the endpoint, you see the following:
Building image? 🤔 I assume the original console output was a product of the minimal use of Docker containers in Lambda workflows back in 2019 and before, but these days everything is Dockerized and that path really needs much more first-class support from SAM. I suppose it would be easy enough to wire up a manual A) Some automatic rebuild should really be part of the standard feature set, even if it's a separate watch command, and, |
Description:
Using an image, it seems you must run
sam build
to build the image. Without it,sam local start-api
starts,but throws the following error whenever requests are sent to it.
I want to run
start-api
without a.aws-sam
directory to be able to hot reload.Steps to reproduce:
sam init
1 - AWS Quick Start Templates
2 - Image
1 - amazon/nodejs14.x-base
sam-app
sam local start-api
http://localhost:3000/hello
Observed result:
I get the following 502 error.
Expected result:
The request would go through without error and respond.
Additionally, I would be able to hot reload when I made changes to my code.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: 1.27.2DEBUG Enabled
Add --debug flag to command you are running
The text was updated successfully, but these errors were encountered: