[GH-ISSUE #4351] Azure OpenAI connection error while connecting from AnythingLLM hosted behind proxy #2772

Closed
opened 2026-02-22 18:31:10 -05:00 by yindo · 1 comment
Owner

Originally created by @yeldhomathew on GitHub (Sep 1, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4351

I have hosted Anything LLM (as docker container) behind proxy where below url are whitelisted already.

cdn.anythingllm.com
hf.co/huggingface.co
cdn.huggingface.co
api.huggingface.co
huggingface.com
https://raw.githubusercontent.com

I am also able to connect using curl *openai.azure.com and whitelisted urls from the AnythingLLM container except cdn.huggingface.co and api.huggingface.co. I am getting certificate issue like below while doing curl

< HTTP/1.1 200 Connection established
<

  • Proxy replied 200 to CONNECT request
  • CONNECT phase completed!
  • ALPN, offering h2
  • ALPN, offering http/1.1
  • CAfile: /etc/ssl/certs/ca-certificates.crt
  • CApath: /etc/ssl/certs
  • TLSv1.0 (OUT), TLS header, Certificate Status (22):
  • TLSv1.3 (OUT), TLS handshake, Client hello (1):
  • TLSv1.2 (IN), TLS header, Certificate Status (22):
  • TLSv1.3 (IN), TLS handshake, Server hello (2):
  • TLSv1.2 (IN), TLS header, Finished (20):
  • TLSv1.2 (IN), TLS header, Supplemental data (23):
  • TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
  • TLSv1.2 (IN), TLS header, Supplemental data (23):
  • TLSv1.3 (IN), TLS handshake, Certificate (11):
  • TLSv1.2 (OUT), TLS header, Unknown (21):
  • TLSv1.3 (OUT), TLS alert, unknown CA (560):
  • SSL certificate problem: unable to get local issuer certificate
  • Closing connection 0
    curl: (60) SSL certificate problem: unable to get local issuer certificate

Will it be the reason i am getting connection error from docker logs

[collector] info: [TikTokenTokenizer] Initialized new TikTokenTokenizer instance.
[collector] info: Collector hot directory and tmp storage wiped!
[collector] info: Document processor app listening on port 8888
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma

✔ Generated Prisma Client (v5.3.1) to ./node_modules/@prisma/client in 421ms

Start using Prisma Client in Node.js (See: https://pris.ly/d/client)

import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()

or start using Prisma Client at the edge (See: https://pris.ly/d/accelerate)

import { PrismaClient } from '@prisma/client/edge'
const prisma = new PrismaClient()

See other ways of importing Prisma Client: http://pris.ly/d/importing-client

npm notice
npm notice New major version of npm available! 10.8.2 -> 11.5.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.5.2
npm notice To update run: npm install -g npm@11.5.2
npm notice
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": SQLite database "anythingllm.db" at "file:../storage/anythingllm.db"

32 migrations found in prisma/migrations

No pending migrations to apply.
[backend] info: [EncryptionManager] Loaded existing key & salt for encrypting arbitrary data.
[backend] info: [TokenManager] Initialized new TokenManager instance for model: gpt-3.5-turbo
[backend] info: [ContextWindowFinder] Pulling remote model map...
[backend] info: [TokenManager] Returning existing instance for model: gpt-3.5-turbo
[backend] info: [TELEMETRY ENABLED] Anonymous Telemetry enabled. Telemetry helps Mintplex Labs Inc improve AnythingLLM.
[backend] info: prisma:info Starting a sqlite pool with 17 connections.
[backend] info: [TELEMETRY SENT] {"event":"server_boot","distinctId":"793783b2-0aea-4e13-9862-55481af8b9bd","properties":{"commit":"--","runtime":"docker"}}
[backend] info: [CommunicationKey] RSA key pair generated for signed payloads within AnythingLLM services.
[backend] info: [EncryptionManager] Loaded existing key & salt for encrypting arbitrary data.
[backend] info: Primary server in HTTP mode listening on port 3001
[backend] info: [BackgroundWorkerService] Feature is not enabled and will not be started.
[backend] info: [MetaGenerator] fetching custom meta tag settings...
[backend] info: [ContextWindowFinder] Error syncing remote model map TypeError: fetch failed
at node:internal/deps/undici/undici:12637:11
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async #pullRemoteModelMap (/app/server/utils/AiProviders/modelMap/index.js:99:37)
[backend] info: [NativeEmbedder] Initialized Xenova/all-MiniLM-L6-v2
[backend] info: [AzureOpenAi] Initialized. Model "gpt-4o" @ 128000 tokens.
API-Version: 2024-12-01-preview.
Model Type: default
[backend] info: [fillSourceWindow] Need to backfill 4 chunks to fill in the source window for RAG!
[backend] info: [TokenManager] Initialized new TokenManager instance for model: gpt-4o
[backend] error: Error: Connection error.
at AzureOpenAI.makeRequest (/app/server/node_modules/openai/core.js:332:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AzureOpenAiLLM.streamGetChatCompletion (/app/server/utils/AiProviders/azureOpenAi/index.js:171:7)
at async streamChatWithWorkspace (/app/server/utils/chats/stream.js:248:20)
at async /app/server/endpoints/chat.js:63:9

Originally created by @yeldhomathew on GitHub (Sep 1, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4351 I have hosted Anything LLM (as docker container) behind proxy where below url are whitelisted already. cdn.anythingllm.com hf.co/huggingface.co cdn.huggingface.co api.huggingface.co huggingface.com https://raw.githubusercontent.com I am also able to connect using curl *openai.azure.com and whitelisted urls from the AnythingLLM container except **cdn.huggingface.co** and **api.huggingface.co**. I am getting certificate issue like below while doing curl > < HTTP/1.1 200 Connection established < * Proxy replied 200 to CONNECT request * CONNECT phase completed! * ALPN, offering h2 * ALPN, offering http/1.1 * CAfile: /etc/ssl/certs/ca-certificates.crt * CApath: /etc/ssl/certs * TLSv1.0 (OUT), TLS header, Certificate Status (22): * TLSv1.3 (OUT), TLS handshake, Client hello (1): * TLSv1.2 (IN), TLS header, Certificate Status (22): * TLSv1.3 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), TLS header, Finished (20): * TLSv1.2 (IN), TLS header, Supplemental data (23): * TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8): * TLSv1.2 (IN), TLS header, Supplemental data (23): * TLSv1.3 (IN), TLS handshake, Certificate (11): * TLSv1.2 (OUT), TLS header, Unknown (21): * TLSv1.3 (OUT), TLS alert, unknown CA (560): * SSL certificate problem: unable to get local issuer certificate * Closing connection 0 curl: (60) SSL certificate problem: unable to get local issuer certificate Will it be the reason i am getting connection error from docker logs [collector] info: [TikTokenTokenizer] Initialized new TikTokenTokenizer instance. [collector] info: Collector hot directory and tmp storage wiped! [collector] info: Document processor app listening on port 8888 Environment variables loaded from .env Prisma schema loaded from prisma/schema.prisma ✔ Generated Prisma Client (v5.3.1) to ./node_modules/@prisma/client in 421ms Start using Prisma Client in Node.js (See: https://pris.ly/d/client) ``` import { PrismaClient } from '@prisma/client' const prisma = new PrismaClient() ``` or start using Prisma Client at the edge (See: https://pris.ly/d/accelerate) ``` import { PrismaClient } from '@prisma/client/edge' const prisma = new PrismaClient() ``` See other ways of importing Prisma Client: http://pris.ly/d/importing-client npm notice npm notice New major version of npm available! 10.8.2 -> 11.5.2 npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.5.2 npm notice To update run: npm install -g npm@11.5.2 npm notice Environment variables loaded from .env Prisma schema loaded from prisma/schema.prisma Datasource "db": SQLite database "anythingllm.db" at "file:../storage/anythingllm.db" 32 migrations found in prisma/migrations No pending migrations to apply. [backend] info: [EncryptionManager] Loaded existing key & salt for encrypting arbitrary data. [backend] info: [TokenManager] Initialized new TokenManager instance for model: gpt-3.5-turbo [backend] info: [ContextWindowFinder] Pulling remote model map... [backend] info: [TokenManager] Returning existing instance for model: gpt-3.5-turbo [backend] info: [TELEMETRY ENABLED] Anonymous Telemetry enabled. Telemetry helps Mintplex Labs Inc improve AnythingLLM. [backend] info: prisma:info Starting a sqlite pool with 17 connections. [backend] info: [TELEMETRY SENT] {"event":"server_boot","distinctId":"793783b2-0aea-4e13-9862-55481af8b9bd","properties":{"commit":"--","runtime":"docker"}} [backend] info: [CommunicationKey] RSA key pair generated for signed payloads within AnythingLLM services. [backend] info: [EncryptionManager] Loaded existing key & salt for encrypting arbitrary data. [backend] info: Primary server in HTTP mode listening on port 3001 [backend] info: [BackgroundWorkerService] Feature is not enabled and will not be started. [backend] info: [MetaGenerator] fetching custom meta tag settings... [backend] info: [ContextWindowFinder] Error syncing remote model map TypeError: fetch failed at node:internal/deps/undici/undici:12637:11 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async #pullRemoteModelMap (/app/server/utils/AiProviders/modelMap/index.js:99:37) [backend] info: [NativeEmbedder] Initialized Xenova/all-MiniLM-L6-v2 [backend] info: [AzureOpenAi] Initialized. Model "gpt-4o" @ 128000 tokens. API-Version: 2024-12-01-preview. Model Type: default [backend] info: [fillSourceWindow] Need to backfill 4 chunks to fill in the source window for RAG! [backend] info: [TokenManager] Initialized new TokenManager instance for model: gpt-4o [backend] error: Error: Connection error. at AzureOpenAI.makeRequest (/app/server/node_modules/openai/core.js:332:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AzureOpenAiLLM.streamGetChatCompletion (/app/server/utils/AiProviders/azureOpenAi/index.js:171:7) at async streamChatWithWorkspace (/app/server/utils/chats/stream.js:248:20) at async /app/server/endpoints/chat.js:63:9
yindo closed this issue 2026-02-22 18:31:10 -05:00
Author
Owner

@timothycarambat commented on GitHub (Sep 12, 2025):

I am also able to connect using curl *openai.azure.com and whitelisted urls from the AnythingLLM container except cdn.huggingface.co and api.huggingface.co.

Since we do not artificially apply any whitelisting or blocklist on our image - your connection issues are totally on your configuration or networking layer. Since you are explicitly listing URLs that are allowed, clearly something else in your config must be added to allow the TLS handshake to succeed - what specific URL that is I could not tell you.

This is entirely a client-side/sysadmin config issue and not a bug with the codebase - I am unsure what solution to propose to you.

@timothycarambat commented on GitHub (Sep 12, 2025): > I am also able to connect using curl *openai.azure.com and whitelisted urls from the AnythingLLM container except cdn.huggingface.co and api.huggingface.co. Since we do not artificially apply any whitelisting or blocklist on our image - your connection issues are totally on your configuration or networking layer. Since you are explicitly listing URLs that are allowed, clearly something else in your config must be added to allow the TLS handshake to succeed - what specific URL that is I could not tell you. This is entirely a client-side/sysadmin config issue and not a bug with the codebase - I am unsure what solution to propose to you.
yindo changed title from Azure OpenAI connection error while connecting from AnythingLLM hosted behind proxy to [GH-ISSUE #4351] Azure OpenAI connection error while connecting from AnythingLLM hosted behind proxy 2026-06-05 14:48:27 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#2772