# Dvc external output, dependencies KeyError: 'x-amz-bucket-region'

**URL:** https://discuss.dvc.org/t/dvc-external-output-dependencies-keyerror-x-amz-bucket-region/2432
**Category:** Questions
**Created:** [February 12, 2025, 9:21am UTC](https://discuss.dvc.org/t/dvc-external-output-dependencies-keyerror-x-amz-bucket-region/2432 "2025-02-12T09:21:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![gribnogrib](https://avatars.discourse-cdn.com/v4/letter/g/ce7236/32.png) [@gribnogrib](https://discuss.dvc.org/u/gribnogrib)
#### Post date: [February 12, 2025, 9:21am UTC](https://discuss.dvc.org/t/dvc-external-output-dependencies-keyerror-x-amz-bucket-region/2432/1 "2025-02-12T09:21:44Z")

</div>

> stages:  
> gather\_pool\_list:  
> cmd: python pipeline\_scripts/gather\_pool\_list.py  
> –data\_dir ${general.data\_dir}  
> ${gather\_pool\_list}  
> deps:  
> - pipeline\_scripts/gather\_pool\_list.py  
> - code\_data\_collecting/data\_fetcher.py  
> outs:  
> - pipeline\_data/gather\_pool\_list/pools.csv  
> - s3://general-info.pool.csv:  
> cache: false

> dvc repro -s gather\_pool\_list -v

raise:  
2025-02-12 12:16:32,455 ERROR: failed to reproduce ‘gather\_pool\_list’: ‘x-amz-bucket-region’  
…  
File “C:\Users\grshn.conda\envs\torch\_python39\lib\site-packages\s3fs\core.py”, line 359, in get\_s3  
return await self.\_s3creator.get\_bucket\_client(bucket)  
File “C:\Users\grshn.conda\envs\torch\_python39\lib\site-packages\s3fs\utils.py”, line 53, in get\_bucket\_client  
region = response[“ResponseMetadata”][“HTTPHeaders”][“x-amz-bucket-region”]  
KeyError: ‘x-amz-bucket-region’

I’m using yandex s3 (not amazon).

> dvc status

2025-02-12 12:17:34,663 ERROR: unexpected error - ‘x-amz-bucket-region’  
File “C:\Users\grshn.conda\envs\torch\_python39\lib\site-packages\s3fs\core.py”, line 359, in get\_s3  
return await self.\_s3creator.get\_bucket\_client(bucket)  
File “C:\Users\grshn.conda\envs\torch\_python39\lib\site-packages\s3fs\utils.py”, line 53, in get\_bucket\_client  
region = response[“ResponseMetadata”][“HTTPHeaders”][“x-amz-bucket-region”]  
KeyError: ‘x-amz-bucket-region’

From my environment I can access files from s3fs:  
s3 = s3fs.S3FileSystem(anon=False)  
s3.ls(‘general-info’)  
return:  
[‘general-info/pools.csv’]

aws cli also works.  
How can I use external output? I tried use s3 dependencies - same error.

---

<div class="post-metadata">

### Author: ![shcheklein](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dvc.org/shcheklein/32/173_2.png) [@shcheklein](https://discuss.dvc.org/u/shcheklein)
#### Post date: [February 12, 2025, 10:59pm UTC](https://discuss.dvc.org/t/dvc-external-output-dependencies-keyerror-x-amz-bucket-region/2432/2 "2025-02-12T22:59:21Z")

</div>

Are you using some s3 compatible storage by chance?

It is triggered most likely by this issue - [fix(region cache): x-amz-bucket-region can be missing for s3 compatible by shcheklein · Pull Request #929 · fsspec/s3fs · GitHub](https://github.com/fsspec/s3fs/pull/929) that I made a PR for recently.

> How can I use external output?

External outputs are deprecated btw. I would not recommend using them.

---

<div class="post-metadata">

### Author: ![gribnogrib](https://avatars.discourse-cdn.com/v4/letter/g/ce7236/32.png) [@gribnogrib](https://discuss.dvc.org/u/gribnogrib)
#### Post date: [February 13, 2025, 9:03am UTC](https://discuss.dvc.org/t/dvc-external-output-dependencies-keyerror-x-amz-bucket-region/2432/3 "2025-02-13T09:03:36Z")

</div>

From yandex.cloud  
The Object Storage API is partially compatible with the AWS S3 API, so you can use [tools](https://yandex.cloud/en/docs/storage/tools/) built for S3.

## Compatibility with the Amazon S3 API

To manage Object Storage, you can use tools that are compatible with Amazon S3, including the API, CLI, WinSCP, Java SDK, or Python SDK.
