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
44.52k stars 9.99k forks source link

[Bug] 文件上传失败 分块失败 #4122

Closed aiiibolo closed 1 month ago

aiiibolo commented 1 month ago

📦 Environment

Vercel

📌 Version

v1.19.25

💻 Operating System

macOS

🌐 Browser

Other

🐛 Bug Description

  1. 文件上传失败 上传到最后一点就卡住了 我去Cloudflare的R2管理当中查看发现文件已经上传成功

但是在聊天界面有时可以正常上传文件,但是有时候不行 不行的时候提醒的错误是请确认你的网络是否正常,并检查文件存储服务跨域配置是否正确

  1. 文件分块失败 提示错误 [TaskTriggerErrorl: trigger file parse async task error. Please check your app is public available or check your proxy settings is set correctly.
  1. 检查了OpenAI账户 支持分块所需的模型
    1. 我在国外各种网站连接均正常 ,没有单独设置代理
    2. 我的网站是公开的
    3. 跨域配置我是复制的示例配置 然后更改了url https://

📷 Recurrence Steps

聊天界面的文件上传和知识库的文件上传流程

🚦 Expected Behavior

No response

📝 Additional Information

No response

lobehubbot commented 1 month ago

👀 @aiiibolo

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 1 month ago

I found some similar issues and discussions that might help resolve your problem:

  1. Similar Issues and Discussions:

  2. Suggested Solutions:

    • Configure Cross-Origin Resource Sharing (CORS):

      • Go to the settings of your Cloudflare R2 storage bucket.
      • Add a CORS rule to allow requests from your Vercel project domain.
      • Example CORS configuration:
        [
        {
        "AllowedOrigins": ["https://your-project.vercel.app"],
        "AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"],
        "AllowedHeaders": ["*"]
        }
        ]
    • Ensure Environment Variables are Correct:

      • Make sure you have set the necessary environment variables in your Vercel project with the correct values from your Cloudflare R2 bucket.
      • Example environment variables:
        S3_ACCESS_KEY_ID=your_access_key_id
        S3_SECRET_ACCESS_KEY=your_secret_access_key
        S3_BUCKET=your_bucket_name
        S3_ENDPOINT=https://your_endpoint.r2.cloudflarestorage.com
        S3_PUBLIC_DOMAIN=https://s3.your-domain.com
    • Check Network and Proxy Settings:

      • Ensure your network connection is stable.
      • If you are behind a proxy, ensure that the proxy authentication is correctly set up.

By following these steps, you should be able to resolve the file upload and chunking failure issues related to network and cross-origin configuration when using Cloudflare R2 storage with Vercel [1][2].

To continue talking to Dosu, mention @dosu.

aiiibolo commented 1 month ago

在没有更改任何设置的情况下 聊天界面上传图片和文件均成功 同时可以在知识库当中找到

文件夹上传 其中一个pdf很轻易的上传成功 另外一个就卡在最后一点显示正在上传 所有pdf文件大小都在1MB以内

上传不稳定 有时候完全没问题 有时候提示跨域配置和网络问题

lobehubbot commented 1 month ago

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


Without changing any settings, pictures and files were uploaded successfully in the chat interface and can be found in the knowledge base.

aiiibolo commented 1 month ago

![Uploading CleanShot 2024-09-25 at 13.13.31@2x.jpg…]()

lobehubbot commented 1 month ago

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


![Uploading CleanShot 2024-09-25 at 13.13.31@2x.jpg…]()