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] CF R2--S3图片上传失败 #2965

Closed AiharaMahiru closed 3 months ago

AiharaMahiru commented 3 months ago

📦 Environment

Vercel

📌 Version

1.1.3

💻 Operating System

Windows

🌐 Browser

Edge

🐛 Bug Description

这是我的配置信息(已处理),当我上传文件时,遇到“文件上传失败,请检查网络连接或稍后再试 详情: TRPCClientError: UNAUTHORIZED”的错误,日志为 ''' [POST] [middleware: "src/middleware"] /trpc/edge/upload.createS3PreSignedUrl status=200 [POST] /trpc/edge/upload.createS3PreSignedUrl?batch=1&nxtPtrpc=upload.createS3PreSignedUrl status=401 Error in tRPC handler (edge) on path: upload.createS3PreSignedUrl TRPCError: UNAUTHORIZED at (src/libs/trpc/middleware/password.ts:21:12) at (node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:152:0) at (node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:182:0) at (node_modules/@trpc/server/dist/unstable-core-do-not-import/http/resolveResponse.mjs:137:0) at (node_modules/@trpc/server/dist/unstable-core-do-not-import/http/resolveResponse.mjs:195:0) at (node_modules/@trpc/server/dist/adapters/fetch/fetchRequestHandler.mjs:32:0) at (node_modules/next/dist/esm/server/future/route-modules/app-route/module.js:195:0) at (node_modules/next/dist/esm/server/future/route-modules/app-route/module.js:124:0) at (node_modules/next/dist/esm/server/future/route-modules/app-route/module.js:257:0) { code: 'UNAUTHORIZED', name: 'TRPCError' } '''

📷 Recurrence Steps

screen

🚦 Expected Behavior

No response

📝 Additional Information

No response

lobehubbot commented 3 months ago

👀 @AiharaMahiru

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

arvinxx commented 3 months ago

是不是还有access code

lobehubbot commented 3 months ago

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


Is there any access code?

AiharaMahiru commented 3 months ago

是不是还有access code

还真是的,非常感谢。

lobehubbot commented 3 months ago

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


Is there any access code?

Really, thank you very much.

lobehubbot commented 3 months ago

✅ @AiharaMahiru

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

AHA1GE commented 3 months ago

是不是还有access code

还真是的,非常感谢。

我遇到了相同问题。请问是如何解决的? ---Edit: 解决了,在设置中填入ACCESS CODE即可

lobehubbot commented 3 months ago

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


Is there any access code?

Really, thank you very much.

I encountered the same problem. How was it solved?

LarkinZero commented 1 month ago

我这里的情况是,即使配置ACCESS_CODE了也一样会报错

Error in tRPC handler (edge) on path: upload.createS3PreSignedUrl
[TRPCError: UNAUTHORIZED] { code: 'UNAUTHORIZED', name: 'TRPCError' }
wcu1117 commented 1 month ago

我这里的情况是,即使配置ACCESS_CODE了也一样会报错

Error in tRPC handler (edge) on path: upload.createS3PreSignedUrl
[TRPCError: UNAUTHORIZED] { code: 'UNAUTHORIZED', name: 'TRPCError' }

解决了吗

LarkinZero commented 1 month ago

我这里的情况是,即使配置ACCESS_CODE了也一样会报错

Error in tRPC handler (edge) on path: upload.createS3PreSignedUrl
[TRPCError: UNAUTHORIZED] { code: 'UNAUTHORIZED', name: 'TRPCError' }

解决了吗

解决了,应该是我操作问题。环境变量里有ACCESS_CODE了。 但是在lobechat的Web界面里,你需要在左上角头像,点击应用设置-通用设置底部的系统设置里,把访问密码填上,这个字段就是ACCESS_CODE的值。

image
wcu1117 commented 1 month ago

我这里的情况是,即使配置ACCESS_CODE了也一样会报错

Error in tRPC handler (edge) on path: upload.createS3PreSignedUrl
[TRPCError: UNAUTHORIZED] { code: 'UNAUTHORIZED', name: 'TRPCError' }

解决了吗

解决了,应该是我操作问题。环境变量里有ACCESS_CODE了。 但是在lobechat的Web界面里,你需要在左上角头像,点击应用设置-通用设置底部的系统设置里,把访问密码填上,这个字段就是ACCESS_CODE的值。 image

有点离谱,还要这样配置,我更新到最新版看看,好像这个bug修复了