# botocore.exceptions.ClientError: An error occurred (AuthorizationHeaderMalformed) while pushing to the hub

**URL:** <https://discuss.huggingface.co/t/botocore-exceptions-clienterror-an-error-occurred-authorizationheadermalformed-while-pushing-to-the-hub/22575>\
**Category:** 🤗Datasets\
**Created:** [September 5, 2022, 2:54pm UTC](https://discuss.huggingface.co/t/botocore-exceptions-clienterror-an-error-occurred-authorizationheadermalformed-while-pushing-to-the-hub/22575 "2022-09-05T14:54:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![g8a9](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/g8a9/32/39308_2.png) [@g8a9](https://discuss.huggingface.co/u/g8a9)\
**Post date:** [September 5, 2022, 2:54pm UTC](https://discuss.huggingface.co/t/botocore-exceptions-clienterror-an-error-occurred-authorizationheadermalformed-while-pushing-to-the-hub/22575/1 "2022-09-05T14:54:30Z")

</div>

Hi,

I’m trying to push a dataset following the basic commands (I’ve created a new report, tracked with lfs the split files, added them along with a README.md, and pushed), but then I get:

```auto
Uploading LFS objects: 100% (3/3), 629 MB | 0 B/s, done.
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 4 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 1.58 KiB | 809.00 KiB/s, done.
Total 7 (delta 1), reused 0 (delta 0)
remote: Scanning LFS files for validity, may be slow...
remote: botocore.exceptions.ClientError: An error occurred (AuthorizationHeaderMalformed) when calling the ListObjects operation: The authorization header is malformed; the Credential is mal-formed; expecting "<YOUR-AKID>/YYYYMMDD/REGION/SERVICE/aws4_request".
To https://huggingface.co/datasets/g8a9/europarl_en-it
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://huggingface.co/datasets/g8a9/europarl_en-it'

```

I’m having the same issue from my Macbook Pro (git version 2.24.3 (Apple Git-128)) and a RHEL workstation (git version 2.31.1).

I can correctly login via `huggingface-cli login`, even though the output is:

```auto
Login successful
Your token has been saved to /Users/giuseppe/.huggingface/token
Authenticated through git-crendential store but this isn't the helper defined on your machine.
You will have to re-authenticate when pushing to the Hugging Face Hub. Run the following command in your terminal to set it as the default

git config --global credential.helper store

```

Do you have any idea? 🙂

---

<div class="post-metadata">

**Author:** ![g8a9](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/g8a9/32/39308_2.png) [@g8a9](https://discuss.huggingface.co/u/g8a9)\
**Post date:** [September 5, 2022, 3:22pm UTC](https://discuss.huggingface.co/t/botocore-exceptions-clienterror-an-error-occurred-authorizationheadermalformed-while-pushing-to-the-hub/22575/2 "2022-09-05T15:22:09Z")

</div>

Looking for a solution, I’ve updated my git credential manager to [git-credential-manager](https://github.com/GitCredentialManager/git-credential-manager).

Now that I run the command I see more info:

```auto
Uploading LFS objects: 100% (3/3), 629 MB | 0 B/s, done.
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 4 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 1.58 KiB | 1.58 MiB/s, done.
Total 7 (delta 1), reused 0 (delta 0)
remote: ----------------------------------------------------------
remote: Sorry, your push was rejected during YAML metadata verification:
remote: - Error: Invalid YAML in README.md: bad indentation of a mapping entry (1:83)
remote:
remote: 1 | ... ned with the online tagging app: https://huggingface.co/spaces/ ...
remote: -----------------------------------------^
remote: help: You can use a tool like http://www.yamllint.com/ to check it
remote: ----------------------------------------------------------
remote: Please find the documentation at:
remote: https://huggingface.co/docs/hub/models-cards#model-card-metadata
remote: ----------------------------------------------------------
To https://huggingface.co/datasets/g8a9/europarl_en-it
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://huggingface.co/datasets/g8a9/europarl_en-it'

```

Which is weird since I used the README.md template from the suggested [template](https://raw.githubusercontent.com/huggingface/datasets/main/templates/README.md).

However, I’ve edited the dataset card, inserted some YAML tags, and now pushing to the hub works.

I’m leaving this open just to let you know.

---

<div class="post-metadata">

**Author:** ![lhoestq](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lhoestq/32/52888_2.png) [@lhoestq](https://discuss.huggingface.co/u/lhoestq)\
**Post date:** [September 6, 2022, 12:26pm UTC](https://discuss.huggingface.co/t/botocore-exceptions-clienterror-an-error-occurred-authorizationheadermalformed-while-pushing-to-the-hub/22575/3 "2022-09-06T12:26:58Z")

</div>

Hi ! I’m glad you managed to make it work. Indeed the template shows a “TODO” in the YAML part that need to be replaced with actual YAML for the push to work
