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

requests.exceptions.ConnectionError: Could not reach host. Are you offline? #94

Open
Weishaoya opened this issue Sep 2, 2024 · 0 comments

Comments

@Weishaoya
Copy link

system:
ubuntu 22.04 (no gpu)
I am a Chinese user. When I run the commad, "docker run -p 8000:8000 -e HF_ENDPOINT=https://hf-mirror.com savatar101/omniparse:0.1", It has the following bug:

== CUDA ==

CUDA Version 11.8.0

Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:
https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license

A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.

WARNING: The NVIDIA Driver was not detected. GPU functionality will not be available.
Use the NVIDIA Container Toolkit to start this container with GPU support; see
https://docs.nvidia.com/datacenter/cloud-native/ .

/usr/local/lib/python3.10/dist-packages/pydantic/_internal/fields.py:161: UserWarning: Field "model_list" has conflict with protected namespace "model".

You may be able to resolve this warning by setting model_config['protected_namespaces'] = ().
warnings.warn(

   .88888.                      oo  888888ba                                      
  d8'   `8b                         88    `8b                                     
  88     88 88d8b.d8b. 88d888b. dP a88aaaa8P' .d8888b. 88d888b. .d8888b. .d8888b. 
  88     88 88'`88'`88 88'  `88 88  88        88'  `88 88'  `88 Y8ooooo. 88ooood8 
  Y8.   .8P 88  88  88 88    88 88  88        88.  .88 88             88 88.  ... 
   `8888P'  dP  dP  dP dP    dP dP  dP        `88888P8 dP       `88888P' `88888P' 

Created by Adithya S K : https://twitter.com/adithya_s_k

[LOG] ✅ Loading OCR Model
Loaded detection model vikp/surya_det2 on device cpu with dtype torch.float32
Loaded detection model vikp/surya_layout2 on device cpu with dtype torch.float32
Loaded reading order model vikp/surya_order on device cpu with dtype torch.float32
Loaded recognition model vikp/surya_rec on device cpu with dtype torch.float32
Loaded texify model to cpu with torch.float32 dtype
[LOG] ✅ Loading Vision Model
A new version of the following files was downloaded from https://huggingface.co/microsoft/Florence-2-base:

  • configuration_florence2.py
    . Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
    A new version of the following files was downloaded from https://huggingface.co/microsoft/Florence-2-base:
  • modeling_florence2.py
    . Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
    A new version of the following files was downloaded from https://huggingface.co/microsoft/Florence-2-base:
  • processing_florence2.py
    . Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
    [LOG] ✅ Loading Audio Model
    100%|███████████████████████████████████████| 461M/461M [00:08<00:00, 58.9MiB/s]
    [LOG] ✅ Loading Web Crawler
    Traceback (most recent call last):
    File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 789, in urlopen
    response = self._make_request(
    File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 490, in _make_request
    raise new_e
    File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 466, in _make_request
    self._validate_conn(conn)
    File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 1095, in _validate_conn
    conn.connect()
    File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 652, in connect
    sock_and_verified = _ssl_wrap_socket_and_match_hostname(
    File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 805, in ssl_wrap_socket_and_match_hostname
    ssl_sock = ssl_wrap_socket(
    File "/usr/local/lib/python3.10/dist-packages/urllib3/util/ssl
    .py", line 465, in ssl_wrap_socket
    ssl_sock = ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
    File "/usr/local/lib/python3.10/dist-packages/urllib3/util/ssl
    .py", line 509, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
    File "/usr/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
    File "/usr/lib/python3.10/ssl.py", line 1100, in _create
    self.do_handshake()
    File "/usr/lib/python3.10/ssl.py", line 1371, in do_handshake
    self._sslobj.do_handshake()
    ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/requests/adapters.py", line 667, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 843, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.10/dist-packages/urllib3/util/retry.py", line 474, in increment
raise reraise(type(error), error, _stacktrace)
File "/usr/local/lib/python3.10/dist-packages/urllib3/util/util.py", line 38, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 789, in urlopen
response = self._make_request(
File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 490, in _make_request
raise new_e
File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 466, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 1095, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 652, in connect
sock_and_verified = _ssl_wrap_socket_and_match_hostname(
File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 805, in ssl_wrap_socket_and_match_hostname
ssl_sock = ssl_wrap_socket(
File "/usr/local/lib/python3.10/dist-packages/urllib3/util/ssl
.py", line 465, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
File "/usr/local/lib/python3.10/dist-packages/urllib3/util/ssl
.py", line 509, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib/python3.10/ssl.py", line 513, in wrap_socket
return self.sslsocket_class._create(
File "/usr/lib/python3.10/ssl.py", line 1100, in _create
self.do_handshake()
File "/usr/lib/python3.10/ssl.py", line 1371, in do_handshake
self._sslobj.do_handshake()
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/webdriver_manager/core/http.py", line 32, in get
resp = requests.get(
File "/usr/local/lib/python3.10/dist-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/requests/adapters.py", line 682, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/app/server.py", line 62, in
main()
File "/app/server.py", line 48, in main
load_omnimodel(args.documents, args.media, args.web)
File "/app/omniparse/init.py", line 58, in load_omnimodel
shared_state.crawler = WebCrawler(verbose=True)
File "/app/omniparse/web/web_crawler.py", line 34, in init
self.crawler_strategy = crawler_strategy or LocalSeleniumCrawlerStrategy(verbose=verbose)
File "/app/omniparse/web/crawler_strategy.py", line 92, in init
self.service = Service(ChromeDriverManager().install())
File "/usr/local/lib/python3.10/dist-packages/webdriver_manager/chrome.py", line 40, in install
driver_path = self._get_driver_binary_path(self.driver)
File "/usr/local/lib/python3.10/dist-packages/webdriver_manager/core/manager.py", line 35, in _get_driver_binary_path
binary_path = self._cache_manager.find_driver(driver)
File "/usr/local/lib/python3.10/dist-packages/webdriver_manager/core/driver_cache.py", line 105, in find_driver
driver_version = self.get_cache_key_driver_version(driver)
File "/usr/local/lib/python3.10/dist-packages/webdriver_manager/core/driver_cache.py", line 152, in get_cache_key_driver_version
return driver.get_driver_version_to_download()
File "/usr/local/lib/python3.10/dist-packages/webdriver_manager/core/driver.py", line 48, in get_driver_version_to_download
return self.get_latest_release_version()
File "/usr/local/lib/python3.10/dist-packages/webdriver_manager/drivers/chrome.py", line 59, in get_latest_release_version
response = self._http_client.get(url)
File "/usr/local/lib/python3.10/dist-packages/webdriver_manager/core/http.py", line 35, in get
raise exceptions.ConnectionError(f"Could not reach host. Are you offline?")
requests.exceptions.ConnectionError: Could not reach host. Are you offline?

How could I solve the bug? Thank you!

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

No branches or pull requests

1 participant