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

unable to start the CoreNLP server #1392

Open
fang196 opened this issue May 10, 2024 · 1 comment
Open

unable to start the CoreNLP server #1392

fang196 opened this issue May 10, 2024 · 1 comment
Labels

Comments

@fang196
Copy link

fang196 commented May 10, 2024

Describe the bug
I went down the issue when running this demo.

To Reproduce
Run the following code:

# Import client module
from stanza.server import CoreNLPClient
# Construct a CoreNLPClient with some basic annotators, a memory allocation of 4GB, and port number 9001
client = CoreNLPClient(
    annotators=['tokenize','ssplit', 'pos', 'lemma', 'ner'], 
    memory='4G', 
    endpoint='http://localhost:9000',
    be_quiet=False)
print(client)

# Start the background server and wait for some time
# Note that in practice this is totally optional, as by default the server will be started when the first annotation is performed
client.start()
import time; time.sleep(10)

Error message:

2024-05-10 16:41:27 INFO: Writing properties to tmp file: corenlp_server-1c2c0b7050454efc.props
<stanza.server.client.CoreNLPClient object at 0x7fab78e1e4c0>
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
File ~/miniconda3/envs/instblip-peft/lib/python3.8/site-packages/stanza/server/client.py:134, in RobustService.start(self)
    [133](https://vscode-remote+ssh-002dremote-002ba100-00282-0029.vscode-resource.vscode-cdn.net/home/qxy/AD%2BLLMs/scienceqa/CoT/Graph-of-Thought/~/miniconda3/envs/instblip-peft/lib/python3.8/site-packages/stanza/server/client.py:133) try:
--> [134](https://vscode-remote+ssh-002dremote-002ba100-00282-0029.vscode-resource.vscode-cdn.net/home/qxy/AD%2BLLMs/scienceqa/CoT/Graph-of-Thought/~/miniconda3/envs/instblip-peft/lib/python3.8/site-packages/stanza/server/client.py:134)     sock.bind((self.host, self.port))
    [135](https://vscode-remote+ssh-002dremote-002ba100-00282-0029.vscode-resource.vscode-cdn.net/home/qxy/AD%2BLLMs/scienceqa/CoT/Graph-of-Thought/~/miniconda3/envs/instblip-peft/lib/python3.8/site-packages/stanza/server/client.py:135) except socket.error as e:

OSError: [Errno 98] Address already in use

The above exception was the direct cause of the following exception:

PermanentlyFailedException                Traceback (most recent call last)
Cell In[12], [line 11](vscode-notebook-cell:?execution_count=12&line=11)
      [7](vscode-notebook-cell:?execution_count=12&line=7) print(client)
      [9](vscode-notebook-cell:?execution_count=12&line=9) # Start the background server and wait for some time
     [10](vscode-notebook-cell:?execution_count=12&line=10) # Note that in practice this is totally optional, as by default the server will be started when the first annotation is performed
---> [11](vscode-notebook-cell:?execution_count=12&line=11) client.start()
     [12](vscode-notebook-cell:?execution_count=12&line=12) import time; time.sleep(10)

File ~/miniconda3/envs/instblip-peft/lib/python3.8/site-packages/stanza/server/client.py:141, in RobustService.start(self)
    [139](https://vscode-remote+ssh-002dremote-002ba100-00282-0029.vscode-resource.vscode-cdn.net/home/qxy/AD%2BLLMs/scienceqa/CoT/Graph-of-Thought/~/miniconda3/envs/instblip-peft/lib/python3.8/site-packages/stanza/server/client.py:139)                 return
    [140](https://vscode-remote+ssh-002dremote-002ba100-00282-0029.vscode-resource.vscode-cdn.net/home/qxy/AD%2BLLMs/scienceqa/CoT/Graph-of-Thought/~/miniconda3/envs/instblip-peft/lib/python3.8/site-packages/stanza/server/client.py:140)             else:
--> [141](https://vscode-remote+ssh-002dremote-002ba100-00282-0029.vscode-resource.vscode-cdn.net/home/qxy/AD%2BLLMs/scienceqa/CoT/Graph-of-Thought/~/miniconda3/envs/instblip-peft/lib/python3.8/site-packages/stanza/server/client.py:141)                 raise PermanentlyFailedException("Error: unable to start the CoreNLP server on port %d "
    [142](https://vscode-remote+ssh-002dremote-002ba100-00282-0029.vscode-resource.vscode-cdn.net/home/qxy/AD%2BLLMs/scienceqa/CoT/Graph-of-Thought/~/miniconda3/envs/instblip-peft/lib/python3.8/site-packages/stanza/server/client.py:142)                                                  "(possibly something is already running there)" % self.port) from e
    [143](https://vscode-remote+ssh-002dremote-002ba100-00282-0029.vscode-resource.vscode-cdn.net/home/qxy/AD%2BLLMs/scienceqa/CoT/Graph-of-Thought/~/miniconda3/envs/instblip-peft/lib/python3.8/site-packages/stanza/server/client.py:143) if self.be_quiet:
    [144](https://vscode-remote+ssh-002dremote-002ba100-00282-0029.vscode-resource.vscode-cdn.net/home/qxy/AD%2BLLMs/scienceqa/CoT/Graph-of-Thought/~/miniconda3/envs/instblip-peft/lib/python3.8/site-packages/stanza/server/client.py:144)     # Issue #26: subprocess.DEVNULL isn't supported in python 2.7.
    [145](https://vscode-remote+ssh-002dremote-002ba100-00282-0029.vscode-resource.vscode-cdn.net/home/qxy/AD%2BLLMs/scienceqa/CoT/Graph-of-Thought/~/miniconda3/envs/instblip-peft/lib/python3.8/site-packages/stanza/server/client.py:145)     if hasattr(subprocess, 'DEVNULL'):

PermanentlyFailedException: Error: unable to start the CoreNLP server on port 9000 (possibly something is already running there)

Environment (please complete the following information):

  • OS: Ubuntu20.8
  • Python version: Python 3.8.18 from Anaconda
  • Stanza version: 1.8.2

Additional context
I've tried netstat -anpe | grep "9000" | grep "LISTEN" and it returned tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 1000 918534305 -. However, other ports that don't have anything running also encountered the same problem.

ps -o pid,cmd | grep java shows no result either.

Please provide more solutions.

@fang196 fang196 added the bug label May 10, 2024
@AngledLuffa
Copy link
Collaborator

AngledLuffa commented May 10, 2024 via email

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

No branches or pull requests

2 participants