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://fastgpt.in
Other
16.59k stars 4.42k forks source link

[BUG] 使用docker-compose self-host时登录不了,数据库报错。 #178

Closed CorrectRoadH closed 1 year ago

CorrectRoadH commented 1 year ago

表现为 点完登录卡,按扭在那里转圈,log请求在pending,过一会失败。以下是错误日志

error-> mongo connect error
生成QA错误: MongooseError: Operation `trainingdatas.findOneAndUpdate()` buffering timed out after 10000ms
    at Timeout.<anonymous> (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:175:23)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7)
/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/query.js:4927
  const castError = new CastError();
                    ^

CastError: Cast to ObjectId failed for value "" (type string) at path "_id" for model "trainingData"
    at model.Query.exec (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/query.js:4927:21)
    at Query.then (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/query.js:5026:15)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at listOnTimeout (node:internal/timers:540:9)
    at process.processTimers (node:internal/timers:514:7) {
  messageFormat: undefined,
  stringValue: '""',
  kind: 'ObjectId',
  value: '',
  path: '_id',
  reason: BSONTypeError: Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer
      at new BSONTypeError (/app/node_modules/.pnpm/registry.npmmirror.com+bson@4.7.2/node_modules/bson/lib/error.js:41:28)
      at new ObjectId (/app/node_modules/.pnpm/registry.npmmirror.com+bson@4.7.2/node_modules/bson/lib/objectid.js:67:23)
      at castObjectId (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/cast/objectid.js:25:12)
      at ObjectId.cast (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/schema/objectid.js:246:12)
      at SchemaType.applySetters (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/schematype.js:1201:12)
      at SchemaType._castForQuery (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/schematype.js:1648:15)
      at SchemaType.castForQuery (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/schematype.js:1636:15)
      at SchemaType.castForQueryWrapper (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/schematype.js:1612:20)
      at cast (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/cast.js:349:32)
      at Query.cast (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/query.js:5357:12)
      at castQuery (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/query.js:5158:18)
      at Query._findAndModify (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/query.js:3984:23)
      at model.Query.<anonymous> (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/query.js:3498:8)
      at model.Query._wrappedThunk [as _findOneAndUpdate] (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/helpers/query/wrapThunk.js:29:8)
      at /app/node_modules/.pnpm/registry.npmmirror.com+kareem@2.5.1/node_modules/kareem/index.js:497:25
      at processTicksAndRejections (node:internal/process/task_queues:77:11),
  valueType: 'string'
}

Node.js v20.5.0
Listening on port 3000 url: http://shanghai-dev:3000
{
  FeConfig: {
    show_emptyChat: true,
    show_register: false,
    show_appStore: false,
    show_userDetail: false,
    show_git: true,
    systemTitle: 'FastGPT',
    authorText: 'Made by FastGPT Team.',
    gitLoginKey: '',
    scripts: []
  },
  SystemParams: {
    gitLoginSecret: '',
    vectorMaxProcess: 15,
    qaMaxProcess: 15,
    pgIvfflatProbe: 20
  },
  plugins: {},
  ChatModels: [
    {
      model: 'gpt-3.5-turbo',
      name: 'GPT35-4k',
      contextMaxToken: 4000,
      quoteMaxToken: 2000,
      maxTemperature: 1.2,
      price: 0,
      defaultSystem: ''
    },
    {
      model: 'gpt-3.5-turbo-16k',
      name: 'GPT35-16k',
      contextMaxToken: 16000,
      quoteMaxToken: 8000,
      maxTemperature: 1.2,
      price: 0,
      defaultSystem: ''
    },
    {
      model: 'gpt-4',
      name: 'GPT4-8k',
      contextMaxToken: 8000,
      quoteMaxToken: 4000,
      maxTemperature: 1.2,
      price: 0,
      defaultSystem: ''
    }
  ],
  QAModels: [
    {
      model: 'gpt-3.5-turbo-16k',
      name: 'GPT35-16k',
      maxToken: 16000,
      price: 0
    }
  ],
  VectorModels: [
    { model: 'text-embedding-ada-002', name: 'Embedding-2', price: 0 }
  ]
}
error-> mongo connect error
生成QA错误: MongooseError: Operation `trainingdatas.findOneAndUpdate()` buffering timed out after 10000ms
    at Timeout.<anonymous> (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:175:23)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7)
/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/query.js:4927
  const castError = new CastError();
                    ^

CastError: Cast to ObjectId failed for value "" (type string) at path "_id" for model "trainingData"
    at model.Query.exec (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/query.js:4927:21)
    at Query.then (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/query.js:5026:15)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at listOnTimeout (node:internal/timers:540:9)
    at process.processTimers (node:internal/timers:514:7) {
  messageFormat: undefined,
  stringValue: '""',
  kind: 'ObjectId',
  value: '',
  path: '_id',
  reason: BSONTypeError: Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer
      at new BSONTypeError (/app/node_modules/.pnpm/registry.npmmirror.com+bson@4.7.2/node_modules/bson/lib/error.js:41:28)
      at new ObjectId (/app/node_modules/.pnpm/registry.npmmirror.com+bson@4.7.2/node_modules/bson/lib/objectid.js:67:23)
      at castObjectId (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/cast/objectid.js:25:12)
      at ObjectId.cast (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/schema/objectid.js:246:12)
      at SchemaType.applySetters (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/schematype.js:1201:12)
      at SchemaType._castForQuery (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/schematype.js:1648:15)
      at SchemaType.castForQuery (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/schematype.js:1636:15)
      at SchemaType.castForQueryWrapper (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/schematype.js:1612:20)
      at cast (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/cast.js:349:32)
      at Query.cast (/app/node_modules/.pnpm/registry.npmmirror.com+mongoose@6.10.0/node_modules/mongoose/lib/query.js:5357:12),
  valueType: 'string'
}

Node.js v20.5.0
Listening on port 3000 url: http://shanghai-dev:3000

我已确认MongoDB是正常可连接、账号密码无误

c121914yu commented 1 year ago

不清楚。但是可以肯定是没连上数据库

CorrectRoadH commented 1 year ago

不清楚。但是可以肯定是没连上数据库

定位到了,官方文档这里错了

image

端口后面的内容删掉就ok了

c121914yu commented 1 year ago

不清楚。但是可以肯定是没连上数据库

定位到了,官方文档这里错了 image 端口后面的内容删掉就ok了

奇怪,我是不加这个没法连~