cvat-ai / cvat

Annotate better with CVAT, the industry-leading data engine for machine learning. Used and trusted by teams at any scale, for data of any scale.
https://cvat.ai
MIT License
12.68k stars 3.02k forks source link

Error in django request #8494

Open ShreenidhiH opened 1 month ago

ShreenidhiH commented 1 month ago

Hi, I have installed cvat v12.6.2. Everything else is working fine, but I am getting these errors in Cvat_opa container logs

{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp: lookup cvat-server on 127.0.0.11:53: no such host","name":"cvat","plugin":"bundle","time":"2024-10-01T11:15:58Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp: lookup cvat-server on 127.0.0.11:53: no such host","name":"cvat","plugin":"bundle","time":"2024-10-01T11:15:59Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp: lookup cvat-server on 127.0.0.11:53: no such host","name":"cvat","plugin":"bundle","time":"2024-10-01T11:15:59Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp: lookup cvat-server on 127.0.0.11:53: no such host","name":"cvat","plugin":"bundle","time":"2024-10-01T11:15:59Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp: lookup cvat-server on 127.0.0.11:53: no such host","name":"cvat","plugin":"bundle","time":"2024-10-01T11:15:59Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp 172.19.0.17:8080: connect: connection refused","name":"cvat","plugin":"bundle","time":"2024-10-01T11:16:03Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp 172.19.0.17:8080: connect: connection refused","name":"cvat","plugin":"bundle","time":"2024-10-01T11:16:04Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp 172.19.0.17:8080: connect: connection refused","name":"cvat","plugin":"bundle","time":"2024-10-01T11:16:05Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp 172.19.0.17:8080: connect: connection refused","name":"cvat","plugin":"bundle","time":"2024-10-01T11:16:08Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp 172.19.0.17:8080: connect: connection refused","name":"cvat","plugin":"bundle","time":"2024-10-01T11:16:12Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp 172.19.0.17:8080: connect: connection refused","name":"cvat","plugin":"bundle","time":"2024-10-01T11:16:19Z"}

Cvat-server has no errors, healthcheck command for all container is running fine. Also I am not able to post the requests to cvat (for example this one : http://ip_adress:8080/api/auth/login) it gives server error image

And these error I am getting in cvat_server when above post is sent

[2024-10-01 11:17:41,839] ERROR django.request: Internal Server Error: /api/auth/login
Traceback (most recent call last):
  File "/opt/venv/lib/python3.10/site-packages/asgiref/sync.py", line 518, 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 284, in _get_response_async
    response = await sync_to_async(
  File "/opt/venv/lib/python3.10/site-packages/asgiref/sync.py", line 468, in __call__
    ret = await asyncio.shield(exec_coro)
  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 522, in thread_handler
    return func(*args, **kwargs)
  File "/opt/venv/lib/python3.10/site-packages/django/template/response.py", line 114, in render
    self.content = self.rendered_content
  File "/opt/venv/lib/python3.10/site-packages/rest_framework/response.py", line 70, in rendered_content
    ret = renderer.render(self.data, accepted_media_type, context)
  File "/opt/venv/lib/python3.10/site-packages/rest_framework/renderers.py", line 723, in render
    context = self.get_context(data, accepted_media_type, renderer_context)
  File "/opt/venv/lib/python3.10/site-packages/rest_framework/renderers.py", line 701, in get_context
    'filter_form': self.get_filter_form(data, view, request),
  File "/opt/venv/lib/python3.10/site-packages/rest_framework/renderers.py", line 629, in get_filter_form
    queryset = view.get_queryset()
  File "/opt/venv/lib/python3.10/site-packages/rest_framework/generics.py", line 63, in get_queryset
    assert self.queryset is not None, (
AssertionError: 'LoginViewEx' should either include a `queryset` attribute, or override the `get_queryset()` method.

IS this related to OPA issue? Can someone help me with the issue?

bsekachev commented 1 month ago

IS this related to OPA issue?

I do not think so.

It is normal to have several errors like these:

{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp 172.19.0.17:8080: connect: connection refused","name":"cvat","plugin":"bundle","time":"2024-10-01T11:16:19Z"}

They happen when server not started yet or restarting in some short period of time. Check timestamp of these errors to understand when they happened (time is in UTC)

bsekachev commented 1 month ago

I have installed cvat v12.6.2.

We do not have 12.6.2. The latest version is 2.19.1.

ShreenidhiH commented 1 month ago

Oh, sorry , I have installed cvat version 2.16.2. Then what is the cause of the cvat error , when I try to login through post?

azhavoro commented 1 month ago

@ShreenidhiH

  1. Please use the latest release
  2. Also, provide exact steps to reproduce the issue on our side
ShreenidhiH commented 1 month ago

@azhavoro Steps followed. referred this installation guide

  1. git clone -b v2.16.2 https://github.com/cvat-ai/cvat

  2. export CVAT_HOST=”

  3. cd cvat sudo -E docker compose up -d

  4. sudo docker exec -it cvat_server bash -ic 'python3 ~/manage.py createsuperuser'

  5. sudo -E docker compose -f components/serverless/docker-compose.serverless.yml up -d

  6. Cvat was up in http://:8080

  7. Opened the http://:8080/api/auth/login and gave username, password. Getting server error 500 (screenshot that I have attached) in the frontend and in the cvat_server logs I am seeing error

[2024-10-01 11:17:41,839] ERROR django.request: Internal Server Error: /api/auth/login
Traceback (most recent call last):
  File "/opt/venv/lib/python3.10/site-packages/asgiref/sync.py", line 518, 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 284, in _get_response_async
    response = await sync_to_async(
  File "/opt/venv/lib/python3.10/site-packages/asgiref/sync.py", line 468, in __call__
    ret = await asyncio.shield(exec_coro)
  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 522, in thread_handler
    return func(*args, **kwargs)
  File "/opt/venv/lib/python3.10/site-packages/django/template/response.py", line 114, in render
    self.content = self.rendered_content
  File "/opt/venv/lib/python3.10/site-packages/rest_framework/response.py", line 70, in rendered_content
    ret = renderer.render(self.data, accepted_media_type, context)
  File "/opt/venv/lib/python3.10/site-packages/rest_framework/renderers.py", line 723, in render
    context = self.get_context(data, accepted_media_type, renderer_context)
  File "/opt/venv/lib/python3.10/site-packages/rest_framework/renderers.py", line 701, in get_context
    'filter_form': self.get_filter_form(data, view, request),
  File "/opt/venv/lib/python3.10/site-packages/rest_framework/renderers.py", line 629, in get_filter_form
    queryset = view.get_queryset()
  File "/opt/venv/lib/python3.10/site-packages/rest_framework/generics.py", line 63, in get_queryset
    assert self.queryset is not None, (
AssertionError: 'LoginViewEx' should either include a `queryset` attribute, or override the `get_queryset()` method.
ShreenidhiH commented 1 month ago

@azhavoro Tried installing latest cvat version 2.19.1 Still getting same server error and that error in cvat_server logs. Is there any backend changes that needs to be done?

azhavoro commented 1 month ago

I was only able to reproduce this if I set the email field inside json, but you didn't mention that... Try setting the username and password fields and leaving email as an empty string.