You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AWS CLI S3 Sync仍报错:非DNS兼容桶配置后问题未解决

Fixing AWS S3 Sync DNS Compatibility Error

Let's break down your issue and walk through actionable solutions to resolve this error for you.

The Problem

When running this sync command:

aws s3 sync --delete site/ s3://site.domain.com

You're encountering this error:

fatal error: Bucket named site.domain.com is not DNS compatible. Virtual hosted-style addressing cannot be used. The addressing style can be configured by removing the addressing_style value or setting that value to 'path' or 'auto' in the AWS Config file or in the botocore.client.Config object.

You already tried configuring the AWS settings with these commands:

aws configure set default.s3.addressing_style path
aws configure set default.s3.use_accelerate_endpoint false

Your config file (formatted for readability) looks like this:

[default]
region = us-east-1
output = json
s3 =
    use_accelerate_endpoint = false
    addressing_style = path

And your AWS CLI version is quite outdated:

$ aws --version
aws-cli/1.15.28 Python/2.7.10 Darwin/16.6.0 botocore/1.10.28

Root Causes & Fixes

1. Config File Format Isn't Compatible With Old CLI Versions

The nested s3 = block syntax works in newer AWS CLI releases, but your 1.15.x version likely can't parse it correctly. Reformat your ~/.aws/config file to use separate, flat sections instead—this is more reliable for older CLI versions:

[default]
region = us-east-1
output = json

[default.s3]
addressing_style = path
use_accelerate_endpoint = false

After updating, verify the config is being read properly with these commands:

aws configure get default.s3.addressing_style
aws configure get default.s3.use_accelerate_endpoint

They should return path and false respectively.

2. Your AWS CLI Version Is Way Outdated

Version 1.15.28 dates back to 2018, and there have been hundreds of bug fixes and improvements since then—including specific fixes for S3 addressing style handling. Upgrading is the most reliable long-term fix:

  • On macOS (if using Homebrew): brew upgrade awscli
  • For other systems, follow standard AWS CLI installation steps to grab the latest stable version.

3. Bypass Config Issues by Specifying Settings Directly in the Command

If you can't upgrade right now, force the path-style addressing directly in your sync command to work around config parsing bugs:

aws s3 sync --delete site/ s3://site.domain.com --config s3.addressing_style=path

Another option is to explicitly specify the S3 endpoint URL to enforce path-style addressing:

aws s3 sync --delete site/ s3://site.domain.com --endpoint-url https://s3.us-east-1.amazonaws.com

Final Recommendation

Prioritize upgrading your AWS CLI first. Old versions like 1.15.x have known compatibility issues with modern S3 features and config handling, so updating will prevent this and other potential headaches down the line.

内容的提问来源于stack exchange,提问作者Blair Trump

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 07:05:51