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] 上传文件显示正在上传,进度条已走完,同时查看网页有ERR_CONNECTION_RESET的报错 #4255

Closed davidelectricfree closed 1 month ago

davidelectricfree commented 1 month ago

📦 Environment

Docker

📌 Version

1.19.21

💻 Operating System

Other Linux

🌐 Browser

Edge

🐛 Bug Description

目前已配置好MINI和数据库,尝试上传文件丰富资料库,上传文件出现速度,但是当进度条读完后,始终卡在正在上传,打开浏览器的开发者模式,发现上传存在报错,报错代码为: net::ERR_CONNECTION_RESET

然后我的compose 文件如下:

services: network-service: image: alpine:3.20 container_name: lobe-network ports:

volumes: data: driver: local s3_data: driver: local

networks: lobe-network: driver: bridge

请大佬帮忙看看是什么原因

📷 Recurrence Steps

No response

🚦 Expected Behavior

No response

📝 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

1.19.21

💻 Operating System

Other Linux

🌐 Browser

Edge

🐛 Bug Description

MINI and database have been configured. I tried uploading files to enrich the database. The uploaded files appeared faster. However, after the progress bar was read, it was always stuck on uploading. I opened the developer mode of the browser and found that there was an error in the upload. The error code was : net::ERR_CONNECTION_RESET

Then my compose file is as follows:

services: network-service: image: alpine:3.20 container_name: lobe-network ports:

volumes: data: driver:local s3_data: driver: local

networks: lobe-network: driver: bridge

Please help me find out what is the reason

📷 Recurrence Steps

No response

🚦 Expected Behavior

No response

📝 Additional Information

No response

lobehubbot commented 1 month ago

👀 @davidelectricfree

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 a similar unsolved discussion regarding Docker Compose and database configurations that might be relevant to your issue: 分享一组自用的数据库版本私有化docker-compose [1].

Regarding the ERR_CONNECTION_RESET error during file uploads, this can often be caused by network issues or misconfigurations in your Docker setup. Here are a few things you might want to check:

  1. Network Configuration: Ensure that your network settings in the docker-compose.yml file are correctly configured. All services should be able to communicate over the specified ports and network. Make sure the network_mode and ports settings are correct.

  2. CORS Settings: Verify that the CORS settings for MinIO are correctly configured to allow requests from your application. The MINIO_API_CORS_ALLOW_ORIGIN should match the domain and port of your application.

  3. Resource Limits: Check if there are any resource constraints (CPU, memory) that might be causing the connection to reset.

  4. Logs and Errors: Look at the logs of the involved containers (minio, lobe, etc.) for any errors or warnings that might give more insight into the issue.

  5. Retry Mechanism: The application does not have an explicit retry mechanism for file uploads. If network errors occur, the file is removed from the upload list without retrying [2].

If these steps do not resolve the issue, consider testing the setup on a different network or environment to rule out network-specific problems.

To continue talking to Dosu, mention @dosu.

davidelectricfree commented 1 month ago

@dosu 我目前是将全本地方案,将lobe/miniIO/LOGTO/PGSQL均部署在群晖NAS上,如下是我的compose yaml

services: network-service: image: alpine:3.20 container_name: lobe-network ports:

volumes: data: driver: local s3_data: driver: local

networks: lobe-network: driver: bridge

lobehubbot commented 1 month ago

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


@dosu I currently deploy the all-local solution and deploy lobe/miniIO/LOGTO/PGSQL on Synology NAS. The following is my compose yaml

services: network-service: image: alpine:3.20 container_name: lobe-network ports:

volumes: data: driver: local s3_data: driver: local

networks: lobe-network: driver: bridge

dosubot[bot] commented 1 month ago

To address the ERR_CONNECTION_RESET error during file uploads in your Docker Compose setup on a Synology NAS, consider the following steps:

  1. CORS Configuration: Ensure that the MINIO_API_CORS_ALLOW_ORIGIN environment variable is correctly set to allow requests from your LobeChat application. It should match the domain and port of your application. For example:

    environment:
     - "MINIO_API_CORS_ALLOW_ORIGIN=http://192.168.50.114:${LOBE_PORT}"

    This setting allows cross-origin requests from your LobeChat domain [1].

  2. Network Configuration: Verify that your network settings in the docker-compose.yml file are correctly configured. Ensure that all services can communicate over the specified ports and network. The network_mode and ports settings should be correct and consistent across services.

  3. Resource Constraints: Check if there are any resource constraints (CPU, memory) on your Synology NAS that might be causing the connection to reset. Ensure that your NAS has sufficient resources to handle the services.

  4. Logs and Errors: Review the logs of the involved containers (minio, lobe, etc.) for any errors or warnings that might provide more insight into the issue.

  5. Retry Mechanism: Note that the application does not have an explicit retry mechanism for file uploads. If network errors occur, the file is removed from the upload list without retrying [2].

If these steps do not resolve the issue, consider testing the setup on a different network or environment to rule out network-specific problems.

To continue talking to Dosu, mention @dosu.

davidelectricfree commented 1 month ago

@dosu 但是现在存在上传文件,显示进度条为满,但是始终在上传中,查询浏览器报错信息为:net::ERR_CONNECTION_RESET,结合上面我的docker compose.yaml 请问原因是什么?

lobehubbot commented 1 month ago

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


@dosu But now there is an uploaded file, and the progress bar is full, but it is always uploading. The error message reported by the browser is: net::ERR_CONNECTION_RESET. Combined with my docker compose.yaml above, what is the reason?

dosubot[bot] commented 1 month ago

