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

Cannot start Automatic annotation, Max retries exceeded with url: / #4904

Closed
paddy0489 opened this issue Sep 5, 2022 · 9 comments · Fixed by #4907
Closed

Cannot start Automatic annotation, Max retries exceeded with url: / #4904

paddy0489 opened this issue Sep 5, 2022 · 9 comments · Fixed by #4907

Comments

@paddy0489
Copy link

Browser Console:

cvat-app.tsx:284 Error: Inference status for the task 396 is failed. requests.exceptions.ConnectionError: HTTPConnectionPool(host='host.docker.internal', port=32001): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f77d9292160>: Failed to establish a new connection: [Errno -2] Name or service not known'))

Docker: cvat_worker_low

requests.exceptions.ConnectionError: HTTPConnectionPool(host='host.docker.internal', port=32001): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f77d9292160>: Failed to establish a new connection: [Errno -2] Name or service not known'))
Traceback (most recent call last):
  File "/opt/venv/lib/python3.8/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
  File "/opt/venv/lib/python3.8/site-packages/urllib3/util/connection.py", line 72, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/opt/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 398, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/opt/venv/lib/python3.8/site-packages/urllib3/connection.py", line 239, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/lib/python3.8/http/client.py", line 1256, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1302, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1251, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1011, in _send_output
    self.send(msg)
  File "/usr/lib/python3.8/http/client.py", line 951, in send
    self.connect()
  File "/opt/venv/lib/python3.8/site-packages/urllib3/connection.py", line 205, in connect
    conn = self._new_conn()
  File "/opt/venv/lib/python3.8/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f77d9292160>: Failed to establish a new connection: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/venv/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/opt/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 787, in urlopen
    retries = retries.increment(
  File "/opt/venv/lib/python3.8/site-packages/urllib3/util/retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='host.docker.internal', port=32001): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f77d9292160>: Failed to establish a new connection: [Errno -2] Name or service not known'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/venv/lib/python3.8/site-packages/rq/worker.py", line 936, in perform_job
    rv = job.perform()
  File "/opt/venv/lib/python3.8/site-packages/rq/job.py", line 684, in perform
    self._result = self._execute()
  File "/opt/venv/lib/python3.8/site-packages/rq/job.py", line 690, in _execute
    return self.func(*self.args, **self.kwargs)
  File "/home/django/cvat/apps/lambda_manager/views.py", line 638, in __call__
    LambdaJob._call_detector(function, db_task, labels, quality,
  File "/home/django/cvat/apps/lambda_manager/views.py", line 488, in _call_detector
    annotations = function.invoke(db_task, data={
  File "/home/django/cvat/apps/lambda_manager/views.py", line 265, in invoke
    response = self.gateway.invoke(self, payload)
  File "/home/django/cvat/apps/lambda_manager/views.py", line 96, in invoke
    reply = requests.post(url, timeout=NUCLIO_TIMEOUT, json=payload)
  File "/opt/venv/lib/python3.8/site-packages/requests/api.py", line 117, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/opt/venv/lib/python3.8/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/opt/venv/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/opt/venv/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/opt/venv/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='host.docker.internal', port=32001): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f77d9292160>: Failed to establish a new connection: [Errno -2] Name or service not known'))

Steps to Reproduce (for bugs)

  1. problems with NAT in previous version: sudo iptables -t nat -I PREROUTING 1 -d 172.17.0.1 -j DNAT --to 172.240.0.1 fix
  2. Automatic Annotation works.
  3. checkout newest version on develop
  4. start Automatic Annotation on nuclio
  5. Error: Fetching inference status for the task xyz

Your Environment

  • Git hash commit (git log -1): commit 4167a4e (HEAD -> develop, origin/develop, origin/HEAD)
  • Docker version : 20.10.17
  • Operating System and version (e.g. Linux, Windows, MacOS):
Linux  5.15.0-46-generic #49~20.04.1-Ubuntu SMP Thu Aug 4 19:15:44 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.5 LTS
Release:	20.04
Codename:	focal
@azhavoro
Copy link
Contributor

azhavoro commented Sep 5, 2022

Hi,
What is output of docker exec cvat_worker_low bash -c 'cat /etc/hosts'? Most likely the settings for this service are missing, try adding the following lines for cvat_worker_low service

  cvat_worker_low:
    extra_hosts:
      - "host.docker.internal:host-gateway"

@MikoyChinese
Copy link

@azhavoro

Also get this error:

Fetching inference status for the [task 60
Error: Inference status for the task 60 is failed. requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://host.docker.internal:49371/

@MikoyChinese
Copy link

Ooh, this my code error, my model return a error value to function handler, sorry.

  cvat_worker_low:
    extra_hosts:
      - "host.docker.internal:host-gateway"

This work for me. Thx.

@MrRe0
Copy link

MrRe0 commented Sep 6, 2022

Ooh, this my code error, my model return a error value to function handler, sorry.

  cvat_worker_low:
    extra_hosts:
      - "host.docker.internal:host-gateway"

This work for me. Thx.

hi,where to modify this file? it's in the container of 'cvat_worker_low' or other? but it's likely that the fiels of the container will be restored when reboot the container

@MrRe0
Copy link

MrRe0 commented Sep 6, 2022

@MikoyChinese I have the same error logs

@MikoyChinese
Copy link

MikoyChinese commented Sep 6, 2022

@MrRe0 You can create a new docker compose file as override such as docker-compose.override.yml, then add some code like this:

version: '3.3'

services:
  cvat_worker_low:
    extra_hosts:
      - "host.docker.internal:host-gateway"

then run this:

docker compose -f docker-compose.yml \
    -f components/serverless/docker-compose.serverless.yml \
    -f docker-compose.override.yml up -d

Finally, you need to clean your browser cookies to visit your host.

If you run this on develop branch, don't forget add CVAT_VERSION=dev in your command enviroment.

@MrRe0
Copy link

MrRe0 commented Sep 6, 2022

@MikoyChinese thanks a lot, now it works.

@paddy0489
Copy link
Author

paddy0489 commented Sep 6, 2022

  cvat_worker_low:
    extra_hosts:
      - "host.docker.internal:host-gateway"

it works for me, Thank you :)

@hoangdung3498
Copy link

hoangdung3498 commented Dec 14, 2023

Ooh, this my code error, my model return a error value to function handler, sorry.

  cvat_worker_low:
    extra_hosts:
      - "host.docker.internal:host-gateway"

This work for me. Thx.

i have same error with you :

Tracker initialization error
Request failed with status code 500. "500 Server Error: Internal Server Error for url: http://host.docker.internal:32769/".

But add extra_hosts to cvat_worker_low not work for me. Please help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants