# Fix: “The af-south-1 location constraint is incompatible for the region-specific endpoint this request was sent to” (WinSCP + AWS S3)

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

 1. Open WinSCP

 2. Go to "Session" > "New Site"

 3. Choose Amazon S3 as the protocol

 4. In the "Host name" field, enter:
    
    s3.af-south-1.amazonaws.com

 5. Enter your Access Key ID and Secret Access Key

 6. Click Advanced

 7. In the Environment > Directories section, set the remote directory (your S3
    bucket name, e.g.,your-bucket-name)

 8. Click OK, then connect


WHERE TO FIND REGION ENDPOINTS

For a list of all AWS S3 regional endpoints, refer to the official AWS
documentation:

AWS S3 Endpoints – AWS Docs
[https://docs.aws.amazon.com/general/latest/gr/s3.html]


EXAMPLE

Region

Endpoint

Cape Town

s3.af-south-1.amazonaws.com

Bahrain

s3.me-south-1.amazonaws.com

Frankfurt

s3.eu-central-1.amazonaws.com

US East (N. Virginia)

s3.amazonaws.com

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.