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

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:

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:

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? :slight_smile:

Looking for a solution, I’ve updated my git credential manager to git-credential-manager.

Now that I run the command I see more info:

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.

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.

1 Like

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