opendatalab/MinerU · error · InvalidParams
bucket name: {bucket_name} not found in s3_configs: {self.s3
Error message
bucket name: {bucket_name} not found in s3_configs: {self.s3_configs} What it means
InvalidParams raised by MultiBucketS3DataReader.__get_s3_client when the bucket of a path being read is not present in self.s3_configs. The reader selects a per-bucket client from the configured credential list; an unconfigured bucket has no credentials and is rejected before any S3 request is made.
Source
Thrown at mineru/data/data_reader_writer/multi_bucket_s3.py:84
Args:
path (str): the s3 path of file, the path must be in the format of s3://bucket_name/path?offset,limit.
for example: s3://bucket_name/path?0,100.
Returns:
bytes: the content of s3 file.
"""
may_range_params = parse_s3_range_params(path)
if may_range_params is None or 2 != len(may_range_params):
byte_start, byte_len = 0, -1
else:
byte_start, byte_len = int(may_range_params[0]), int(may_range_params[1])
path = remove_non_official_s3_args(path)
return self.read_at(path, byte_start, byte_len)
def __get_s3_client(self, bucket_name: str):
if bucket_name not in set([conf.bucket_name for conf in self.s3_configs]):
raise InvalidParams(
f'bucket name: {bucket_name} not found in s3_configs: {self.s3_configs}'
)
if bucket_name not in self._s3_clients_h:
conf = next(
filter(lambda conf: conf.bucket_name == bucket_name, self.s3_configs)
)
S3Reader, _ = _load_s3_io_classes()
self._s3_clients_h[bucket_name] = S3Reader(
bucket_name,
conf.access_key,
conf.secret_key,
conf.endpoint_url,
conf.addressing_style,
)
return self._s3_clients_h[bucket_name]
def read_at(self, path: str, offset: int = 0, limit: int = -1) -> bytes:
"""Read the file with offset and limit, select diffect bucket clientView on GitHub (pinned to 4fe4bde114)
Solutions
- Add an S3Config for the bucket named in the failing s3:// URL (the error message lists every configured bucket).
- Rewrite the path to the bucket you did configure, or make it relative so the default bucket is used.
- Pre-scan input paths and extract the set of buckets via parse_s3path() to verify coverage before processing.
Example fix
# before
configs = [S3Config(bucket_name='docs', ...)]
reader = MultiBucketS3DataReader('docs/', configs)
reader.read('s3://invoices/q1.pdf') # InvalidParams
# after
configs = [
S3Config(bucket_name='docs', ...),
S3Config(bucket_name='invoices', ...),
]
reader = MultiBucketS3DataReader('docs/', configs)
reader.read('s3://invoices/q1.pdf') Defensive patterns
Strategy: validation
Validate before calling
from mineru.data.utils.path_utils import parse_s3path
def check_bucket_coverage(paths: list[str], reader) -> None:
known = {c.bucket_name for c in reader.s3_configs}
missing = {parse_s3path(p)[0] for p in paths if p.startswith(('s3://', 's3a://'))} - known
if missing:
raise ValueError(f'no S3Config for buckets: {sorted(missing)}') Try / catch
from mineru.data.utils.exceptions import InvalidParams
try:
data = reader.read(path)
except InvalidParams as e:
if 'not found in s3_configs' in e.msg:
# add config for the bucket named in e.msg, then retry once
raise
raise Prevention
- Pre-scan all s3:// input paths and register every referenced bucket in s3_configs.
- Prefer relative paths when data lives under default_bucket/default_prefix.
- Fail fast at pipeline setup with a bucket-coverage check instead of mid-run.
When it happens
Trigger: reader.read('s3://other-bucket/file.pdf') where 'other-bucket' has no S3Config entry — happens for absolute s3:// paths, since read_at() parses the bucket via parse_s3path(); relative paths always use default_bucket, which was validated at construction.
Common situations: A document list contains URLs pointing at several buckets but s3_configs only covers one; cross-bucket migration where input paths moved to a new bucket; hardcoded s3:// URLs in test fixtures referencing a bucket never registered.
Related errors
- default_prefix must be provided
- default_bucket: {self.default_bucket} config must be provide
- the bucket_name in s3_configs: {s3_configs} must be unique
- The provided path starts with '/'. This does not conform to
- Invalid S3 path format. Expected 's3://bucket-name/key' or '
AI-assisted analysis of opendatalab/MinerU@4fe4bde114 (2026-08-14).
Data as JSON: /api/errors/e6569e567e38a9f9.
Report an issue: GitHub.