Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to import dataset through command line with v2.25.0 -- TUS offset error #8936

Open
2 tasks done
hermda02 opened this issue Jan 13, 2025 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@hermda02
Copy link

Actions before raising this issue

  • I searched the existing issues and did not find anything similar.
  • I read/searched the docs

Steps to Reproduce

  1. Create a COCO 1.0 dataset directory
  2. Contact server through cli to ensure ability to log in through command line
  3. run `cvat-cli --auth ... task import-dataset --format 'COCO 1.0' ...

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

- OS: Ubuntu 24.04.1 LTS
- Docker version:  27.3.1, build ce12230
@hermda02 hermda02 added the bug Something isn't working label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant