Unable to import dataset through command line with v2.25.0 -- TUS offset error #8936
Open
2 tasks done
Labels
bug
Something isn't working
Actions before raising this issue
Steps to Reproduce
Expected Behavior
I expect a successful upload of the annotations to the server. It appears that the data is in fact uploaded according to the progress bar.
This functionality has stopped working since v2.22.1.
I can confirm that the upload of the data still works for v2.22.1.
Possible Solution
There is an issue with returning the TUS offset. The traceback is left in the next field.
Context
Here is the traceback.
`Uploading data: 100%|██████████████████████████████████████████████████████████████████████████████████| 56.5k/56.5k [00:00<00:00, 1.18MB/s]
Traceback (most recent call last):
File "/home/chronos/mainstay/inference_to_cvat/.venv/lib/python3.12/site-packages/cvat_sdk/core/uploading.py", line 110, in get_offset
resp = self._api_client.rest_client.HEAD(self.url, headers=self.headers)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chronos/mainstay/inference_to_cvat/.venv/lib/python3.12/site-packages/cvat_sdk/api_client/rest.py", line 226, in HEAD
return self.request("HEAD", url,
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chronos/mainstay/inference_to_cvat/.venv/lib/python3.12/site-packages/cvat_sdk/api_client/rest.py", line 200, in request
raise UnauthorizedException(http_resp=r)
cvat_sdk.api_client.exceptions.UnauthorizedException: Status Code: 401
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({'Server': 'nginx/1.18.0 (Ubuntu)', 'Date': 'Mon, 13 Jan 2025 13:51:57 GMT', 'Content-Type': 'application/vnd.cvat+json', 'Content-Length': '58', 'Connection': 'keep-alive', 'Allow': 'PATCH, HEAD, OPTIONS', 'Cross-Origin-Opener-Policy': 'same-origin', 'Referrer-Policy': 'strict-origin-when-cross-origin', 'Vary': 'Accept, Origin, Cookie', 'Www-Authenticate': 'Token', 'X-Content-Type-Options': 'nosniff', 'X-Frame-Options': 'DENY', 'X-Request-Id': 'd41eafd4-3d24-406a-ac28-62034d1ddc6d'})
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/chronos/mainstay/inference_to_cvat/.venv/bin/cvat-cli", line 8, in
sys.exit(main())
^^^^^^
File "/home/chronos/mainstay/inference_to_cvat/.venv/lib/python3.12/site-packages/cvat_cli/main.py", line 36, in main
popattr(parsed_args, "_executor")(client, **vars(parsed_args))
File "/home/chronos/mainstay/inference_to_cvat/.venv/lib/python3.12/site-packages/cvat_cli/_internal/commands_tasks.py", line 349, in execute
client.tasks.retrieve(obj_id=task_id).import_annotations(
File "/home/chronos/mainstay/inference_to_cvat/.venv/lib/python3.12/site-packages/cvat_sdk/core/proxies/tasks.py", line 177, in import_annotations
AnnotationUploader(self._client).upload_file_and_wait(
File "/home/chronos/mainstay/inference_to_cvat/.venv/lib/python3.12/site-packages/cvat_sdk/core/uploading.py", line 266, in upload_file_and_wait
response = self.upload_file(
^^^^^^^^^^^^^^^^^
File "/home/chronos/mainstay/inference_to_cvat/.venv/lib/python3.12/site-packages/cvat_sdk/core/uploading.py", line 191, in upload_file
real_filename = self._upload_file_data_with_tus(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chronos/mainstay/inference_to_cvat/.venv/lib/python3.12/site-packages/cvat_sdk/core/uploading.py", line 216, in _upload_file_data_with_tus
tus_uploader = self._make_tus_uploader(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chronos/mainstay/inference_to_cvat/.venv/lib/python3.12/site-packages/cvat_sdk/core/uploading.py", line 212, in _make_tus_uploader
return _MyTusUploader(client=client, api_client=api_client, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chronos/mainstay/inference_to_cvat/.venv/lib/python3.12/site-packages/cvat_sdk/core/uploading.py", line 72, in init
super().init(*_args, **_kwargs)
File "/home/chronos/mainstay/inference_to_cvat/.venv/lib/python3.12/site-packages/tusclient/uploader.py", line 125, in init
self.offset = self.get_offset()
^^^^^^^^^^^^^^^^^
File "/home/chronos/mainstay/inference_to_cvat/.venv/lib/python3.12/site-packages/tusclient/uploader.py", line 22, in _wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/chronos/mainstay/inference_to_cvat/.venv/lib/python3.12/site-packages/cvat_sdk/core/uploading.py", line 119, in get_offset
raise tus_uploader.TusCommunicationError(
tusclient.exceptions.TusCommunicationError: Attempt to retrieve offset failed with status 401
`
Environment
The text was updated successfully, but these errors were encountered: