Fix: Alibaba cloud OSS config issue (#13406)

### What problem does this PR solve?

 Alibaba Could OSS config issue #13390.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Yongteng Lei
2026-03-05 18:13:45 +08:00
committed by GitHub
parent 8b534c895e
commit d9785ea2ce

View File

@@ -16,6 +16,7 @@
import logging
import boto3
from botocore.exceptions import ClientError
from botocore.config import Config
import time
from io import BytesIO
from common.decorator import singleton
@@ -72,6 +73,8 @@ class RAGFlowOSS:
'addressing_style': self.addressing_style
}
config = Config(**config_kwargs) if config_kwargs else None
# Referencehttps://help.aliyun.com/zh/oss/developer-reference/use-amazon-s3-sdks-to-access-oss
self.conn = boto3.client(
's3',
@@ -79,7 +82,7 @@ class RAGFlowOSS:
aws_access_key_id=self.access_key,
aws_secret_access_key=self.secret_key,
endpoint_url=self.endpoint_url,
config=config_kwargs
config=config
)
except Exception:
logging.exception(f"Fail to connect at region {self.region}")