To address the ERR_CONNECTION_RESET error during file uploads, consider the following:

  1. CORS Configuration: Ensure that the MINIO_API_CORS_ALLOW_ORIGIN is set correctly in your Docker Compose file to allow requests from your LobeChat application. It should match the domain and port of your application:

    environment:
     - "MINIO_API_CORS_ALLOW_ORIGIN=http://192.168.50.114:${LOBE_PORT}"

    This setting allows cross-origin requests from your LobeChat domain [1].

  2. Network Configuration: Verify that your network settings in the docker-compose.yml file are correct. Ensure all services can communicate over the specified ports and network. The network_mode and ports settings should be consistent across services.

  3. Resource Constraints: Check for any resource constraints (CPU, memory) on your Synology NAS that might be causing the connection to reset. Ensure your NAS has sufficient resources to handle the services.

  4. Logs and Errors: Review the logs of the involved containers (minio, lobe, etc.) for any errors or warnings that might provide more insight into the issue.

  5. Retry Mechanism: Note that the application does not have an explicit retry mechanism for file uploads. If network errors occur, the file is removed from the upload list without retrying.

If these steps do not resolve the issue, consider testing the setup on a different network or environment to rule out network-specific problems.

To continue talking to Dosu, mention @dosu.

davidelectricfree commented 1 month ago

@dosu 我检查了你说的CORS设置,确实和你说的是一样的,我该怎么做以排除其他问题?谢谢

lobehubbot commented 1 month ago

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


@dosu I checked the CORS settings you mentioned, and they are indeed the same as you said. What should I do to eliminate other problems? Thanks

dosubot[bot] commented 1 month ago

To further troubleshoot the ERR_CONNECTION_RESET error, consider the following steps:

  1. Network Configuration: Double-check your Docker Compose network settings. Ensure that all services are correctly configured to communicate over the specified ports and network. Verify that the network_mode and ports settings are consistent across services.

  2. Resource Constraints: Ensure your Synology NAS has sufficient resources (CPU, memory) to handle the services. Check if there are any resource limitations that might be causing the connection to reset.

  3. Logs and Errors: Review the logs of the involved containers (minio, lobe, etc.) for any errors or warnings. These logs can provide more insight into what might be causing the issue.

  4. Network Environment: Test the setup on a different network or environment to rule out network-specific problems. This can help determine if the issue is related to your current network configuration.

  5. Firewall and Security Settings: Check if there are any firewall or security settings on your NAS or network that might be blocking or interrupting the connection.

By systematically checking these areas, you can identify and resolve potential issues causing the connection reset error.

To continue talking to Dosu, mention @dosu.

davidelectricfree commented 1 month ago

@dosu 我在MINIIO的管理后台,通过追踪行为,在上传过程中,检测到上传行为的Status是403 Forbidden,请问下一步我要怎么做

lobehubbot commented 1 month ago

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


@dosu I am tracking the behavior in the MINIIO management background. During the upload process, the Status of the upload behavior detected is 403 Forbidden. What should I do next?

dosubot[bot] commented 1 month ago

To resolve the 403 Forbidden status during the upload process in the MinIO management console, follow these steps:

  1. Bucket Policy Configuration: Ensure that the bucket policy allows the necessary actions. The policy should look like this:

    {
     "Statement": [
       {
         "Effect": "Allow",
         "Principal": {
           "AWS": ["*"]
         },
         "Action": ["s3:GetBucketLocation"],
         "Resource": ["arn:aws:s3:::lobe"]
       },
       {
         "Effect": "Allow",
         "Principal": {
           "AWS": ["*"]
         },
         "Action": ["s3:ListBucket"],
         "Resource": ["arn:aws:s3:::lobe"],
         "Condition": {
           "StringEquals": {
             "s3:prefix": ["files/*"]
           }
         }
       },
       {
         "Effect": "Allow",
         "Principal": {
           "AWS": ["*"]
         },
         "Action": ["s3:PutObject", "s3:DeleteObject", "s3:GetObject"],
         "Resource": ["arn:aws:s3:::lobe/files/**"]
       }
     ],
     "Version": "2012-10-17"
    }
  2. CORS Configuration: Ensure that CORS is configured correctly to allow cross-origin requests from your domain. This can be set in the MinIO WebUI under Configuration - API - Cors Allow Origin, or in the Docker Compose file under minio - environment - MINIO_API_CORS_ALLOW_ORIGIN.

  3. Access Keys: Verify that the correct Access Key and Secret Key are set in your .env file under S3_ACCESS_KEY_ID and S3_SECRET_ACCESS_KEY.

  4. Endpoint Configuration: Ensure that the S3_ENDPOINT is correctly configured without any suffix path, as this can prevent file access. For example:

    S3_ENDPOINT=http://192.168.50.114:${MINIO_PORT}
  5. ACL Settings: Check if S3_SET_ACL is set to public-read if required by your use case. If your service provider does not support individual ACLs, set S3_SET_ACL to 0.

  6. Path Style Access: If using MinIO, ensure S3_ENABLE_PATH_STYLE is set to 1 to enable path-style access, which is the default for MinIO.

  7. Restart Services: After making changes, restart the services using:

    docker compose up -d

    Avoid using docker compose restart lobe as it will not reload the environment variables.

By ensuring these configurations are correct, you should be able to resolve the 403 Forbidden status during the upload process [1][2].

To continue talking to Dosu, mention @dosu.

davidelectricfree commented 1 month ago

@dosu 我重新更新了MINIIO的SECRET KEY后,就解决了问题,十分感谢

lobehubbot commented 1 month ago

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


@dosu I solved the problem after updating MINIIO's SECRET KEY. Thank you very much.

lobehubbot commented 1 month ago

✅ @davidelectricfree

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