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
42.08k stars 9.48k forks source link

[Bug] 请求失败 很抱歉,服务器拒绝了您的请求,可能是因为您的权限不足或未提供有效的身份验证错误详情 #3543

Closed zhangleijun111 closed 1 month ago

zhangleijun111 commented 1 month ago

📦 Environment

Docker

📌 Version

centos

💻 Operating System

Other Linux

🌐 Browser

Chrome

🐛 Bug Description

你好这是我部署的两个容器以及环境变量 docker run --name my-postgres --network pg -e POSTGRES_PASSWORD=mysecretpassword --restart=always -p 5432:5432 -d registry.us-west-1.aliyuncs.com/jg-images/pgvector:pg16

docker run -it -d -p 3210:3210 --network pg --env-file lobe-chat.env -e ENABLED_OPENAI=0 -e ENABLED_OLLAMA=0 --restart=always -e ZHIPU_API_KEY=ddf469a2bcf803222e61670df5691119.PGEcQLawcJZRbOVT --name lobe-chat-database registry.us-west-1.aliyuncs.com/jg-images/lobe-chat-database

b8a123b5c4313da696dacc0fa52735e 这是环境变量

📷 Recurrence Steps

访问3210端口后无线报没有权限这个错误,模型的环境变量也没有生效,可以帮我看一下哪里部署的不对吗 ![Uploading 1733caeb87c53c208e211e40fe2c142.png…]()

🚦 Expected Behavior

![Uploading 1733caeb87c53c208e211e40fe2c142.png…]() ![Uploading b8a123b5c4313da696dacc0fa52735e.png…]()

📝 Additional Information

No response

lobehubbot commented 1 month ago

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


📦 Environment

Docker

📌 Version

centos

💻 Operating System

Other Linux

🌐 Browser

Chrome

🐛 Bug Description

Hello, these are the two containers and environment variables I deployed. docker run --name my-postgres --network pg -e POSTGRES_PASSWORD=mysecretpassword --restart=always -p 5432:5432 -d registry.us-west-1.aliyuncs.com/jg-images/pgvector:pg16

Docker Run -it -D -P 3210: 3210 --Network PG --env -File Lobe -Chat.env -e ENABLED_OPENAI = 0 -e ENABLAMA = 0 -RESTAT = Alway -Eapi_Key = DDF4 69A2BCF80322E61670df569119.pgecqlawcjzrbovt -Name lobe-chat-database registry.us-west-1.aliyuncs.com/jg-images/lobe-chat-database

b8a123b5c4313da696dacc0fa52735e This is an environment variable

📷 Recurrence Steps

After accessing port 3210, the error message "No permissions" was reported, and the environment variables of the model did not take effect. Can you help me see where the deployment is wrong? ![Uploading 1733caeb87c53c208e211e40fe2c142.png…]()

🚦 Expected Behavior

![Uploading 1733caeb87c53c208e211e40fe2c142.png…]() ![Uploading b8a123b5c4313da696dacc0fa52735e.png…]()

📝 Additional Information

No response

lobehubbot commented 1 month ago

👀 @zhangleijun111

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。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

zhangleijun111 commented 1 month ago

1733caeb87c53c208e211e40fe2c142 z这是报错的信息

lobehubbot commented 1 month ago

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


1733caeb87c53c208e211e40fe2c142 zThis is the error message

arvinxx commented 1 month ago

请给出服务端的抛错日志

lobehubbot commented 1 month ago

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


Please provide the error log on the server side

zhangleijun111 commented 1 month ago

请给出服务端的抛错日志

你好日志在哪里查看可以告知嘛

lobehubbot commented 1 month ago

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


Please provide the error log of the server

Hello, can you tell me where I can view the logs?

zhangleijun111 commented 1 month ago

请给出服务端的抛错日志

另外是否是因为我的env配置不对从而导致失败的

lobehubbot commented 1 month ago

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


Please provide the error log of the server

Also, is it because my env configuration is incorrect and causes the failure?

arvinxx commented 1 month ago

请给出服务端的抛错日志

你好日志在哪里查看可以告知嘛

在你启动的docker镜像那边呀

lobehubbot commented 1 month ago

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


Please provide the error log of the server

Hello, can you tell me where to view the log?

On the side of the docker image you started?

zhangleijun111 commented 1 month ago

请给出服务端的抛错日志

你好日志在哪里查看可以告知嘛

在你启动的docker镜像那边呀

\u2705 database migration pass.
-------------------------------------
  \u25b2 Next.js 14.2.5
  - Local:        http://localhost:3210
  - Network:      http://0.0.0.0:3210

 \u2713 Starting...
 \u2713 Ready in 101ms
