labring / FastGPT

FastGPT is a knowledge-based platform built on the LLMs, offers a comprehensive suite of out-of-the-box capabilities such as data processing, RAG retrieval, and visual AI workflow orchestration, letting you easily develop and deploy complex question-answering systems without the need for extensive setup or configuration.
https://tryfastgpt.ai
Other
17.49k stars 4.69k forks source link

FastGPT对话超时并报错Connection error #973

Closed TrickStar-noob closed 7 months ago

TrickStar-noob commented 7 months ago

例行检查

你的版本

问题描述 使用Docker在本地部署FastGPT去调用SealosIO一键部署的OneAPI,其中OneAPI为SqlLite版本。 在创建应用后聊天会发生长时间未响应后报错Connection error的情况。OneAPI中没有新增调用日志,看着像是fastGPT访问OneAPI的时候出错了。 偶尔会出现调用成功的情况 image image

配置文件: `# 非 host 版本, 不使用本机代理

(不懂 Docker 的,只需要关心 OPENAI_BASE_URL 和 CHAT_API_KEY 即可!)

version: '3.3' services: pg: image: ankane/pgvector:v0.5.0 # git

image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.5.0 # 阿里云

container_name: pg
restart: always
ports: # 生产环境建议不要暴露
  - 5432:5432
networks:
  - fastgpt
environment:
  # 这里的配置只有首次运行生效。修改后,重启镜像是不会生效的。需要把持久化数据删除再重启,才有效果
  - POSTGRES_USER=username
  - POSTGRES_PASSWORD=password
  - POSTGRES_DB=postgres
volumes:
  - ./pg/data:/var/lib/postgresql/data

mongo: image: mongo:5.0.18

image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.18 # 阿里云

container_name: mongo
ports:
  - 27017:27017
networks:
  - fastgpt
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
  # 默认的用户名和密码,只有首次允许有效
  - MONGO_INITDB_ROOT_USERNAME=myname
  - MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
  - ./mongo/data:/data/db
  - ./mongodb.key:/data/mongodb.key

fastgpt: container_name: fastgpt image: ghcr.io/labring/fastgpt:latest # git

image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:latest # 阿里云

ports:
  - 3000:3000
networks:
  - fastgpt
depends_on:
  - mongo
  - pg
restart: always
environment:
  # root 密码,用户名为: root
  - DEFAULT_ROOT_PSW=1234
  # 中转地址,如果是用官方号,不需要管。务必加 /v1
  - OPENAI_BASE_URL=https://****.cloud.sealos.io/v1
  - CHAT_API_KEY=sk-*****
  - DB_MAX_LINK=5 # database max link
  - TOKEN_KEY=any
  - ROOT_KEY=root_key
  - FILE_TOKEN_KEY=filetoken
  # mongo 配置,不需要改. 用户名myname,密码mypassword。
  - MONGODB_URI=mongodb://myname:mypassword@mongo:27017/fastgpt?authSource=admin
  # pg配置. 不需要改
  - PG_URL=postgresql://username:password@pg:5432/postgres
volumes:
  - ./config.json:/app/data/config.json

networks: fastgpt: `

复现步骤 fastGPT和OneAPI均参考文档部署。

zaite commented 7 months ago

是不是用的V4.6.9版本?刚早上我试着升级,也出现这个报错,又回退到V4.6.8版本

c121914yu commented 7 months ago

没遇到哎,有时候可以,基本是你网络不通

zaite commented 7 months ago

我尝试使用v4.6.9 版本升级后就出现了这个问题,用不了,只能恢复快照,回退版本🥲

c121914yu commented 7 months ago

待会打个镜像

zaite commented 7 months ago

用了昨晚更新的latest镜像,还是一样的问题,部署文件要重新修改配置?

c121914yu commented 7 months ago

用了昨晚更新的latest镜像,还是一样的问题,部署文件要重新修改配置?

不用。那就不懂了,可能就是你网络问题吧。

zaite commented 7 months ago

用了昨晚更新的latest镜像,还是一样的问题,部署文件要重新修改配置?

不用。那就不懂了,可能就是你网络问题吧。

回退到4.6.8就没有这个报错,流畅的很

c121914yu commented 7 months ago

用了昨晚更新的latest镜像,还是一样的问题,部署文件要重新修改配置?

不用。那就不懂了,可能就是你网络问题吧。

回退到4.6.8就没有这个报错,流畅的很

那就等复现了再看吧,反正看了几个都反馈ok了,本地复现不了。

zaite commented 7 months ago

