VK Cloud logo

The NoSuchBucket error occurs when working with a bucket via AWS CLI

When running a command in AWS CLI for an existing bucket, the error An error occurred (NoSuchBucket) when calling the... operation: The specified bucket does not exist is returned.

The issue may occur for several reasons:

  • typos in the bucket name;
  • the region in the AWS CLI configuration does not match the region of the account;
  • the VK Object Storage service domain is not specified in the command or is specified incorrectly.

Solution

  1. Make sure the bucket name is specified correctly.

  2. Make sure that the --endpoint-url command parameter specifies the service domain correctly and it matches the region of the VK Object Storage account:

    • https://hb.vkcloud-storage.ru or https://hb.ru-msk.vkcloud-storage.ru — the domain of the Moscow region;
    • https://hb.kz-ast.vkcloud-storage.ru — the domain of the Kazakhstan region.
  3. Check the AWS CLI configuration:

    aws configure list

    The response must contain in the region field one of the values corresponding to the region of the VK Object Storage account:

    • ru-msk — for the Moscow region;
    • kz-ast — for the Kazakhstan region.
  4. If the region field value is incorrect, change the AWS CLI settings:

    1. Run the command:

      aws configure
    2. Fill in the parameter values:

      • AWS Access Key ID: enter the Access Key ID value for your VK Object Storage account.
      • AWS Secret Access Key: enter the Secret Key value for your VK Object Storage account.
      • Default region name: enter ru-msk or kz-ast.
      • Default output format: enter json.
Was this article helpful?