lobehub / lobe-chat

🤯 Lobe Chat - an open-source, modern-design AI chat framework. Supports Multi AI Providers( OpenAI / Claude 3 / Gemini / Ollama / Azure / DeepSeek), Knowledge Base (file upload / knowledge management / RAG ), Multi-Modals (Vision/TTS) and plugin system. One-click FREE deployment of your private ChatGPT/ Claude application.
https://chat-preview.lobehub.com
Other
44.39k stars 9.95k forks source link

[Bug] docker-compose部署 向量化失败 #3867

Closed haibara1997 closed 2 months ago

haibara1997 commented 2 months ago

📦 部署环境

Docker

📌 软件版本

1

💻 系统环境

macOS

🌐 浏览器

Chrome

🐛 问题描述

报错如下

lobe-database  | embeddingChunks error {
lobe-database  |   message: '{"endpoint":"https://api.chatanywhere.***.cn/",
"error":{
"headers":{"ali-swift-global-savetime":"1725896024",
"connection":"keep-alive","content-length":"138","content-type":"text/html",
"date":"Mon, 09 Sep 2024 15:33:44 GMT","eagleid":"b4a3921b17258960227892980e",
"etag":"\\"6697fa75-8a\\"","server":"Tengine","timing-allow-origin":"*",
"via":"cache25.l2cn1821[148,147,404-1280,M], cache25.l2cn1821[149,0], 
kunlun7.cn7174[1916,1915,404-1280,M], kunlun7.cn7174[1925,0]",
"x-cache":"MISS TCP_MISS dirn:-2:-2","x-swift-cachetime":"1","x-swift-error":"orig response 4XX error",
"x-swift-savetime":"Mon, 09 Sep 2024 15:33:44 GMT"},
"stack":"Error: 404 <html>\\n<head><title>404 Not Found</title></head>\\n<body>\\n<center><h1>404 Not Found</h1></center>\\n<hr><center>nginx</center>\\n</body>\\n</html>\\n    at tb.generate (/app/.next/server/chunks/71548.js:41:58417)\\n    at rU.makeStatusError (/app/.next/server/chunks/71548.js:41:50114)\\n    at rU.makeRequest (/app/.next/server/chunks/71548.js:41:51037)\\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\\n    at async Object.embeddings (/app/.next/server/chunks/83869.js:9:3591)\\n    at async concurrency (/app/.next/server/app/trpc/async/[trpc]/route.js:1:5213)\\n    at async /app/.next/server/chunks/35260.js:32:312969","status":404},"errorType":"ProviderBizError","provider":"openai"}',
lobe-database  |   name: 'EmbeddingError'
lobe-database  | }

📷 复现步骤

No response

🚦 期望结果

No response

📝 补充信息

No response

lobehubbot commented 2 months ago

👀 @haibara1997

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.\ 非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

dosubot[bot] commented 2 months ago

@haibara1997 你好!我是一个可以帮助解决 bug、回答问题并成为贡献者的机器人。在等待人类维护者的过程中,我会尽力帮助你。

I found a similar unsolved discussion regarding vectorization failure: 向量化失败 [1].

Additionally, there is a closed issue that might be related: [Bug] 知识库分块报错. The issue was resolved by changing the network structure and using a reverse proxy service directly on the NAS instead of through the VPS [2].

The error message you provided indicates a 404 Not Found error from the API endpoint. This suggests that the endpoint URL might be incorrect or the resource is not available. Here are a few steps you can take to troubleshoot:

  1. Check the Endpoint URL: Ensure that the OPENAI_PROXY_URL or any other relevant endpoint URL is correctly configured in your environment variables.
  2. Network Configuration: Verify your network setup, especially if you are using a proxy or VPN. Ensure that the proxy settings are correctly configured.
  3. API Key and Permissions: Make sure that your API key is valid and has the necessary permissions to access the embedding service.

If the issue persists, you might want to review the configuration settings related to embedding and vectorization in the lobe-chat project. These settings are defined in the src/const/settings/llm.ts file:

export const DEFAULT_EMBEDDING_MODEL = 'text-embedding-3-small';

Additionally, the src/libs/agent-runtime/types/embeddings.ts file provides detailed interfaces for embedding payloads and options, which might help in debugging the issue:

export interface EmbeddingsPayload {
  dimensions?: number;
  input: string | Array<string>;
  model: string;
}

export interface EmbeddingsOptions {
  headers?: Record<string, any>;
  signal?: AbortSignal;
  user?: string;
}

export interface EmbeddingItem {
  embedding: Array<number>;
  index: number;
  object: 'embedding';
}

Reviewing these configurations and ensuring they are correctly set up might help resolve the issue [3][4].

To continue talking to Dosu, mention @dosu.

arvinxx commented 2 months ago

这一看就是没有 text-embedding 模型吧

lobehubbot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


It seems that there is no text-embedding model.

lobehubbot commented 2 months ago

✅ @haibara1997

This issue is closed, If you have any questions, you can comment and reply.\ 此问题已经关闭。如果您有任何问题,可以留言并回复。