IBM Cloud Object Storage 创建存储桶时出错 - 'creation failed, vault name invalid.'

IBM Cloud Object Storage error creating bucket - 'creation failed, vault name invalid.'

我正在尝试在 IBM Cloud Object Storage 中创建两个存储桶:

cos = ibm_boto3.resource('s3',
                         ibm_api_key_id=cos_credentials['apikey'],
                         ibm_service_instance_id=cos_credentials['resource_instance_id'],
                         ibm_auth_endpoint=auth_endpoint,
                         config=Config(signature_version='oauth'),
                         endpoint_url=service_endpoint)

import datetime

# valid bucket format is ^[a-zA-Z0-9.\-_]{1,255}$
bucket_uid = datetime.datetime.now().isoformat().replace(':', '') 

buckets = ['training-data-' + bucket_uid, 'training-results-' + bucket_uid]

for bucket in buckets:
    if not cos.Bucket(bucket) in cos.buckets.all():
        print('Creating bucket "{}"...'.format(bucket))
        try:
            cos.create_bucket(Bucket=bucket)
        except ibm_boto3.exceptions.ibm_botocore.client.ClientError as e:
            print('Error: {}.'.format(e.response['Error']['Message']))

Returns错误:

Creating bucket "training-data-2018-07-11T090425.347277"...
Error: Container training-data-2018-07-11T090425.347277 creation failed, vault name invalid.
Creating bucket "training-results-2018-07-11T090425.347277"...
Error: Container training-results-2018-07-11T090425.347277 creation failed, vault name invalid.

这里有什么问题?为什么库名称无效?

如果我将 bucket_id 更改为“12345”,则可以正常创建存储桶。

存储桶名称长度是问题所在。

缩短时间戳是我的答案。很遗憾错误消息没有提供更多信息。