Open bombond opened 7 months ago
Everything seems fine util I start to chat with the chatbot UI. An ConnectionError occurs. Here's the tracelog. Could you please kindly help?
ConnectionError: HTTPConnectionPool(host='host.docker.internal', port=8000): Max retries exceeded with url: /hospital-rag-agent (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x7f84e026d1d0>: Failed to resolve 'host.docker.internal' ([Errno -2] Name or service not known)")) Traceback: File "/usr/local/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script exec(code, module.dict) File "/app/main.py", line 102, in response = requests.post(CHATBOT_URL, json=data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/requests/api.py", line 115, in post return request("post", url, data=data, json=json, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/requests/api.py", line 59, in request return session.request(method=method, url=url, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 519, in send raise ConnectionError(e, request=request)
Facing same issue
Hey @bombond and @prasanth-ra - I'm sorry y'all are running into issues. Unfortunately, I wasn't able to reproduce the error locally. Could you provide me with the detailed steps you're taking to run the project? It would also be helpful to know which version of docker you're running because I suspect this is a docker issue.
I am using Docker version 25.0.4, build 1a576c5. When I try to access the chat api through UI , it doesn't work. Throws the below Error. Whereas I can access the API directly with docs endpoint. Great repo anyway. thanks for sharing!
Yes, we face exactly the same issue. Calling through API works fine, but connection fail when trigger from chatbot UI. BTW, my docker version 23.0.5
Okay I see. Just to confirm, you have CHATBOT_URL=http://host.docker.internal:8000/hospital-rag-agent
set in your .env
file?
Yes, I set CHATBOT_URL=http://host.docker.internal:8000/hospital-rag-agent I guess prasanth may set it to http://localhost:8000/hospital-rag-agent, as I also tried and end with exactly the same log as his
so what is solution pls
Make sure your AuraDB instance is running. I believe trial instances go on standby after not too long.
It could also be that you need to use the scc
certificate:
Note: By default, your NEO4J_URI should be similar to neo4j+s://.databases.neo4j.io. The URL scheme neo4j+s uses CA-signed certificates only, which might not work for you. If this is the case, change your URI to use the neo4j+ssc URL scheme - neo4j+ssc://.databases.neo4j.io. You can read more about what this means in the Neo4j documentation on connection protocols and security.
Thank you @asanmateu ! @Sandy4321 I've been trying to replicate the issue locally, but everything still runs successfully for me. I encountered this error when developing this project, and it was because CHATBOT_URL
wasn't set correctly. If CHATBOT_URL
is correct, then I'm not sure what might be causing the issue at this point.
If you're experiencing issues with host.docker.internal, such as connection errors or networking problems in your Docker containers, a practical solution is to use the IP address of your host machine instead of the internal hostname.
To find your host machine’s IP address, you can use the following commands depending on your operating system:
Linux and macOS: Open a terminal and type ifconfig. Look for your active network interface (often eth0 for Ethernet or wlan0 for Wi-Fi on Linux, and en0 or en1 on macOS). The IP address will be listed under inet.
Windows: Open the Command Prompt by typing cmd in the start menu, then enter ipconfig. You will find the IP address listed under IPv4 Address for the network interface you are using.
Once you have your host’s IP address, you can replace host.docker.internal with this IP in your Docker configuration or scripts, which should resolve any connectivity issues.
Found this useful in case anyone has problems connecting to Aura locally: https://stackoverflow.com/questions/52805115/certificate-verify-failed-unable-to-get-local-issuer-certificate
Everything seems fine util I start to chat with the chatbot UI. An ConnectionError occurs. Here's the tracelog. Could you please kindly help?
ConnectionError: HTTPConnectionPool(host='host.docker.internal', port=8000): Max retries exceeded with url: /hospital-rag-agent (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x7f84e026d1d0>: Failed to resolve 'host.docker.internal' ([Errno -2] Name or service not known)")) Traceback: File "/usr/local/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script exec(code, module.dict) File "/app/main.py", line 102, in
response = requests.post(CHATBOT_URL, json=data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/api.py", line 115, in post
return request("post", url, data=data, json=json, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 519, in send
raise ConnectionError(e, request=request)