Error when using chatmodels

Im trying to make my first AI workflow. Just a simple chat connected to an agent and a model. I have tried both Gemini and OpenAI models.
I also tried to just use the OpenAI node to check that connection and credentials work. In that node all works fine.

Feels like there is some setting I missing. But I cant figure it out

When I use the Open AI chat model I get Timeout error after a while.

TimeoutError: Request timed out. at wrapOpenAIClientError (/usr/local/lib/node_modules/n8n/node_modules/@langchain/openai/dist/utils/openai.cjs:13:17) at /usr/local/lib/node_modules/n8n/node_modules/@langchain/openai/dist/chat_models.cjs:1356:69 at processTicksAndRejections (node:internal/process/task_queues:95:5) at RetryOperation._fn (/usr/local/lib/node_modules/n8n/node_modules/p-retry/index.js:50:12)

When i try Gemini I get

TypeError: fetch failed at node:internal/deps/undici/undici:13178:13 at processTicksAndRejections (node:internal/process/task_queues:95:5) at _makeRequestInternal (/usr/local/lib/node_modules/n8n/node_modules/@langchain/google-genai/node_modules/@google/generative-ai/dist/index.js:290:20) at generateContent (/usr/local/lib/node_modules/n8n/node_modules/@langchain/google-genai/node_modules/@google/generative-ai/dist/index.js:692:22) at /usr/local/lib/node_modules/n8n/node_modules/@langchain/google-genai/dist/chat_models.cjs:332:24 at RetryOperation._fn (/usr/local/lib/node_modules/n8n/node_modules/p-retry/index.js:50:12)

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Running as UID 1000

This looks to be because the AI nodes are not respecting the HTTP proxy settings for N8n. I have created a bug report. Langchain nodes not respecting HTTP proxy settings · Issue #10901 · n8n-io/n8n · GitHub

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.