-
Notifications
You must be signed in to change notification settings - Fork 16.5k
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
Langchain nodes not respecting HTTP proxy settings #10901
Comments
Hey @rasmusson, We have created an internal ticket to look into this which we will be tracking as "GHC-244" |
Hey @rasmusson, I suspect this is not specific to the Langchain nodes and is likely linked to another general issue that we have open where Axios the http package we use doesn't pick up system defined proxies correctly if it is an HTTP proxy due to a failure on the CONNECT method. |
Ok. As I understand the axios issue resulted in bad gateway error. In my case in the langchain nodes I dont get any error, the request just go straight to internet without going through the proxy. The node works just fine if I allow direct internet access but keep the system defined proxy. |
Hey @rasmusson, That sounds a bit different, How are you setting the system proxy? Assuming http_proxy and https_proxy are being set it should still work unless Langchain itself uses an http library that doesn't respect system set proxies. |
yes, http_proxy and https_proxy env vars. Im using information extractor together with open AI model |
Perfect, I have moved this to our AI team to investigate. It looks like Langchain may have an issue with proxies. |
Same issue here. Disabling http_proxy and https_proxy on an internet connected host proves the AI nodes fail when it's set. Unfortunately not an option for hosts that require a proxy |
I confirm. Even HTTP Request node doesn't work with globally set proxy:
I get:
n8n version: 1.74.3 |
@alparo that doesn't seem like an error reaching the proxy. Confirming I'm on http_proxy=http://proxy.example.com:3128
https_proxy=http://proxy.example.com:3128 And my normal HTTP requests are going via the proxy successfully... albeit not using HTTP CONNECT (another axios issue) ![]() |
Currently v1.80.5 still repro this issue. |
I investigated through the source code, confirm that open ai node does NOT respect any http_proxy setting, when it call langchain's openai client. I have fixed this issue in this commit, which is appled for a pull. |
Bug Description
When using a Langchain models like OpenAI and Gemini, HTTP calls going to the models online does not use the HTTP proxy defined for N8N. But go straight to the internet.
I found this as my N8N is not allowed to access internet directly. Allowing direct access resolves the issue
To Reproduce
Expected behavior
Preferably, the AI model nodes should use the proxy defined for n8n. If not there should be a possibility to configure proxy separately for these nodes
Operating System
Docker
n8n Version
1.59.3
Node.js Version
Provided by docker image
Database
SQLite (default)
Execution mode
main (default)
The text was updated successfully, but these errors were encountered: