Uploading a data set

I am trying to update a file in a dataset.
When running my code locally, it works, but when I transfer it into the hugginface servers, I get an access error. The data set is private but I provide the token.
I get the following error:

Repository Not Found for url: https://huggingface.co/api/datasets/ImpMedLab/query_log/preupload/main.
Please make sure you specified the correct repo_id and repo_type.
If you are trying to access a private or gated repo, make sure you are authenticated.
Invalid username or password.
Note: Creating a commit assumes that the repo already exists on the Huggingface Hub. Please use create_repo if it’s not the case.

Hello, did you ever figure this out? I am having the same issue

I found the issue!

I was using

HfFileSystem('my_token_here')

instead of

HfFileSystem(token='my_token_here')

The lack of argument token made me unauthorised to access my repo, which gave me this 401 and weird url ‘preupload/main’.

So: explicitely pass the token argument, or check that you are logged in.
This url seems to be used in the background to pre-stage commits.