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
Unable to Retrieve Bot Response: ERR_NAME_NOT_RESOLVED and 403 Forbidden Error in Flask Application #6919
Comments
Thanks for opening this issue. This is the repository for AWS SAM CLI, a command line tool to manage AWS Cloudformation resources. Can you provide a project where we can reproduce this if this is a SAM CLI issue? |
The problem I'm facing involves running a Flask application on AWS Lambda with API Gateway integration. Specifically, I'm encountering errors related to loading resources (ERR_NAME_NOT_RESOLVED) and receiving a 403 Forbidden error. Would you still like me to provide a project to reproduce the issue, or do you have any suggestions on how I can resolve these errors within the context of deploying a Flask application on AWS Lambda with API Gateway? Thank you for your assistance |
Hi, could you provide the project please? It would be useful to help figuring out the root cause of your issue. |
Here are the main project files:
Main file index.html :
|
Could you add the commands of |
It is still not clear to me, can you provide more information? As far as I understand, you are trying to serve a Flask application inside your lambda function, but you are facing issues with it, is that correct? What is the reason that you are using |
Description:
I'm encountering an issue with my Flask application where I'm unable to retrieve a response from the bot when sending a query through the index.html page. Here are the details:
Problem:
When I enter a query in the input field on the index.html page and click "Send," the request is made to the "/get" endpoint in my Flask application, but I'm not receiving any response from the bot.
Steps to reproduce:
Open the index.html page in a browser.
Enter a query in the input field.
Click "Send."
Check the browser console for any errors.
Error messages:
Failed to load resource: net::ERR_NAME_NOT_RESOLVED
Failed to load resource: the server responded with a status of 403 (Forbidden)
Code snippets:
flask route:
@app.route("/get")
def get_bot_response():
print("Inside get_bot_response function") # Add this line
user_text = request.args.get('msg')
print("Received message:", user_text) # Print the user's message
bot_response = get_query_reply(user_text)
print("Bot's response:", bot_response) # Print the bot's response
headers = get_headers() # Get the headers
return jsonify(bot_response), 200, headers
Expected behavior:
After sending a query, I should receive a response from the bot displayed in the chat area on the index.html page.
Environment details:
Operating system: Windows
Browser: Google
Python version: 3.12
I would appreciate any assistance in resolving this issue. Thank you!
The text was updated successfully, but these errors were encountered: