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

ConnectionRefusedError: [Errno 111] Connection refused #31

Open
gandharvsuri opened this issue Oct 6, 2020 · 1 comment
Open

ConnectionRefusedError: [Errno 111] Connection refused #31

gandharvsuri opened this issue Oct 6, 2020 · 1 comment

Comments

@gandharvsuri
Copy link

gandharvsuri commented Oct 6, 2020

I've used Docker to set up the repository and trying to run the code snipped under 'Usage' in the readme.

I'm new to docker so please confirm if I'm doing it correctly. I first run the 'docker run' command and turn on the stranford_corenlp server. Then on another terminal, I run my code snippet.
I get the following error.

Traceback (most recent call last):
  File "/home/goorulabs/NarrativeArc/narrativearc/lib/python3.6/site-packages/urllib3/connection.py", line 160, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "/home/goorulabs/NarrativeArc/narrativearc/lib/python3.6/site-packages/urllib3/util/connection.py", line 84, in create_connection
    raise err
  File "/home/goorulabs/NarrativeArc/narrativearc/lib/python3.6/site-packages/urllib3/util/connection.py", line 74, 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/goorulabs/NarrativeArc/narrativearc/lib/python3.6/site-packages/urllib3/connectionpool.py", line 677, in urlopen
    chunked=chunked,
  File "/home/goorulabs/NarrativeArc/narrativearc/lib/python3.6/site-packages/urllib3/connectionpool.py", line 392, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.6/http/client.py", line 1264, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1310, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1259, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1038, in _send_output
    self.send(msg)
  File "/usr/lib/python3.6/http/client.py", line 976, in send
    self.connect()
  File "/home/goorulabs/NarrativeArc/narrativearc/lib/python3.6/site-packages/urllib3/connection.py", line 187, in connect
    conn = self._new_conn()
  File "/home/goorulabs/NarrativeArc/narrativearc/lib/python3.6/site-packages/urllib3/connection.py", line 172, in _new_conn
    self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f95e8d03b70>: 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/goorulabs/NarrativeArc/narrativearc/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/home/goorulabs/NarrativeArc/narrativearc/lib/python3.6/site-packages/urllib3/connectionpool.py", line 727, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/home/goorulabs/NarrativeArc/narrativearc/lib/python3.6/site-packages/urllib3/util/retry.py", line 439, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=9000): Max retries exceeded with url: /?properties=%7B%22outputFormat%22%3A+%22json%22%2C+%22annotators%22%3A+%22tokenize%2Cssplit%2Cpos%22%7D (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f95e8d03b70>: 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 "test.py", line 7, in <module>
    kp1 = launch.extract_keyphrases(embedding_distributor, pos_tagger, raw_text, 5,'en')
  File "/home/goorulabs/NarrativeArc/ai-research-keyphrase-extraction/launch.py", line 27, in extract_keyphrases
    tagged = ptagger.pos_tag_raw_text(raw_text)
  File "/home/goorulabs/NarrativeArc/ai-research-keyphrase-extraction/swisscom_ai/research_keyphrase/preprocessing/postagging.py", line 215, in pos_tag_raw_text
    tagged_text = list(raw_tag_text())
  File "/home/goorulabs/NarrativeArc/ai-research-keyphrase-extraction/swisscom_ai/research_keyphrase/preprocessing/postagging.py", line 211, in raw_tag_text
    tagged_data = self.parser.api_call(text, properties=properties)
  File "/home/goorulabs/NarrativeArc/narrativearc/lib/python3.6/site-packages/nltk/parse/corenlp.py", line 247, in api_call
    timeout=timeout,
  File "/home/goorulabs/NarrativeArc/narrativearc/lib/python3.6/site-packages/requests/sessions.py", line 578, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/home/goorulabs/NarrativeArc/narrativearc/lib/python3.6/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/goorulabs/NarrativeArc/narrativearc/lib/python3.6/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/home/goorulabs/NarrativeArc/narrativearc/lib/python3.6/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=9000): Max retries exceeded with url: /?properties=%7B%22outputFormat%22%3A+%22json%22%2C+%22annotators%22%3A+%22tokenize%2Cssplit%2Cpos%22%7D (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f95e8d03b70>: Failed to establish a new connection: [Errno 111] Connection refused',))
@gandharvsuri gandharvsuri changed the title KeyError: 'SENT2VEC' ConnectionRefusedError: [Errno 111] Connection refused Oct 6, 2020
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