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
41.83k stars 9.43k forks source link

[Docs] Feedback for `self-hosting/server-database/docker-compose` #4186

Open ikiwihome opened 2 hours ago

ikiwihome commented 2 hours ago

📝 Reference

https://github.com/lobehub/lobe-chat/tree/main/docs/self-hosting/server-database/docker-compose.zh-CN.mdx

🐛 Feedback

Your response

2024-09-28 11:16:33 [Database] Start to migration... 2024-09-28 11:16:33 ✅ database migration pass. 2024-09-28 11:16:33 ------------------------------------- 2024-09-28 11:16:33 ▲ Next.js 14.2.8 2024-09-28 11:16:33 - Local: http://localhost:3210 2024-09-28 11:16:33 - Network: http://0.0.0.0:3210 2024-09-28 11:16:33 2024-09-28 11:16:33 ✓ Starting... 2024-09-28 11:16:33 ✓ Ready in 42ms 2024-09-28 11:16:48 next auth: undefined 2024-09-28 11:16:48 next auth: undefined 2024-09-28 11:16:48 {"level":30,"time":1727493408930,"pid":19,"hostname":"14600212524f","msg":"Error in tRPC handler (lambda) on path: file.getFiles, type: query"} 2024-09-28 11:16:48 {"level":30,"time":1727493408932,"pid":19,"hostname":"14600212524f","msg":"Error in tRPC handler (lambda) on path: knowledgeBase.getKnowledgeBases, type: query"} 2024-09-28 11:16:47 LOGTO_CLIENT_ID will be removed in the future. Please set AUTH_LOGTO_ID instead. 2024-09-28 11:16:47 LOGTO_CLIENT_SECRET will be removed in the future. Please set AUTH_LOGTO_SECRET instead. 2024-09-28 11:16:47 LOGTO_CLIENT_ID will be removed in the future. Please set AUTH_LOGTO_ID instead. 2024-09-28 11:16:47 LOGTO_CLIENT_SECRET will be removed in the future. Please set AUTH_LOGTO_SECRET instead. 2024-09-28 11:16:47 LOGTO_CLIENT_ID will be removed in the future. Please set AUTH_LOGTO_ID instead. 2024-09-28 11:16:47 LOGTO_CLIENT_SECRET will be removed in the future. Please set AUTH_LOGTOSECRET instead. 2024-09-28 11:16:48 a [TRPCError]: UNAUTHORIZED 2024-09-28 11:16:48 at /app/.next/server/chunks/39184.js:1:2619 2024-09-28 11:16:48 at c (/app/.next/server/chunks/27418.js:4:74) 2024-09-28 11:16:48 at r (/app/.next/server/chunks/27418.js:1:5663) 2024-09-28 11:16:48 at /app/.next/server/chunks/48718.js:1:7084 2024-09-28 11:16:48 at Array.map () 2024-09-28 11:16:48 at y (/app/.next/server/chunks/48718.js:1:6645) 2024-09-28 11:16:48 at async (/app/.next/server/app/trpc/lambda/[trpc]/route.js:1:3652) 2024-09-28 11:16:48 at async /app/nodemodules/.pnpm/next@14.2.8@babel+core@7.23.6_supports-color@8.1.1@opentelemetry+api@1.9.0_react-dom@18.3._itjmu72s7n7tov6po6nkhcdpya/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:36932 2024-09-28 11:16:48 at async eC.execute (/app/nodemodules/.pnpm/next@14.2.8@babel+core@7.23.6_supports-color@8.1.1@opentelemetry+api@1.9.0_react-dom@18.3._itjmu72s7n7tov6po6nkhcdpya/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:27548) 2024-09-28 11:16:48 at async eC.handle (/app/nodemodules/.pnpm/next@14.2.8@babel+core@7.23.6_supports-color@8.1.1__@opentelemetry+api@1.9.0_react-dom@18.3._itjmu72s7n7tov6po6nkhcdpya/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:38186) { 2024-09-28 11:16:48 code: 'UNAUTHORIZED', 2024-09-28 11:16:48 [cause]: undefined 2024-09-28 11:16:48 }

lobehubbot commented 2 hours ago

👀 @ikiwihome

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 hours ago

@ikiwihome Hello there! I'm here to assist you with any bugs, questions, or becoming a contributor. Let me know how I can help you!

I found some similar issues and discussions that might help resolve the UNAUTHORIZED error in the tRPC handler on paths file.getFiles and knowledgeBase.getKnowledgeBases:

  1. LobeChat 因授权问题无法连接至MinIO服务器: This discussion suggests ensuring that the login system is set up correctly, as the database version requires a login system to avoid authorization failures [1].

  2. 使用 Docker Compose 部署 LobeChat 服务端数据库版本时候遇到Logto 404的错误: This discussion recommends adding an Nginx configuration if using HTTPS and facing issues with Logto [2].

  3. [Bug] next-auth fetch failed with third auth provider](https://github.com/lobehub/lobe-chat/discussions/3847): This discussion suggests trying with PROXY_URL to resolve issues with third-party auth providers [3].

  4. [Bug] [TRPCError]: UNAUTHORIZED - docker + auth0/github App + 腾讯 COS](https://github.com/lobehub/lobe-chat/issues/4023): This closed issue suggests ensuring that NEXTAUTH_URL and NEXT_AUTH_SECRET are set correctly in your environment variables. Additionally, ensure that the AUTH_AUTH0_ISSUER is set to the correct domain of your Auth0 application [4].

To resolve the UNAUTHORIZED error, ensure that the authentication service is correctly configured and that the necessary environment variables are set properly. Here are the steps:

  1. Configure the Authentication Service (Logto):

    • Set the Redirect URI to https://lobe.example.com/api/auth/callback/logto.
    • Set the CORS allowed origins to https://lobe.example.com.
    • Obtain App ID and App secrets from Logto and fill them into your .env file under LOGTO_CLIENT_ID and LOGTO_CLIENT_SECRET.
    • Set LOGTO_ISSUER in your .env file to https://lobe-auth-api.example.com/oidc.
  2. Set Environment Variables: Ensure the following environment variables are correctly set in your .env file:

    APP_URL=https://lobe.example.com/
    KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
    DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/lobe
    NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
    NEXT_AUTH_SSO_PROVIDERS=logto
    NEXTAUTH_URL=https://lobe.example.com/api/auth
    LOGTO_CLIENT_ID=YOUR_LOGTO_CLIENT_ID
    LOGTO_CLIENT_SECRET=YOUR_LOGTO_CLIENT_SECRET
    LOGTO_ISSUER=https://lobe-auth-api.example.com/oidc
  3. Restart the LobeChat Service: After setting the environment variables, restart the LobeChat service to apply the changes:

    docker compose up -d

By ensuring that the authentication service is correctly configured and the necessary environment variables are set, you should be able to resolve the UNAUTHORIZED error in the tRPC handler on the specified paths [5][6].

To continue talking to Dosu, mention @dosu.