clerk auth: undefined
clerk auth: undefined
{"level":30,"time":1724303812422,"pid":1,"hostname":"dc6e85457bb0","msg":"Error in tRPC handler (lambda) on path: agent.getAgentConfig, type: query"}
i [TRPCError]: UNAUTHORIZED
    at /app/.next/server/chunks/43028.js:5:10122
    at t (/app/.next/server/chunks/61034.js:1:5658)
    at r (/app/.next/server/chunks/61034.js:1:6000)
    at /app/.next/server/chunks/78940.js:1:7197
    at Array.map (<anonymous>)
    at y (/app/.next/server/chunks/78940.js:1:6721)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _ (/app/.next/server/app/trpc/lambda/[trpc]/route.js:1:4277)
    at async /app/node_modules/.pnpm/next@14.2.5_@babel+core@7.23.6_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:36258
    at async eR.execute (/app/node_modules/.pnpm/next@14.2.5_@babel+core@7.23.6_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:26874) {
  code: 'UNAUTHORIZED',
  [cause]: undefined
}
i [TRPCError]: UNAUTHORIZED
    at /app/.next/server/chunks/43028.js:5:10122
    at t (/app/.next/server/chunks/61034.js:1:5658)
    at r (/app/.next/server/chunks/61034.js:1:6000)
    at /app/.next/server/chunks/78940.js:1:7197
    at Array.map (<anonymous>)
    at y (/app/.next/server/chunks/78940.js:1:6721)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _ (/app/.next/server/app/trpc/lambda/[trpc]/route.js:1:4277)
    at async /app/node_modules/.pnpm/next@14.2.5_@babel+core@7.23.6_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:36258
    at async eR.execute (/app/node_modules/.pnpm/next@14.2.5_@babel+core@7.23.6_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:26874) {
  code: 'UNAUTHORIZED',
  [cause]: undefined
}
{"level":30,"time":1724303812425,"pid":1,"hostname":"dc6e85457bb0","msg":"Error in tRPC handler (lambda) on path: user.getUserState, type: query"}
clerk auth: undefined
{"level":30,"time":1724303812974,"pid":1,"hostname":"dc6e85457bb0","msg":"Error in tRPC handler (lambda) on path: agent.getAgentConfig, type: query"}
i [TRPCError]: UNAUTHORIZED
    at /app/.next/server/chunks/43028.js:5:10122
    at t (/app/.next/server/chunks/61034.js:1:5658)
    at r (/app/.next/server/chunks/61034.js:1:6000)
    at /app/.next/server/chunks/78940.js:1:7197
    at Array.map (<anonymous>)
    at y (/app/.next/server/chunks/78940.js:1:6721)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _ (/app/.next/server/app/trpc/lambda/[trpc]/route.js:1:4277)
    at async /app/node_modules/.pnpm/next@14.2.5_@babel+core@7.23.6_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:36258
    at async eR.execute (/app/node_modules/.pnpm/next@14.2.5_@babel+core@7.23.6_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:26874) {
  code: 'UNAUTHORIZED',
  [cause]: undefined
}
clerk auth: undefined
clerk auth: undefined
i [TRPCError]: UNAUTHORIZED
    at /app/.next/server/chunks/43028.js:5:10122
    at t (/app/.next/server/chunks/61034.js:1:5658)
    at r (/app/.next/server/chunks/61034.js:1:6000)
    at /app/.next/server/chunks/78940.js:1:7197
    at Array.map (<anonymous>)
    at y (/app/.next/server/chunks/78940.js:1:6721)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _ (/app/.next/server/app/trpc/lambda/[trpc]/route.js:1:4277)
    at async /app/node_modules/.pnpm/next@14.2.5_@babel+core@7.23.6_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:36258
    at async eR.execute (/app/node_modules/.pnpm/next@14.2.5_@babel+core@7.23.6_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:26874) {
  code: 'UNAUTHORIZED',
  [cause]: undefined
}
{"level":30,"time":1724303817506,"pid":1,"hostname":"dc6e85457bb0","msg":"Error in tRPC handler (lambda) on path: agent.getAgentConfig, type: query"}
i [TRPCError]: UNAUTHORIZED
    at /app/.next/server/chunks/43028.js:5:10122
    at t (/app/.next/server/chunks/61034.js:1:5658)
    at r (/app/.next/server/chunks/61034.js:1:6000)
    at /app/.next/server/chunks/78940.js:1:7197
    at Array.map (<anonymous>)
    at y (/app/.next/server/chunks/78940.js:1:6721)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _ (/app/.next/server/app/trpc/lambda/[trpc]/route.js:1:4277)
    at async /app/node_modules/.pnpm/next@14.2.5_@babel+core@7.23.6_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:36258
    at async eR.execute (/app/node_modules/.pnpm/next@14.2.5_@babel+core@7.23.6_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:26874) {
  code: 'UNAUTHORIZED',
  [cause]: undefined
}
{"level":30,"time":1724303817507,"pid":1,"hostname":"dc6e85457bb0","msg":"Error in tRPC handler (lambda) on path: user.getUserState, type: query"}
clerk auth: undefined
{"level":30,"time":1724303818046,"pid":1,"hostname":"dc6e85457bb0","msg":"Error in tRPC handler (lambda) on path: agent.getAgentConfig, type: query"}
i [TRPCError]: UNAUTHORIZED
    at /app/.next/server/chunks/43028.js:5:10122
    at t (/app/.next/server/chunks/61034.js:1:5658)
    at r (/app/.next/server/chunks/61034.js:1:6000)
    at /app/.next/server/chunks/78940.js:1:7197
    at Array.map (<anonymous>)
    at y (/app/.next/server/chunks/78940.js:1:6721)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _ (/app/.next/server/app/trpc/lambda/[trpc]/route.js:1:4277)
    at async /app/node_modules/.pnpm/next@14.2.5_@babel+core@7.23.6_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:36258
    at async eR.execute (/app/node_modules/.pnpm/next@14.2.5_@babel+core@7.23.6_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:26874) {
  code: 'UNAUTHORIZED',
  [cause]: undefined
}
clerk auth: undefined
{"level":30,"time":1724303821406,"pid":1,"hostname":"dc6e85457bb0","msg":"Error in tRPC handler (lambda) on path: topic.createTopic, type: mutation"}
i [TRPCError]: UNAUTHORIZED
    at /app/.next/server/chunks/43028.js:5:10122
    at t (/app/.next/server/chunks/61034.js:1:5658)
    at r (/app/.next/server/chunks/61034.js:1:6000)
    at /app/.next/server/chunks/78940.js:1:7197
    at Array.map (<anonymous>)
    at y (/app/.next/server/chunks/78940.js:1:6721)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _ (/app/.next/server/app/trpc/lambda/[trpc]/route.js:1:4277)
    at async /app/node_modules/.pnpm/next@14.2.5_@babel+core@7.23.6_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:36258
    at async eR.execute (/app/node_modules/.pnpm/next@14.2.5_@babel+core@7.23.6_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:26874) {
  code: 'UNAUTHORIZED',
  [cause]: undefined
}
clerk auth: undefined
{"level":30,"time":1724303832737,"pid":1,"hostname":"dc6e85457bb0","msg":"Error in tRPC handler (lambda) on path: user.getUserState, type: query"}
i [TRPCError]: UNAUTHORIZED
    at /app/.next/server/chunks/43028.js:5:10122
    at t (/app/.next/server/chunks/61034.js:1:5658)
    at r (/app/.next/server/chunks/61034.js:1:6000)
    at /app/.next/server/chunks/78940.js:1:7197
    at Array.map (<anonymous>)
    at y (/app/.next/server/chunks/78940.js:1:6721)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _ (/app/.next/server/app/trpc/lambda/[trpc]/route.js:1:4277)
    at async /app/node_modules/.pnpm/next@14.2.5_@babel+core@7.23.6_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:36258
    at async eR.execute (/app/node_modules/.pnpm/next@14.2.5_@babel+core@7.23.6_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:26874) {
  code: 'UNAUTHORIZED',
  [cause]: undefined
}
clerk auth: undefined
{"level":30,"time":1724303838746,"pid":1,"hostname":"dc6e85457bb0","msg":"Error in tRPC handler (lambda) on path: agent.getAgentConfig, type: query"}
i [TRPCError]: UNAUTHORIZED
    at /app/.next/server/chunks/43028.js:5:10122
    at t (/app/.next/server/chunks/61034.js:1:5658)
    at r (/app/.next/server/chunks/61034.js:1:6000)
    at /app/.next/server/chunks/78940.js:1:7197
    at Array.map (<anonymous>)
    at y (/app/.next/server/chunks/78940.js:1:6721)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _ (/app/.next/server/app/trpc/lambda/[trpc]/route.js:1:4277)
    at async /app/node_modules/.pnpm/next@14.2.5_@babel+core@7.23.6_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:36258
    at async eR.execute (/app/node_modules/.pnpm/next@14.2.5_@babel+core@7.23.6_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:26874) {
  code: 'UNAUTHORIZED',
  [cause]: undefined

这是日志帮忙看下3210端口登录就报错认证失败

arvinxx commented 1 month ago

你是自己打的镜像吗? 为什么会有 clerk auth: undefined … 你配了 clerk 环境变量吗?

lobehubbot commented 1 month ago

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


Did you mirror it yourself? Why is there clerk auth: undefined... Have you configured the clerk environment variable?

zhangleijun111 commented 1 month ago

Quote reply 没有耶我就是用的最新的1.12.1的镜像,我是用阿里云拉的不过,应该没什么问题吧 8d526c0aee02214470107d3e45ed1dc

lobehubbot commented 1 month ago

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


Quote reply No, I just used the latest 1.12.1 image. I used Alibaba Cloud to pull it, but there should be no problem. 8d526c0aee02214470107d3e45ed1dc

wcu1117 commented 1 month ago

我之前也遇到你这个,解决完了又遇到另外一个,一步一个坑。建议你去排查以下几点。一个是中间件,一个是回调的token和session。

lobehubbot commented 1 month ago

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


I have encountered your problem before, and after solving it, I encountered another one, one step at a time. It is recommended that you check the following points. One is the middleware, and the other is the callback token and session.

lobehubbot commented 1 month ago

✅ @zhangleijun111

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