nikogura / dbt

A delivery system for running self-updating, signed tools.
MIT License
61 stars 8 forks source link

S3 Download Failure when Configured AWS CLI Region Does Not Match Repository Region #23

Closed nikogura closed 1 year ago

nikogura commented 1 year ago

When the s3 repository is in a region that differs from the user's configured region, all downloads fail.

This is first seen when downloading the truststore.

Error Message:

2023/01/12 09:06:13 Failed to fetch remote truststore: failed to download truststore from https://aws-dbt.s3.us-east-1.amazonaws.com/truststore: BucketRegionError: incorrect region, the bucket is not in 'us-west-1' region at endpoint '', bucket is in 'us-east-1' region status code: 301, request id: G7B9KX58Y35M55G5, host id: NqSpzVw9ZcAOoEqUNswDM2kAbQOT2TO4XbhtSkAITxKqOosBF13sHxZf79R+2+Jhi6qKxRNGhDU=.

If you want to try in 'offline' mode, retry your command again with: dbt -o ...

At present, dbt uses whatever configuration the client's computer has in place. Ideally, the s3 code should determine the region needed for the repository's s3 bucket and make all calls with that region.

Region config is already being parsed here: https://github.com/nikogura/dbt/blob/master/pkg/dbt/dbt.go#L99

Need to store this info, and use it in all s3 calls.

nikogura commented 1 year ago

Fixed in version 3.4.0