label-studio icon indicating copy to clipboard operation
label-studio copied to clipboard

Cannot export annotations in terminal: ProxyError

Open Nika-St opened this issue 1 year ago • 0 comments

Describe the bug Cannot export annotations in terminal due to a ProxyError

To Reproduce Steps to reproduce the behavior:

  1. pip install label-studio
  2. label-studio start
  3. create a project, add and annotate files
  4. in terminal, in the same dir where label-studio was started and with the python venv where it is installed activated, run label-studio export 28 JSON
  5. command retuns an error => Database and media directory: /home//.local/share/label-studio => Static URL is set to: /static/ => Database and media directory: /home//.local/share/label-studio => Static URL is set to: /static/ Read environment variables from: /home//.local/share/label-studio/.env get 'SECRET_KEY' casted as '<class 'str'>' with default '' [Tracing] Create new propagation context: {'trace_id': '32c85ef43b4d450390f528a08f53788d', 'span_id': 'adaf62fbdf215090', 'parent_span_id': None, 'dynamic_sampling_context': None} Starting new HTTPS connection (1): pypi.org:443 Can't get latest version Traceback (most recent call last): File "/home//venvs/labeling/lib/python3.11/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home//venvs/labeling/lib/python3.11/site-packages/urllib3/util/connection.py", line 95, in create_connection raise err File "/home//venvs/labeling/lib/python3.11/site-packages/urllib3/util/connection.py", line 85, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home//venvs/labeling/lib/python3.11/site-packages/urllib3/connectionpool.py", line 712, in urlopen self._prepare_proxy(conn) File "/home//venvs/labeling/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1012, in _prepare_proxy conn.connect() File "/home//venvs/labeling/lib/python3.11/site-packages/urllib3/connection.py", line 363, in connect self.sock = conn = self._new_conn() ^^^^^^^^^^^^^^^^ File "/home//venvs/labeling/lib/python3.11/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7fe4ab451e10>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home//venvs/labeling/lib/python3.11/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "/home//venvs/labeling/lib/python3.11/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( ^^^^^^^^^^^^^^^^^^ File "/home//venvs/labeling/lib/python3.11/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /pypi/label-studio/json (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fe4ab451e10>: Failed to establish a new connection: [Errno 111] Connection refused')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home//venvs/labeling/lib/python3.11/site-packages/label_studio/core/utils/common.py", line 376, in get_latest_version response = requests.get(pypi_url, timeout=10).text ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home//venvs/labeling/lib/python3.11/site-packages/requests/api.py", line 73, in get return request("get", url, params=params, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home//venvs/labeling/lib/python3.11/site-packages/requests/api.py", line 59, in request return session.request(method=method, url=url, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home//venvs/labeling/lib/python3.11/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home//venvs/labeling/lib/python3.11/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home//venvs/labeling/lib/python3.11/site-packages/requests/adapters.py", line 513, in send raise ProxyError(e, request=request) requests.exceptions.ProxyError: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /pypi/label-studio/json (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fe4ab451e10>: Failed to establish a new connection: [Errno 111] Connection refused'))) Initializing database..

Expected behavior Annotations from the project with id 28 exported in JSON format into the current directory

Environment (please complete the following information):

  • OS: Ubuntu 20.04.6 LTS
  • Label Studio Version 1.11.0

Additional context Proxy and no_proxy in /etc/environment configured; also tried adding the same settings directly to: /home//.local/share/label-studio/.env which didn't help. Tried updating packages with pip - that works fine. Not sure why the process wants to connect to pypi.org and why it fails at that. Is there anywhere else I can change proxy settings? Thanks you!

Nika-St avatar Feb 11 '24 17:02 Nika-St