报错日志:

[ERROR] 2024-03-12 04:43:48 sse error: Connection error. { message: 'Connection error.', stack: 'Error: Connection error.\n' + ' at ax.makeRequest (/app/projects/app/.next/server/chunks/53204.js:21:81975)\n' + ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' + ' at async g (/app/projects/app/.next/server/chunks/1492.js:75:422)\n' + ' at async Object.T [as classifyQuestion] (/app/projects/app/.next/server/chunks/1492.js:70:903)\n' + ' at async I (/app/projects/app/.next/server/chunks/1492.js:85:7124)\n' + ' at async Promise.all (index 0)\n' + ' at async Promise.all (index 0)\n' + ' at async O (/app/projects/app/.next/server/chunks/1492.js:85:8194)\n' + ' at async /app/projects/app/.next/server/pages/api/v1/chat/completions.js:1:4289' }

c121914yu commented 7 months ago

有人遇到的话,可提供详细调用日志~ 最好有request config

muzhi1991 commented 7 months ago

同样的问题,mongo的日志一直错误 PS:我是全新安装的,第一步登录就不行。直接docker-compose up -d

server请求mongo错误

[ERROR] 2024-03-12 06:50:09 response error: Operation `users.findOne()` buffering timed out after 10000ms
{
  message: 'Operation `users.findOne()` buffering timed out after 10000ms',
  stack: 'MongooseError: Operation `users.findOne()` buffering timed out after 10000ms\n' +
    '    at Timeout.<anonymous> (/app/projects/app/.next/server/chunks/75165.js:139:1479)\n' +
    '    at listOnTimeout (node:internal/timers:569:17)\n' +
    '    at process.processTimers (node:internal/timers:512:7)'
}
error-> mongo connect error u [MongooseServerSelectionError]: Server selection timed out after 30000 ms
    at S (/app/projects/app/.next/server/chunks/75165.js:40:71)
    at O.openUri (/app/projects/app/.next/server/chunks/75165.js:48:1206)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async r (/app/projects/app/.next/server/chunks/5182.js:2:3224)
    at async g (/app/projects/app/.next/server/chunks/5182.js:54:1176)
    at async y (/app/projects/app/.next/server/chunks/5182.js:54:274) {

mongo log;

{"t":{"$date":"2024-03-12T06:52:00.679+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"192.168.208.4:55488","uuid":"22815935-5274-4352-8ae2-70f0b2a22d91","connectionId":3,"connectionCount":1}}
{"t":{"$date":"2024-03-12T06:52:00.680+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn3","msg":"client metadata","attr":{"remote":"192.168.208.4:55488","client":"conn3","doc":{"driver":{"name":"nodejs|Mongoose","version":"5.1.0"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"6.2.16-3-pve"},"platform":"Node.js v18.17.1, LE (unified)","version":"5.1.0|7.0.2"}}}
{"t":{"$date":"2024-03-12T06:52:00.852+00:00"},"s":"I",  "c":"-",        "id":4939300, "ctx":"monitoring-keys-for-HMAC","msg":"Failed to refresh key cache","attr":{"error":"NotYetInitialized: Cannot use non-local read concern until replica set is finished initializing.","nextWakeupMillis":7800}}
{"t":{"$date":"2024-03-12T06:52:08.657+00:00"},"s":"I",  "c":"-",        "id":4939300, "ctx":"monitoring-keys-for-HMAC","msg":"Failed to refresh key cache","attr":{"error":"NotYetInitialized: Cannot use non-local read concern until replica set is finished initializing.","nextWakeupMillis":8000}}
{"t":{"$date":"2024-03-12T06:52:11.181+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"192.168.208.4:54982","uuid":"b9c9de63-84a8-4f1e-8112-27f53ac24d16","connectionId":4,"connectionCount":2}}
{"t":{"$date":"2024-03-12T06:52:11.182+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn4","msg":"client metadata","attr":{"remote":"192.168.208.4:54982","client":"conn4","doc":{"driver":{"name":"nodejs|Mongoose","version":"5.1.0"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"6.2.16-3-pve"},"platform":"Node.js v18.17.1, LE (unified)","version":"5.1.0|7.0.2"}}}
{"t":{"$date":"2024-03-12T06:52:16.661+00:00"},"s":"I",  "c":"-",        "id":4939300, "ctx":"monitoring-keys-for-HMAC","msg":"Failed to refresh key cache","attr":{"error":"NotYetInitialized: Cannot use non-local read concern until replica set is finished initializing.","nextWakeupMillis":8200}}
{"t":{"$date":"2024-03-12T06:52:24.869+00:00"},"s":"I",  "c":"-",        "id":4939300, "ctx":"monitoring-keys-for-HMAC","msg":"Failed to refresh key cache","attr":{"error":"NotYetInitialized: Cannot use non-local read concern until replica set is finished initializing.","nextWakeupMillis":8400}}
{"t":{"$date":"2024-03-12T06:52:30.688+00:00"},"s":"I",  "c":"-",        "id":20883,   "ctx":"conn3","msg":"Interrupted operation as its client disconnected","attr":{"opId":18966}}
{"t":{"$date":"2024-03-12T06:52:30.688+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn4","msg":"Connection ended","attr":{"remote":"192.168.208.4:54982","uuid":"b9c9de63-84a8-4f1e-8112-27f53ac24d16","connectionId":4,"connectionCount":1}}
{"t":{"$date":"2024-03-12T06:52:30.688+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn3","msg":"Connection ended","attr":{"remote":"192.168.208.4:55488","uuid":"22815935-5274-4352-8ae2-70f0b2a22d91","connectionId":3,"connectionCount":0}}
{"t":{"$date":"2024-03-12T06:52:32.613+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"Checkpointer","msg":"WiredTiger message","attr":{"message":"[1710226352:613358][1:0x7f510e903700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 56, snapshot max: 56 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 7"}}
{"t":{"$date":"2024-03-12T06:52:33.274+00:00"},"s":"I",  "c":"-",        "id":4939300, "ctx":"monitoring-keys-for-HMAC","msg":"Failed to refresh key cache","attr":{"error":"NotYetInitialized: Cannot use non-local read concern until replica set is finished initializing.","nextWakeupMillis":8600}}
{"t":{"$date":"2024-03-12T06:52:41.883+00:00"},"s":"I",  "c":"-",        "id":4939300, "ctx":"monitoring-keys-for-HMAC","msg":"Failed to refresh key cache","attr":{"error":"NotYetInitialized: Cannot use non-local read concern until replica set is finished initializing.","nextWakeupMillis":8800}}
{"t":{"$date":"2024-03-12T06:52:50.688+00:00"},"s":"I",  "c":"-",        "id":4939300, "ctx":"monitoring-keys-for-HMAC","msg":"Failed to refresh key cache","attr":{"error":"NotYetInitialized: Cannot use non-local read concern until replica set is finished initializing.","nextWakeupMillis":9000}}
muzhi1991 commented 7 months ago

同样的问题,mongo的日志一直错误 PS:我是全新安装的,第一步登录就不行。直接docker-compose up -d

server请求mongo错误

[ERROR] 2024-03-12 06:50:09 response error: Operation `users.findOne()` buffering timed out after 10000ms
{
  message: 'Operation `users.findOne()` buffering timed out after 10000ms',
  stack: 'MongooseError: Operation `users.findOne()` buffering timed out after 10000ms\n' +
    '    at Timeout.<anonymous> (/app/projects/app/.next/server/chunks/75165.js:139:1479)\n' +
    '    at listOnTimeout (node:internal/timers:569:17)\n' +
    '    at process.processTimers (node:internal/timers:512:7)'
}
error-> mongo connect error u [MongooseServerSelectionError]: Server selection timed out after 30000 ms
    at S (/app/projects/app/.next/server/chunks/75165.js:40:71)
    at O.openUri (/app/projects/app/.next/server/chunks/75165.js:48:1206)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async r (/app/projects/app/.next/server/chunks/5182.js:2:3224)
    at async g (/app/projects/app/.next/server/chunks/5182.js:54:1176)
    at async y (/app/projects/app/.next/server/chunks/5182.js:54:274) {

mongo log;

{"t":{"$date":"2024-03-12T06:52:00.679+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"192.168.208.4:55488","uuid":"22815935-5274-4352-8ae2-70f0b2a22d91","connectionId":3,"connectionCount":1}}
{"t":{"$date":"2024-03-12T06:52:00.680+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn3","msg":"client metadata","attr":{"remote":"192.168.208.4:55488","client":"conn3","doc":{"driver":{"name":"nodejs|Mongoose","version":"5.1.0"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"6.2.16-3-pve"},"platform":"Node.js v18.17.1, LE (unified)","version":"5.1.0|7.0.2"}}}
{"t":{"$date":"2024-03-12T06:52:00.852+00:00"},"s":"I",  "c":"-",        "id":4939300, "ctx":"monitoring-keys-for-HMAC","msg":"Failed to refresh key cache","attr":{"error":"NotYetInitialized: Cannot use non-local read concern until replica set is finished initializing.","nextWakeupMillis":7800}}
{"t":{"$date":"2024-03-12T06:52:08.657+00:00"},"s":"I",  "c":"-",        "id":4939300, "ctx":"monitoring-keys-for-HMAC","msg":"Failed to refresh key cache","attr":{"error":"NotYetInitialized: Cannot use non-local read concern until replica set is finished initializing.","nextWakeupMillis":8000}}
{"t":{"$date":"2024-03-12T06:52:11.181+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"192.168.208.4:54982","uuid":"b9c9de63-84a8-4f1e-8112-27f53ac24d16","connectionId":4,"connectionCount":2}}
{"t":{"$date":"2024-03-12T06:52:11.182+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn4","msg":"client metadata","attr":{"remote":"192.168.208.4:54982","client":"conn4","doc":{"driver":{"name":"nodejs|Mongoose","version":"5.1.0"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"6.2.16-3-pve"},"platform":"Node.js v18.17.1, LE (unified)","version":"5.1.0|7.0.2"}}}
{"t":{"$date":"2024-03-12T06:52:16.661+00:00"},"s":"I",  "c":"-",        "id":4939300, "ctx":"monitoring-keys-for-HMAC","msg":"Failed to refresh key cache","attr":{"error":"NotYetInitialized: Cannot use non-local read concern until replica set is finished initializing.","nextWakeupMillis":8200}}
{"t":{"$date":"2024-03-12T06:52:24.869+00:00"},"s":"I",  "c":"-",        "id":4939300, "ctx":"monitoring-keys-for-HMAC","msg":"Failed to refresh key cache","attr":{"error":"NotYetInitialized: Cannot use non-local read concern until replica set is finished initializing.","nextWakeupMillis":8400}}
{"t":{"$date":"2024-03-12T06:52:30.688+00:00"},"s":"I",  "c":"-",        "id":20883,   "ctx":"conn3","msg":"Interrupted operation as its client disconnected","attr":{"opId":18966}}
{"t":{"$date":"2024-03-12T06:52:30.688+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn4","msg":"Connection ended","attr":{"remote":"192.168.208.4:54982","uuid":"b9c9de63-84a8-4f1e-8112-27f53ac24d16","connectionId":4,"connectionCount":1}}
{"t":{"$date":"2024-03-12T06:52:30.688+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn3","msg":"Connection ended","attr":{"remote":"192.168.208.4:55488","uuid":"22815935-5274-4352-8ae2-70f0b2a22d91","connectionId":3,"connectionCount":0}}
{"t":{"$date":"2024-03-12T06:52:32.613+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"Checkpointer","msg":"WiredTiger message","attr":{"message":"[1710226352:613358][1:0x7f510e903700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 56, snapshot max: 56 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 7"}}
{"t":{"$date":"2024-03-12T06:52:33.274+00:00"},"s":"I",  "c":"-",        "id":4939300, "ctx":"monitoring-keys-for-HMAC","msg":"Failed to refresh key cache","attr":{"error":"NotYetInitialized: Cannot use non-local read concern until replica set is finished initializing.","nextWakeupMillis":8600}}
{"t":{"$date":"2024-03-12T06:52:41.883+00:00"},"s":"I",  "c":"-",        "id":4939300, "ctx":"monitoring-keys-for-HMAC","msg":"Failed to refresh key cache","attr":{"error":"NotYetInitialized: Cannot use non-local read concern until replica set is finished initializing.","nextWakeupMillis":8800}}
{"t":{"$date":"2024-03-12T06:52:50.688+00:00"},"s":"I",  "c":"-",        "id":4939300, "ctx":"monitoring-keys-for-HMAC","msg":"Failed to refresh key cache","attr":{"error":"NotYetInitialized: Cannot use non-local read concern until replica set is finished initializing.","nextWakeupMillis":9000}}

找到问题,mongo要手动初始化一下。。https://doc.fastai.site/docs/development/docker/#五初始化-mongo-副本集468以前可忽略

zaite commented 7 months ago

用了昨晚更新的latest镜像,还是一样的问题,部署文件要重新修改配置?

不用。那就不懂了,可能就是你网络问题吧。

回退到4.6.8就没有这个报错,流畅的很

那就等复现了再看吧,反正看了几个都反馈ok了,本地复现不了。

经过测试,是配置文件OPENAI_BASE_URL设置的接口问题,V4.6.9版本以前支持本机http://ip:3000/v1 这样的方式(如:http://127.0.0.1:3000/v1),而V4.6.9版本好像只能使用域名或者外网ip的方式,使用本机ip是因为oneapi也部署在本机,直接本机ip加端口的方式减少路由和解析直连会提高接口的速度

c121914yu commented 7 months ago

你是在同一个 docker 网络?不是 host 模式怎么用 127.0.0.1 桥接模式直接用 容器名:端口 的连接方式。

zaite commented 7 months ago

你是在同一个 docker 网络?不是 host 模式怎么用 127.0.0.1

同一台服务器不同 docker 网络,fastgpt映射到宿主机的3001端口,oneapi映射到3000端口,升级4.6.9之前,4.6.8版本用http://127.0.0.1:3000/v1连的onepi真的可以

c121914yu commented 7 months ago

你是在同一个 docker 网络?不是 host 模式怎么用 127.0.0.1

同一台服务器不同 docker 网络,fastgpt映射到宿主机的3001端口,oneapi映射到3000端口,升级4.6.9之前,4.6.8版本用http://127.0.0.1:3000/v1连的onepi真的可以

你这个就离谱了,都是违背基础网络知识。

isinry commented 7 months ago

你在同一个 docker 网络?不是主机模式怎么用 127.0.0.1

同一台服务器不同的docker网络,fastgpt映射到一台机的3001端口,oneapi映射到3000端口,升级4.6.9之前,4.6.8版本用http://127.0.0.1:3000/v1连的onepi真的可以

你这个就离谱了,都是破坏基础网络知识的。

我的配置也不行,容器内能直接相互ping通

WX20240313-111550@2x

image image
isinry commented 7 months ago

在mongo日志里能看到建立连接

image
raulming commented 7 months ago

2024-03-22 12:10:05 ▲ Next.js 13.5.2 2024-03-22 12:10:05 - Local: http://e3313a30e256:3000 2024-03-22 12:10:05 - Network: http://172.22.0.4:3000 2024-03-22 12:10:05 2024-03-22 12:10:05 ✓ Ready in 247ms 2024-03-22 12:10:16 mongo start connect 2024-03-22 12:10:16 System Version: 4.6.9 2024-03-22 12:10:16 { 2024-03-22 12:10:16 feConfigs: { 2024-03-22 12:10:16 show_emptyChat: true, 2024-03-22 12:10:16 show_git: true, 2024-03-22 12:10:16 docUrl: 'https://doc.fastgpt.in', 2024-03-22 12:10:16 openAPIDocUrl: 'https://doc.fastgpt.in/docs/development/openapi', 2024-03-22 12:10:16 systemTitle: 'FastGPT', 2024-03-22 12:10:16 concatMd: ' 项目开源地址: FastGPT GitHub\n' + 2024-03-22 12:10:16 ' 交流群: ', 2024-03-22 12:10:16 limit: { exportDatasetLimitMinutes: 0, websiteSyncLimitMinuted: 0 }, 2024-03-22 12:10:16 scripts: [], 2024-03-22 12:10:16 favicon: '/favicon.ico', 2024-03-22 12:10:16 uploadFileMaxSize: 500, 2024-03-22 12:10:16 isPlus: false 2024-03-22 12:10:16 }, 2024-03-22 12:10:16 systemEnv: { 2024-03-22 12:10:16 openapiPrefix: 'fastgpt', 2024-03-22 12:10:16 vectorMaxProcess: 15, 2024-03-22 12:10:16 qaMaxProcess: 15, 2024-03-22 12:10:16 pgHNSWEfSearch: 100 2024-03-22 12:10:16 }, 2024-03-22 12:10:16 subPlans: undefined, 2024-03-22 12:10:16 llmModels: [ 2024-03-22 12:10:16 { 2024-03-22 12:10:16 model: 'ollama', 2024-03-22 12:10:16 name: 'ollama', 2024-03-22 12:10:16 maxContext: 16000, 2024-03-22 12:10:16 maxResponse: 4000, 2024-03-22 12:10:16 quoteMaxToken: 13000, 2024-03-22 12:10:16 maxTemperature: 1.2, 2024-03-22 12:10:16 censor: false, 2024-03-22 12:10:16 vision: false, 2024-03-22 12:10:16 price: 0, 2024-03-22 12:10:16 defaultSystemChatPrompt: '' 2024-03-22 12:10:16 }, 2024-03-22 12:10:16 { 2024-03-22 12:10:16 model: 'gpt-3.5-turbo', 2024-03-22 12:10:16 name: 'gpt-3.5-turbo', 2024-03-22 12:10:16 maxContext: 16000, 2024-03-22 12:10:16 avatar: '/imgs/model/openai.svg', 2024-03-22 12:10:16 maxResponse: 4000, 2024-03-22 12:10:16 quoteMaxToken: 13000, 2024-03-22 12:10:16 maxTemperature: 1.2, 2024-03-22 12:10:16 charsPointsPrice: 0, 2024-03-22 12:10:16 censor: false, 2024-03-22 12:10:16 vision: false, 2024-03-22 12:10:16 datasetProcess: true, 2024-03-22 12:10:16 usedInClassify: true, 2024-03-22 12:10:16 usedInExtractFields: true, 2024-03-22 12:10:16 usedInToolCall: true, 2024-03-22 12:10:16 usedInQueryExtension: true, 2024-03-22 12:10:16 toolChoice: true, 2024-03-22 12:10:16 functionCall: true, 2024-03-22 12:10:16 customCQPrompt: '', 2024-03-22 12:10:16 customExtractPrompt: '', 2024-03-22 12:10:16 defaultSystemChatPrompt: '', 2024-03-22 12:10:16 defaultConfig: {} 2024-03-22 12:10:16 }, 2024-03-22 12:10:16 { 2024-03-22 12:10:16 model: 'gpt-4-0125-preview', 2024-03-22 12:10:16 name: 'gpt-4-turbo', 2024-03-22 12:10:16 avatar: '/imgs/model/openai.svg', 2024-03-22 12:10:16 maxContext: 125000, 2024-03-22 12:10:16 maxResponse: 4000, 2024-03-22 12:10:16 quoteMaxToken: 100000, 2024-03-22 12:10:16 maxTemperature: 1.2, 2024-03-22 12:10:16 charsPointsPrice: 0, 2024-03-22 12:10:16 censor: false, 2024-03-22 12:10:16 vision: false, 2024-03-22 12:10:16 datasetProcess: false, 2024-03-22 12:10:16 usedInClassify: true, 2024-03-22 12:10:16 usedInExtractFields: true, 2024-03-22 12:10:16 usedInToolCall: true, 2024-03-22 12:10:16 usedInQueryExtension: true, 2024-03-22 12:10:16 toolChoice: true, 2024-03-22 12:10:16 functionCall: false, 2024-03-22 12:10:16 customCQPrompt: '', 2024-03-22 12:10:16 customExtractPrompt: '', 2024-03-22 12:10:16 defaultSystemChatPrompt: '', 2024-03-22 12:10:16 defaultConfig: {} 2024-03-22 12:10:16 }, 2024-03-22 12:10:16 { 2024-03-22 12:10:16 model: 'gpt-4-vision-preview', 2024-03-22 12:10:16 name: 'gpt-4-vision', 2024-03-22 12:10:16 avatar: '/imgs/model/openai.svg', 2024-03-22 12:10:16 maxContext: 128000, 2024-03-22 12:10:16 maxResponse: 4000, 2024-03-22 12:10:16 quoteMaxToken: 100000, 2024-03-22 12:10:16 maxTemperature: 1.2, 2024-03-22 12:10:16 charsPointsPrice: 0, 2024-03-22 12:10:16 censor: false, 2024-03-22 12:10:16 vision: true, 2024-03-22 12:10:16 datasetProcess: false, 2024-03-22 12:10:16 usedInClassify: false, 2024-03-22 12:10:16 usedInExtractFields: false, 2024-03-22 12:10:16 usedInToolCall: false, 2024-03-22 12:10:16 usedInQueryExtension: false, 2024-03-22 12:10:16 toolChoice: true, 2024-03-22 12:10:16 functionCall: false, 2024-03-22 12:10:16 customCQPrompt: '', 2024-03-22 12:10:16 customExtractPrompt: '', 2024-03-22 12:10:16 defaultSystemChatPrompt: '', 2024-03-22 12:10:16 defaultConfig: {} 2024-03-22 12:10:16 } 2024-03-22 12:10:16 ], 2024-03-22 12:10:16 vectorModels: [ 2024-03-22 12:10:16 { 2024-03-22 12:10:16 model: 'text-embedding-ada-002', 2024-03-22 12:10:16 name: 'Embedding-2', 2024-03-22 12:10:16 avatar: '/imgs/model/openai.svg', 2024-03-22 12:10:16 charsPointsPrice: 0, 2024-03-22 12:10:16 defaultToken: 700, 2024-03-22 12:10:16 maxToken: 3000, 2024-03-22 12:10:16 weight: 100 2024-03-22 12:10:16 }, 2024-03-22 12:10:16 { 2024-03-22 12:10:16 model: 'nomicembed', 2024-03-22 12:10:16 name: 'nomicembed', 2024-03-22 12:10:16 price: 0.1, 2024-03-22 12:10:16 defaultToken: 500, 2024-03-22 12:10:16 maxToken: 1800 2024-03-22 12:10:16 }, 2024-03-22 12:10:16 { 2024-03-22 12:10:16 model: 'm3e', 2024-03-22 12:10:16 name: 'm3e', 2024-03-22 12:10:16 price: 0.1, 2024-03-22 12:10:16 defaultToken: 500, 2024-03-22 12:10:16 maxToken: 1800 2024-03-22 12:10:16 } 2024-03-22 12:10:16 ], 2024-03-22 12:10:16 reRankModels: [], 2024-03-22 12:10:16 audioSpeechModels: [ 2024-03-22 12:10:16 { 2024-03-22 12:10:16 model: 'tts-1', 2024-03-22 12:10:16 name: 'OpenAI TTS1', 2024-03-22 12:10:16 charsPointsPrice: 0, 2024-03-22 12:10:16 voices: [Array] 2024-03-22 12:10:16 } 2024-03-22 12:10:16 ], 2024-03-22 12:10:16 whisperModel: { model: 'whisper-1', name: 'Whisper1', charsPointsPrice: 0 } 2024-03-22 12:10:16 } 2024-03-22 12:10:16 { 2024-03-22 12:10:16 communityPlugins: [ 2024-03-22 12:10:16 { 2024-03-22 12:10:16 author: 'FastGPT Team', 2024-03-22 12:10:16 templateType: 'other', 2024-03-22 12:10:16 name: '自定义反馈', 2024-03-22 12:10:16 avatar: '/imgs/module/customFeedback.svg', 2024-03-22 12:10:16 intro: '该模块被触发时,会给当前的对话记录增加一条反馈。可用于自动记录对话效果等。', 2024-03-22 12:10:16 showStatus: false, 2024-03-22 12:10:16 modules: [Array], 2024-03-22 12:10:16 id: 'community-customFeedback', 2024-03-22 12:10:16 source: 'community' 2024-03-22 12:10:16 }, 2024-03-22 12:10:16 { 2024-03-22 12:10:16 author: 'FastGPT Team', 2024-03-22 12:10:16 templateType: 'tools', 2024-03-22 12:10:16 name: 'core.module.template.textEditor', 2024-03-22 12:10:16 avatar: '/imgs/module/textEditor.svg', 2024-03-22 12:10:16 intro: 'core.module.template.textEditor intro', 2024-03-22 12:10:16 showStatus: false, 2024-03-22 12:10:16 modules: [Array], 2024-03-22 12:10:16 id: 'community-textEditor', 2024-03-22 12:10:16 source: 'community' 2024-03-22 12:10:16 }, 2024-03-22 12:10:16 { 2024-03-22 12:10:16 author: 'FastGPT Team', 2024-03-22 12:10:16 templateType: 'tools', 2024-03-22 12:10:16 name: 'core.module.template.TFSwitch', 2024-03-22 12:10:16 avatar: '/imgs/module/tfSwitch.svg', 2024-03-22 12:10:16 intro: 'core.module.template.TFSwitch intro', 2024-03-22 12:10:16 showStatus: false, 2024-03-22 12:10:16 modules: [Array], 2024-03-22 12:10:16 id: 'community-tfSwitch', 2024-03-22 12:10:16 source: 'community' 2024-03-22 12:10:16 } 2024-03-22 12:10:16 ] 2024-03-22 12:10:16 } 2024-03-22 12:10:16 mongo connected 2024-03-22 12:10:16 pg connected 2024-03-22 12:10:16 init pg successful 2024-03-22 12:10:16 [INFO] 2024-03-22 04:10:16 [QA Queue] Done 2024-03-22 12:10:16 [INFO] 2024-03-22 04:10:16 [Vector Queue] Done 2024-03-22 12:10:16 default team exist new ObjectId("65fbee872ec9b45273ca6614") 2024-03-22 12:10:16 root user init: { username: 'root', password: '1234' } 2024-03-22 12:11:00 [INFO] 2024-03-22 04:11:00 [Vector Queue] Done 2024-03-22 12:11:00 [INFO] 2024-03-22 04:11:00 [QA Queue] Done 2024-03-22 12:11:07 [ERROR] 2024-03-22 04:11:07 sse error: Connection error. 2024-03-22 12:12:00 [INFO] 2024-03-22 04:12:00 [QA Queue] Done 2024-03-22 12:12:00 [INFO] 2024-03-22 04:12:00 [Vector Queue] Done 2024-03-22 12:13:00 [INFO] 2024-03-22 04:13:00 [QA Queue] Done 2024-03-22 12:11:07 { 2024-03-22 12:11:07 message: 'Connection error.', 2024-03-22 12:11:07 stack: 'Error: Connection error.\n' + 2024-03-22 12:11:07 ' at ax.makeRequest (/app/projects/app/.next/server/chunks/53204.js:21:81975)\n' + 2024-03-22 12:11:07 ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' + 2024-03-22 12:11:07 ' at async Object.b [as chatNode] (/app/projects/app/.next/server/chunks/1492.js:85:1094)\n' + 2024-03-22 12:11:07 ' at async I (/app/projects/app/.next/server/chunks/1492.js:85:7124)\n' + 2024-03-22 12:11:07 ' at async Promise.all (index 0)\n' + 2024-03-22 12:11:07 ' at async Promise.all (index 0)\n' + 2024-03-22 12:11:07 ' at async O (/app/projects/app/.next/server/chunks/1492.js:85:8194)\n' + 2024-03-22 12:11:07 ' at async /app/projects/app/.next/server/pages/api/v1/chat/completions.js:1:4289' 2024-03-22 12:11:07 } 2024-03-22 12:13:00 [INFO] 2024-03-22 04:13:00 [Vector Queue] Done 2024-03-22 12:14:00 [INFO] 2024-03-22 04:14:00 [QA Queue] Done 2024-03-22 12:14:00 [INFO] 2024-03-22 04:14:00 [Vector Queue] Done 2024-03-22 12:15:00 [INFO] 2024-03-22 04:15:00 [QA Queue] Done 2024-03-22 12:15:00 [INFO] 2024-03-22 04:15:00 [Vector Queue] Done 2024-03-22 12:16:00 [INFO] 2024-03-22 04:16:00 [Vector Queue] Done 2024-03-22 12:16:00 [INFO] 2024-03-22 04:16:00 [QA Queue] Done 2024-03-22 12:17:00 [INFO] 2024-03-22 04:17:00 [QA Queue] Done 2024-03-22 12:17:00 [INFO] 2024-03-22 04:17:00 [Vector Queue] Done 2024-03-22 12:18:00 [INFO] 2024-03-22 04:18:00 [Vector Queue] Done 2024-03-22 12:18:00 [INFO] 2024-03-22 04:18:00 [QA Queue] Done 2024-03-22 12:19:00 [INFO] 2024-03-22 04:19:00 [QA Queue] Done 2024-03-22 12:19:00 [INFO] 2024-03-22 04:19:00 [Vector Queue] Done 2024-03-22 12:20:00 [INFO] 2024-03-22 04:20:00 [QA Queue] Done 2024-03-22 12:20:00 [INFO] 2024-03-22 04:20:00 [Vector Queue] Done 2024-03-22 12:21:00 [INFO] 2024-03-22 04:21:00 [Vector Queue] Done 2024-03-22 12:21:00 [INFO] 2024-03-22 04:21:00 [QA Queue] Done 2024-03-22 12:22:00 [INFO] 2024-03-22 04:22:00 [Vector Queue] Done 2024-03-22 12:22:00 [INFO] 2024-03-22 04:22:00 [QA Queue] Done

一样的问题,拉的最新4.6.9版本,fastpgt docker-compose文件OPENAI_BASE_URL 试过几个配置都不行: https://host.docker.internal:3002/v1 https://127.0.0.1:3002/v1 https://localhost:3002/v1

WestCraneLi commented 7 months ago

请求超时大概率是地址没写对,以下是个案例

OPENAI_BASE_URL解决方法

window:ipconfig,查询本机地址 macos:ifconfig | grep "inet " | grep -v 127.0.0.1,查询本机地址

获取到本机地址,如:10.0.1.2

找到你的one-api外露接口,比如ports: 8089:3000,第一个8089就是你外露的,也有可能是3000,毕竟fastgpt和one-api端口一致需要修改一下

那么最终结果就是

OPENAI_BASE_URL=http://10.0.1.2:8089/v1