Open hemanth1225 opened 12 months ago
Hello @hemanth1225
Does it affect your experience?
later in the functions i added some code snippet, but due to exception it is exiting from here. it is required to resolve this.
thank you in advance
I'm seeing this issue randomly in 2.9.2 also. Some projects I can export all of the tasks without issue, others seem to choke after the first few tasks have been exported via the API.
INFO: 192.168.5.227:0 - "POST /api/auth/login HTTP/1.0" 200 OK
2023-12-27 14:40:40,389 DEBG 'uvicorn-0' stdout output:
INFO: 192.168.5.227:0 - "GET /api/labels?project_id=12&page_size=100000 HTTP/1.0" 200 OK
2023-12-27 14:40:40,499 DEBG 'uvicorn-0' stdout output:
INFO: 192.168.5.227:0 - "GET /api/tasks?project_id=12&page_size=100000 HTTP/1.0" 200 OK
2023-12-27 14:40:40,535 DEBG 'uvicorn-1' stdout output:
INFO: 192.168.5.227:0 - "GET /api/tasks/937/dataset?format=COCO%201.0&filename=5420-142252_1646048460_tray_142252 HTTP/1.0" 202 Accepted
2023-12-27 14:40:40,566 DEBG 'uvicorn-1' stdout output:
INFO: 192.168.5.227:0 - "GET /api/tasks/937/dataset?format=COCO%201.0&filename=5420-142252_1646048460_tray_142252 HTTP/1.0" 201 Created
2023-12-27 14:40:40,599 DEBG 'uvicorn-1' stdout output:
INFO: 192.168.5.227:0 - "GET /api/tasks/937/dataset?format=COCO%201.0&filename=5420-142252_1646048460_tray_142252&action=download HTTP/1.0" 200 OK
2023-12-27 14:40:40,599 DEBG 'uvicorn-1' stderr output:
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/opt/venv/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "/opt/venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
return await self.app(scope, receive, send)
File "/opt/venv/lib/python3.10/site-packages/django/core/handlers/asgi.py", line 160, in __call__
await self.handle(scope, receive, send)
File "/opt/venv/lib/python3.10/site-packages/django/core/handlers/asgi.py", line 190, in handle
await self.send_response(response, send)
File "/opt/venv/lib/python3.10/site-packages/django/core/handlers/asgi.py", line 289, in send_response
await send(
File "/opt/venv/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 577, in send
raise RuntimeError("Response content shorter than Content-Length")
RuntimeError: Response content shorter than Content-Length
2023-12-27 14:40:40,845 DEBG 'uvicorn-1' stdout output:
INFO: 192.168.5.227:0 - "GET /api/jobs?task_id=937&page_size=100000 HTTP/1.0" 200 OK
2023-12-27 14:40:40,887 DEBG 'uvicorn-0' stdout output:
INFO: 192.168.5.227:0 - "GET /api/jobs?task_id=937&page_size=100000 HTTP/1.0" 200 OK
2023-12-27 14:40:40,926 DEBG 'uvicorn-0' stdout output:
INFO: 192.168.5.227:0 - "GET /api/jobs/28257/data/meta HTTP/1.0" 200 OK
2023-12-27 14:40:41,083 DEBG 'uvicorn-0' stderr output:
[2023-12-27 14:40:41,082] ERROR django.request: Internal Server Error: /api/tasks/936/dataset
Traceback (most recent call last):
File "/opt/venv/lib/python3.10/site-packages/asgiref/sync.py", line 534, in thread_handler
raise exc_info[1]
File "/opt/venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 42, in inner
response = await get_response(request)
File "/opt/venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 253, in _get_response_async
response = await wrapped_callback(
File "/opt/venv/lib/python3.10/site-packages/asgiref/sync.py", line 479, in __call__
ret: _R = await loop.run_in_executor(
File "/opt/venv/lib/python3.10/site-packages/asgiref/current_thread_executor.py", line 40, in run
result = self.fn(*self.args, **self.kwargs)
File "/opt/venv/lib/python3.10/site-packages/asgiref/sync.py", line 538, in thread_handler
return func(*args, **kwargs)
File "/opt/venv/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
return view_func(*args, **kwargs)
File "/opt/venv/lib/python3.10/site-packages/rest_framework/viewsets.py", line 125, in view
return self.dispatch(request, *args, **kwargs)
File "/opt/venv/lib/python3.10/site-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "/opt/venv/lib/python3.10/site-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/opt/venv/lib/python3.10/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/opt/venv/lib/python3.10/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/home/django/cvat/apps/engine/views.py", line 1511, in dataset_export
return self.export_annotations(
File "/home/django/cvat/apps/engine/mixins.py", line 405, in export_annotations
return export_func(db_instance=self._object,
File "/home/django/cvat/apps/engine/views.py", line 3010, in _export_annotations
if osp.exists(file_path):
File "/usr/lib/python3.10/genericpath.py", line 19, in exists
os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
2023-12-27 14:40:41,084 DEBG 'uvicorn-0' stdout output:
INFO: 192.168.5.227:0 - "GET /api/tasks/936/dataset?format=COCO%201.0&filename=5420-142253_1646050452_tray_142253 HTTP/1.0" 500 Internal Server Error
2023-12-27 14:40:43,622 DEBG 'uvicorn-1' stdout output:
INFO: 10.201.6.6:0 - "GET /api/auth/rules HTTP/1.0" 304 Not Modified
The same tasks also throws an error 500 exporting through the web UI - exporting a different format does not throw an error and works as expected.
switching from v2.9.2 to dev seems to have fixed the issue.
I see the same in logs (2.9.2). Hope this will be resolved
I see the logs in 2.13.0 also. Currently try-catching, but this isn't a great solution on my end.
I see the same in logs 2.15.0
I encountered this situation in v2.19 as well. I was able to export normally in the afternoon, but when I tried to export the configuration file in the evening, it showed that the file did not exist. Checking the logs revealed the following error:
cvat_server | 2024-09-24 15:53:17,017 DEBG 'uvicorn-1' stdout output: cvat_server | INFO: 172.18.0.4:0 - "GET /api/auth/rules HTTP/1.0" 200 OK cvat_server | cvat_server | 2024-09-24 15:53:26,262 DEBG 'uvicorn-1' stdout output: cvat_server | INFO: 172.16.200.34:0 - "GET /api/tasks/5/annotations?org=Annotation&filename=9.zip&format=CVAT+for+images+1.1&save_images=false&action=download HTTP/1.0" 200 OK cvat_server | cvat_server | 2024-09-24 15:53:26,262 DEBG 'uvicorn-1' stderr output: cvat_server | ERROR: Exception in ASGI application cvat_server | Traceback (most recent call last): cvat_server | File "/opt/venv/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi cvat_server | result = await app( # type: ignore[func-returns-value] cvat_server | File "/opt/venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__ cvat_server | return await self.app(scope, receive, send) cvat_server | File "/opt/venv/lib/python3.10/site-packages/django/core/handlers/asgi.py", line 160, in __call__ cvat_server | await self.handle(scope, receive, send) cvat_server | File "/opt/venv/lib/python3.10/site-packages/django/core/handlers/asgi.py", line 190, in handle cvat_server | await self.send_response(response, send) cvat_server | File "/opt/venv/lib/python3.10/site-packages/django/core/handlers/asgi.py", line 289, in send_response cvat_server | await send( cvat_server | File "/opt/venv/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 577, in send cvat_server | raise RuntimeError("Response content shorter than Content-Length") cvat_server | RuntimeError: Response content shorter than Content-Length cvat_server | cvat_server | 2024-09-24 15:53:26,635 DEBG 'uvicorn-0' stderr output: cvat_server | [2024-09-24 15:53:26,635] WARNING django.request: Bad Request: /api/tasks/5/annotations cvat_server | cvat_server | 2024-09-24 15:53:26,635 DEBG 'uvicorn-0' stdout output: cvat_server | INFO: 172.16.200.34:0 - "GET /api/tasks/5/annotations?org=Annotation&filename=9.zip&format=CVAT+for+images+1.1&save_images=false&action=download HTTP/1.0" 400 Bad Request
Actions before raising this issue
Steps to Reproduce
steps:
ERROR: Exception in ASGI application Traceback (most recent call last): File "/opt/venv/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi result = await app( # type: ignore[func-returns-value] File "/opt/venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call return await self.app(scope, receive, send) File "/opt/venv/lib/python3.10/site-packages/django/core/handlers/asgi.py", line 160, in call await self.handle(scope, receive, send) File "/opt/venv/lib/python3.10/site-packages/django/core/handlers/asgi.py", line 190, in handle await self.send_response(response, send) File "/opt/venv/lib/python3.10/site-packages/django/core/handlers/asgi.py", line 289, in send_response await send( File "/opt/venv/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 577, in send raise RuntimeError("Response content shorter than Content-Length") RuntimeError: Response content shorter than Content-Length
7217
signal.py:
try: _export_annotations(db_instance=db_task, rq_id="/api/v1/tasks/{}/annotations/{}".format(db_task.id,"CVAT for images 1.1"), request="Get", action='', callback=dm.views.export_task_annotations, format_name="CVAT for images 1.1", filename="annotation.zip", location_conf=location_conf1 ) except Exception as e: print("Error in download api cvat server") print("Error: " ,e) time.sleep(5) print("after export annotation") annotation_export_path="/home/django/data/tasks/{}/export_cache/annotations_cvat-for-images-11.ZIP".format(db_task.id) data= {"file_id":db_task.name,"status" : "completed"} annotated_files={"annotation_xml":open(annotation_export_path,"rb")} url= BASE_url+"annotation/update/status/" r = requests.post(url, data=data,files=annotated_files) pass except Exception as e: print("error in sandbox backend api") print(e)
_export_annotation():
def _export_annotations(db_instance, rq_id, request, format_name, action, callback, filename, location_conf): if action not in {"", "download"}: raise serializers.ValidationError( "Unexpected action specified for the request")