Open josenxx opened 2 months ago
👀 @josenxx
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。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。
Hey @josenxx, I'm here to help you with your bug report. Let's work together to solve this issue!
I found a similar unsolved discussion and a closed issue that might be relevant to your problem:
Based on your description and the provided images, it seems like the issue might be related to the S3_ENDPOINT
environment variable. Ensure that the path in the S3_ENDPOINT
link does not include the bucket name. For example, if your current S3_ENDPOINT
is:
S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com/lobechat
It should be:
S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
Make sure to update this in your Vercel environment variables.
Additionally, ensure that you have configured the necessary S3 access keys and CORS settings as described in the Cloudflare R2 setup documentation. Here is a summary of the required environment variables:
# S3 Keys
S3_ACCESS_KEY_ID=your_access_key_id
S3_SECRET_ACCESS_KEY=your_secret_access_key
# Bucket Name
S3_BUCKET=lobechat
# Bucket Request Endpoint
S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
# Public Access Domain for the Bucket
S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com
Ensure that the CORS configuration allows your Vercel domain:
[
{
"AllowedOrigins": ["https://your-project.vercel.app"],
"AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"],
"AllowedHeaders": ["*"]
}
]
By following these steps, you should be able to resolve the file upload issue on Vercel using Cloudflare R2 [3][4][5][6].
To continue talking to Dosu, mention @dosu.
@dosu how to set Public Access Domain for the Bucket
To set the Public Access Domain for the Bucket in Cloudflare R2, you need to configure the S3_PUBLIC_DOMAIN
environment variable with the appropriate URL. Here is the relevant information:
# Public Access Domain for the Bucket
S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com
Make sure to replace https://s3-for-lobechat.your-domain.com
with your actual domain [1][2].
To continue talking to Dosu, mention @dosu.
📦 Environment
Vercel
📌 Version
v1.15.14
💻 Operating System
macOS
🌐 Browser
Chrome
🐛 Bug Description
I try to upload files to the knowledge base. Hoever, it just stuck in the uploading forever.
I followed the instruction https://lobehub.com/docs/self-hosting/start and checked everything many times. It is likely that there is a problem in my setting, However, the change is low. I also read other similar issues like https://github.com/lobehub/lobe-chat/issues/3778 However I do not get any error message, so the behavior is different.
I can only show the log of vercel. After uploading file, it just stuck there and I cannot see another change.
It is clear that no files is uploaded.
There are my setting is cloudflare r2
📷 Recurrence Steps
No response
🚦 Expected Behavior
No response
📝 Additional Information
No response