Access denied when trying to download assets

#1
by Max400 - opened

Hello

I am following https://huggingface.co/docs/lerobot/en/envhub_leisaac and I get access denied when the python program tries to download assets (e.g. T_BeefPatties001_N001.p I can access the repo page in browser, but downloads are denied and there’s no β€œRequest access” button.

Could you grant my account access to the repo/LFS assets or point me to the correct access process? THanks

Lightwheel org

@Max400 Hello, this repository does not enable access requests, so in principle anyone should be able to download it. Could you provide more logs or details so that we can help identify the issue?

I encountered the exact same problem. Specifically,

from huggingface_hub import snapshot_download

token = "<my-hf-token>" 

snapshot_download(
    repo_id="LightwheelAI/leisaac_env",
    local_dir="./leisaac_env",
    repo_type="model", 
    token=token,
    ignore_patterns=["*.gitattributes", ".git"] 
)

Terminal output:

(leisaac) user@user-System-Product-Name:~/Desktop/leisaac$ python download_test.py 
Fetching 954 files:  19%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–                                                                                                       | 180/954 [00:08<00:37, 20.46it/s]
Traceback (most recent call last):
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/site-packages/huggingface_hub/utils/_http.py", line 402, in hf_raise_for_status
    response.raise_for_status()
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://cdn-lfs-us-1.hf.co/repos/c0/8e/c08ede9b7d365cdc2e6f417572de185d31e21e04eca61af0f8d9583e684fa56e/e567d5bee89d96b3ed7bd01891db829532ba74c1e49ac996906127756dd375fa?response-content-disposition=inline%3B+filename*%3DUTF-8%27%27T_BeefPatties001_N001.png%3B+filename%3D%22T_BeefPatties001_N001.png%22%3B&response-content-type=image%2Fpng&Expires=1766901309&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTc2NjkwMTMwOX19LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy11cy0xLmhmLmNvL3JlcG9zL2MwLzhlL2MwOGVkZTliN2QzNjVjZGMyZTZmNDE3NTcyZGUxODVkMzFlMjFlMDRlY2E2MWFmMGY4ZDk1ODNlNjg0ZmE1NmUvZTU2N2Q1YmVlODlkOTZiM2VkN2JkMDE4OTFkYjgyOTUzMmJhNzRjMWU0OWFjOTk2OTA2MTI3NzU2ZGQzNzVmYT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPSoifV19&Signature=SSENkb-0dQNw7VmOmBEny29uZFB4jmvUy5ZapAtcPznl665A-V~hVsE95GQHeDuiPBHZoTisYu3qT8yDFMcwtWxalzVVIM23jTqHEXFsBCc9jaRj3fxR0gqS8YYiN5FpoVKwShsL6T58DPQzgpdJ6mKqTTfunD18fZB~1VGKLg58nKe7SV3h6Ngpq0SfpS5TI14bcpBM4ojz9gp8FIBta7ZnWzTRmCv5J0vEP2tfmI0l5a7EwnxY2KmtmJaC3gsz687fG1IuYpxub8vUrySQY1mVILbyu6cHOorca0wVoCuF4p~DYiGo9tUGwL7jR7z4GblPUunG3zorI~rnyuCj8g__&Key-Pair-Id=K24J24Z295AEI9

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/user/Desktop/leisaac/download_test.py", line 7, in <module>
    snapshot_download(
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/site-packages/huggingface_hub/_snapshot_download.py", line 332, in snapshot_download
    thread_map(
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 69, in thread_map
    return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 51, in _executor_map
    return list(tqdm_class(ex.map(fn, *iterables, chunksize=chunksize), **kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/site-packages/tqdm/std.py", line 1181, in __iter__
    for obj in iterable:
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/concurrent/futures/_base.py", line 619, in result_iterator
    yield _result_or_cancel(fs.pop())
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/concurrent/futures/_base.py", line 317, in _result_or_cancel
    return fut.result(timeout)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/concurrent/futures/_base.py", line 456, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/site-packages/huggingface_hub/_snapshot_download.py", line 306, in _inner_hf_hub_download
    return hf_hub_download(
           ^^^^^^^^^^^^^^^^
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 987, in hf_hub_download
    return _hf_hub_download_to_local_dir(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 1297, in _hf_hub_download_to_local_dir
    _download_to_tmp_and_move(
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 1735, in _download_to_tmp_and_move
    http_get(
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 423, in http_get
    r = _request_wrapper(
        ^^^^^^^^^^^^^^^^^
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 307, in _request_wrapper
    hf_raise_for_status(response)
  File "/home/user/miniconda3/envs/leisaac/lib/python3.11/site-packages/huggingface_hub/utils/_http.py", line 466, in hf_raise_for_status
    raise _format(HfHubHTTPError, message, response) from e
huggingface_hub.errors.HfHubHTTPError: 403 Forbidden: None.
Cannot access content at: https://cdn-lfs-us-1.hf.co/repos/c0/8e/c08ede9b7d365cdc2e6f417572de185d31e21e04eca61af0f8d9583e684fa56e/e567d5bee89d96b3ed7bd01891db829532ba74c1e49ac996906127756dd375fa?response-content-disposition=inline%3B+filename*%3DUTF-8%27%27T_BeefPatties001_N001.png%3B+filename%3D%22T_BeefPatties001_N001.png%22%3B&response-content-type=image%2Fpng&Expires=1766901309&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTc2NjkwMTMwOX19LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy11cy0xLmhmLmNvL3JlcG9zL2MwLzhlL2MwOGVkZTliN2QzNjVjZGMyZTZmNDE3NTcyZGUxODVkMzFlMjFlMDRlY2E2MWFmMGY4ZDk1ODNlNjg0ZmE1NmUvZTU2N2Q1YmVlODlkOTZiM2VkN2JkMDE4OTFkYjgyOTUzMmJhNzRjMWU0OWFjOTk2OTA2MTI3NzU2ZGQzNzVmYT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPSoifV19&Signature=SSENkb-0dQNw7VmOmBEny29uZFB4jmvUy5ZapAtcPznl665A-V~hVsE95GQHeDuiPBHZoTisYu3qT8yDFMcwtWxalzVVIM23jTqHEXFsBCc9jaRj3fxR0gqS8YYiN5FpoVKwShsL6T58DPQzgpdJ6mKqTTfunD18fZB~1VGKLg58nKe7SV3h6Ngpq0SfpS5TI14bcpBM4ojz9gp8FIBta7ZnWzTRmCv5J0vEP2tfmI0l5a7EwnxY2KmtmJaC3gsz687fG1IuYpxub8vUrySQY1mVILbyu6cHOorca0wVoCuF4p~DYiGo9tUGwL7jR7z4GblPUunG3zorI~rnyuCj8g__&Key-Pair-Id=K24J24Z295AEI9.
Make sure your token has the correct permissions.
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message></Error>
Lightwheel org

@Integer003 After testing, we found that this situation can occasionally occur. It may be due to network issues, so you can try rerunning it first to see if the download succeeds.

I've tried several times and the problem persists. The result of opening this link is

AccessDeniedAccess denied
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>AccessDenied</Code>
<Message>Access denied</Message>
...
</Error>
Lightwheel org

@Max400 @Integer003 Let’s track this issue on GitHub.

EverNorif changed discussion status to closed

Sign up or log in to comment