When connecting to an AWS S3 bucket located in the af-south-1 (Cape Town) region using WinSCP, the following error may appear:
The af-south-1 location constraint is incompatible for the region specific endpoint this request was sent to.
This typically happens during actions like connecting, uploading, or changing directories in the S3 bucket. You may also see messages like:
Error changing directory to 'bucket-name'.
Extra Details: RequestId: [....], HostId: [....]
Cause
WinSCP (by default) uses the generic AWS S3 endpoint s3.amazonaws.com
. This works fine for standard AWS regions, but not for region-specific buckets like af-south-1
or me-south-1
.
When trying to access buckets in regions like af-south-1
, AWS requires the request to go through the region-specific endpoint.
To fix this error, manually set the correct AWS S3 endpoint in your WinSCP session:
Step-by-step Instructions
Open WinSCP
Go to "Session" > "New Site"
Choose Amazon S3 as the protocol
In the "Host name" field, enter:
s3.af-south-1.amazonaws.com
Enter your Access Key ID and Secret Access Key
Click Advanced
In the Environment > Directories section, set the remote directory (your S3 bucket name, e.g.,
your-bucket-name
)Click OK, then connect
Where to Find Region Endpoints
For a list of all AWS S3 regional endpoints, refer to the official AWS documentation:
Example
Region | Endpoint |
---|---|
Cape Town |
|
Bahrain |
|
Frankfurt |
|
US East (N. Virginia) |
|
This fix applies to WinSCP and any other client that lets you manually specify the S3 endpoint.
Always use the correct endpoint for the bucket's region to avoid location constraint errors.
Still need help?
Contact us