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.46k stars 9.98k forks source link

[Bug] 服务端模式部署后上传文件一直显示上传中 #3898

Closed gaye746560359 closed 1 month ago

gaye746560359 commented 2 months ago

📦 Environment

Docker

📌 Version

v1.16.3

💻 Operating System

Windows

🌐 Browser

Chrome

🐛 Bug Description

服务端模式部署后上传文件一直显示上传中 image

📷 Recurrence Steps

No response

🚦 Expected Behavior

No response image

📝 Additional Information

No response

lobehubbot commented 2 months ago

👀 @gaye746560359

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

文件上传界面在服务端模式部署后一直显示“上传中”,这是因为文件完全上传但仍在服务器处理中时,进度会设置为99.9%。这样做是为了让用户认为文件仍在上传。

xhr.upload.addEventListener('progress', (event) => {
  if (event.lengthComputable) {
    const progress = Number(((event.loaded / event.total) * 100).toFixed(1));

    const speedInByte = event.loaded / ((Date.now() - startTime) / 1000);

    onProgress?.('uploading', {
      // if the progress is 100, it means the file is uploaded
      // but the server is still processing it
      // so make it as 99.9 and let users think it's still uploading
      progress: progress === 100 ? 99.9 : progress,
      restTime: (event.total - event.loaded) / speedInByte,
      speed: speedInByte,
    });
  }
});

这个逻辑适用于所有文件名,因此问题并不仅限于“requirements.txt”文件,而是上传过程本身的问题[1].

To continue talking to Dosu, mention @dosu.

gaye746560359 commented 2 months ago

文件上传界面在服务端模式部署后一直显示“上传中”,这是因为文件完全上传但仍在服务器处理中时,进度会设置为99.9%。这样做是为了让用户认为文件仍在上传。

xhr.upload.addEventListener('progress', (event) => {
  if (event.lengthComputable) {
    const progress = Number(((event.loaded / event.total) * 100).toFixed(1));

    const speedInByte = event.loaded / ((Date.now() - startTime) / 1000);

    onProgress?.('uploading', {
      // if the progress is 100, it means the file is uploaded
      // but the server is still processing it
      // so make it as 99.9 and let users think it's still uploading
      progress: progress === 100 ? 99.9 : progress,
      restTime: (event.total - event.loaded) / speedInByte,
      speed: speedInByte,
    });
  }
});

这个逻辑适用于所有文件名,因此问题并不仅限于“requirements.txt”文件,而是上传过程本身的问题[1].

To continue talking to Dosu, mention @dosu.

是bug吗?文件体积并不大,却一直显示上传中。

ReddotCleaner commented 2 months ago

大概率是s3的跨域或者身份鉴别没做好

lobehubbot commented 2 months ago

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


There is a high probability that the cross-domain or identity authentication of s3 is not done well.

KingDoum commented 2 months ago

我的也是一样,你在这个 上传页面 按一下f12 看看 是不是也和我一样报错 遇到过上传卡住的情况么? 我f12 查看 报错的是这个 ,但是我的minio 是按照 配置操作的。 唯一怀疑的就是 我的代理地址 不知道有没有填对。 docker配置文件 'MINIO_DOMAIN=lobe-s3-api.example.xyz'

[ { "error": { "json": { "message": "S3 environment variables are not set completely, please check your env", "code": -32603, "data": { "code": "INTERNAL_SERVER_ERROR", "httpStatus": 500, "path": "upload.createS3PreSignedUrl" } } } } ]

lobehubbot commented 2 months ago

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


It's the same for me. Press f12 on this upload page and see if you get the same error as me. Have you ever encountered a situation where uploading is stuck? When I checked with f12, this is the error reported, but my minio operates according to the configuration. The only thing I doubt is whether my proxy address is correct. docker configuration file 'MINIO_DOMAIN=lobe-s3-api.example.xyz'

[ { "error": { "json": { "message": "S3 environment variables are not set completely, please check your env", "code": -32603, "data": { "code": "INTERNAL_SERVER_ERROR", "httpStatus": 500, "path": "upload.createS3PreSignedUrl" } } } } ]

Aliothm commented 2 months ago

身份验证或者s3配置没写好就会这样,因为之前我身份验证没写好就跟你一样卡住了

lobehubbot commented 2 months ago

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


This will happen if the authentication or s3 configuration is not written properly, because before I didn’t write the authentication properly and got stuck like you.

KingDoum commented 2 months ago

身份验证或者s3配置没写好就会这样,因为之前我身份验证没写好就跟你一样卡住了

大佬,你使用https://代理了么,cores 配置的时候 是写的局域网还是 代理过的地址,还是直接就是网址+端口走的

lobehubbot commented 2 months ago

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


This will happen if the authentication or s3 configuration is not written properly, because before I didn’t write the authentication properly and got stuck like you.

Boss, have you used https:// as a proxy? When configuring cores, did you write the local area network or the proxy address, or just the URL + port?

tunogya commented 1 month ago

Check your Bucket name, it should not contain "/". This solved my problem.

tunogya commented 1 month ago

If you are using AWS S3, make sure your S3_ENDPOINT is in the format of https://s3.ap-northeast-1.amazonaws.com, without the bucket name.