-
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
Internal server error when sending a request to a local endpoint after performing sam-local start-api --debug. #6600
Comments
Hi, in a normal project are you able to import that module in the first place? This does not seem like a SAM specific issue, it looks like that your project normally can not find that module in the first place. Could you help verify that the package is installed and that you are able to use it normally without SAM? If so, then that would indicate that something in SAM may be the issue. Thanks |
Thank you for responding to this issue. I believe this is a SAM related issue. I am using the same code in a Flask app as I am in the SAM app (shown below). The response in the Flask app is a string (proving that its not a code related issue). In the SAM app I am receiving an error shown below.
Flask Endpoint output:
SAM app:
SAM Endpoint Output: |
Hi, I see have you ran |
Hi, thank you for the response. Yes I ran |
Hi there, I've tried to re-produce this issue. I've the following files in my project; template.yaml
hello_world/requirements.txt
hello_world/app.py
With this setup, if I run
boto3 library still requires urllib3 v1, so I've added that into my
And after adding this I was able to invoke lambda function with no import errors. It now fails since I didn't provide OpenAI API Key but I assume you already set it in your application.
Can you add this |
Thank you so much the change worked. I am closing this issue. |
|
Description:
Thank you for taking a look at this issue. I am receiving an Internal server error when sending a request to a local endpoint after performing sam-local start-api --debug.
Steps to reproduce:
Performed a sam init and the options.chosen are below
1 (Hello World Example)
y (zip)
N (xray)
N (Cloudwatch)
lambdalab (project name)
Created a requirments.txt file containing the following text in the hello world folder
langchain==0.1.1
langchain-openai==0.0.3
Entered the code below into app.py
Then entered sam local start-api --debug in the terminal
Observed result:
Afterwards I sent a request to http://127.0.0.1:3000/hello and get the response below.
{"message":"Internal server error"}
The error in the terminal states : Unable to import module 'app': No module named 'langchain_openai'
The full message is below:
sam local start-api --debug
Expected result:
A string in the response
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: SAM CLI, version 1.94.0Add --debug flag to command you are running
The text was updated successfully, but these errors were encountered: