question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

upload_file raises internal server error (500)

See original GitHub issue

Describe the bug

upload_file raises 500. 🥲

Reproduction

upload_file(path_or_fileobj="/content/dummy/anscombe.json", path_in_repo="./anscombe.json", repo_id="merve/test-dataset", repo_type='dataset')

Logs

About to commit to the hub: 1 addition(s) and 0 deletion(s).
DEBUG:huggingface_hub.hf_api:About to commit to the hub: 1 addition(s) and 0 deletion(s).
---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/huggingface_hub/utils/_errors.py in hf_raise_for_status(response, endpoint_name)
    212     try:
--> 213         response.raise_for_status()
    214     except HTTPError as e:
8 frames
/usr/local/lib/python3.7/dist-packages/requests/models.py
 in raise_for_status(self)
    940         if http_error_msg:
--> 941             raise HTTPError(http_error_msg, response=self)
    942 

HTTPError: 500 Server Error: Internal Server Error for url: https://huggingface.co/api/datasets/merve/test-dataset/preupload/main
The above exception was the direct cause of the following exception:

HfHubHTTPError                            Traceback (most recent call last)
<ipython-input-33-a04df30414b9> in <module>
----> 1 upload_file(path_or_fileobj="/content/dummy/anscombe.json", path_in_repo="./anscombe.json", repo_id="merve/test-dataset", repo_type='dataset')

/usr/local/lib/python3.7/dist-packages/huggingface_hub/utils/_validators.py in _inner_fn(*args, **kwargs)
     92                 validate_repo_id(arg_value)
     93 
---> 94         return fn(*args, **kwargs)
     95 
     96     return _inner_fn

/usr/local/lib/python3.7/dist-packages/huggingface_hub/hf_api.py in upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, identical_ok, commit_message, commit_description, create_pr, parent_commit)
   2231             revision=revision,
   2232             create_pr=create_pr,
-> 2233             parent_commit=parent_commit,
   2234         )
   2235 

/usr/local/lib/python3.7/dist-packages/huggingface_hub/utils/_validators.py in _inner_fn(*args, **kwargs)
     92                 validate_repo_id(arg_value)
     93 
---> 94         return fn(*args, **kwargs)
     95 
     96     return _inner_fn

/usr/local/lib/python3.7/dist-packages/huggingface_hub/hf_api.py in create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit)
   2035                 revision=revision,
   2036                 endpoint=self.endpoint,
-> 2037                 create_pr=create_pr,
   2038             )
   2039         except RepositoryNotFoundError as e:

/usr/local/lib/python3.7/dist-packages/huggingface_hub/utils/_validators.py in _inner_fn(*args, **kwargs)
     92                 validate_repo_id(arg_value)
     93 
---> 94         return fn(*args, **kwargs)
     95 
     96     return _inner_fn

/usr/local/lib/python3.7/dist-packages/huggingface_hub/_commit_api.py in fetch_upload_modes(additions, repo_type, repo_id, token, revision, endpoint, create_pr)
    375         params={"create_pr": "1"} if create_pr else None,
    376     )
--> 377     hf_raise_for_status(resp, endpoint_name="preupload")
    378 
    379     preupload_info = validate_preupload_info(resp.json())

/usr/local/lib/python3.7/dist-packages/huggingface_hub/utils/_errors.py in hf_raise_for_status(response, endpoint_name)
    252         # Convert `HTTPError` into a `HfHubHTTPError` to display request information
    253         # as well (request id and/or server error message)
--> 254         raise HfHubHTTPError(str(HTTPError), response=response) from e
    255 
    256 

HfHubHTTPError: <class 'requests.exceptions.HTTPError'> (Request ID: UhHsDxMBluql0nUY6KeYL)
Internal Error - We’re working hard to fix that as soon as possible!

System Info

huggingface-hub-0.10.0.dev0
huggingface-hub @ git+https://github.com/huggingface/huggingface_hub@5958f17a012d7420b53f4a0cc6a51b2d13a3866a (main branch)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
coyotte508commented, Sep 23, 2022

Can you open an issue in moon-landing, at least for the 500?

0reactions
Wauplincommented, Sep 26, 2022

Can you open an issue in moon-landing, at least for the 500?

@coyotte508 yep, done. I’m closing this one then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

php - Upload File - 500 Internal Server Error - Stack Overflow
The first thing you should check is the permissions on the upload-to folder If it doesn't have read/write access (775 for example), ...
Read more >
Why do I receive "Internal Server Error 500" after I upload my ...
If your FTP client uploads the files with permissions higher than 755 you will receive Internal Server Error 500. Permissions higher than 755...
Read more >
Why am I getting an internal server error when uploading files ...
The problem I'm having is that whenever I upload anything over 13MB or so the upload reaches 100% then instantly greets me with...
Read more >
How to Fix a 500 Internal Server Error on Your WordPress Site
The 500 Internal Server Error status code occurs when the server encounters an error that prevents it from fulfilling the request.
Read more >
500 Internal Server Error (trying to upload file) : Forums
Hi, I'm completely new to web application development. I followed the Flask tutorial for uploading files ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found