Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

ApiError: The combination of locationConstraint and storageClass you provided is not supported for your project #7

Open
@mrdulin

Description

@mrdulin

创建cloud storagebucket时报错:

ApiError: The combination of locationConstraint and storageClass you provided is not supported for your project

原因是location参数设置错误,错误的代码:

async function main() {
  const buckets = await getBuckets();
  logger.info(JSON.stringify(buckets));
  const bucketName = 'nodejs-gcp';
  await createBucket(bucketName, {
    regional: true,
    location: 'ASIA'
  });
}

修改后的代码:

async function main() {
  const buckets = await getBuckets();
  logger.info(JSON.stringify(buckets));
  const bucketName = 'nodejs-gcp';
  await createBucket(bucketName, {
    regional: true,
    location: 'asia-east1'
  });
}

GCP控制台查看:

image

nodejs的客户端代码的location设置的是上图中红线区域中的值。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions