openreview/openreview-expertise

Connection error on running create_dataset

Closed this issue · 2 comments

Hello, I'm having an issue connecting to the OpenReview API when trying to run the expertise calculation.

python -m expertise.create_dataset ../config.json --baseurl https://api.openreview.net --username $ORUSER --password $ORPASS

where ORUSER is my username gneubig@cs.cmu.edu and ORPASS is my password. config.json is at the beginning of the error log below. Do you have an idea what the issue might be?

{
    "name": "acl_arr_acs_march_22_spectermfr",
    "match_group": "aclweb.org/ACL/ARR/2022/March/Area_Chairs",
    "csv_expertise": "ac_expertise.csv",
    "paper_invitation": "aclweb.org/ACL/ARR/2022/March/-/Blind_Submission",
    "exclusion_inv": "aclweb.org/ACL/ARR/2022/March/-/Expertise_Selection",
    "dataset": {
        "directory": "./"
    },
    "model": "specter+mfr",
    "model_params": {
        "specter_dir": "./specter/",
        "average_score": false,
        "max_score": true,
        "specter_batch_size": 16,
        "publications_path": "./",
        "submissions_path": "./",
        "mfr_feature_vocab_file": "./multifacet_recommender_data/feature_vocab_file",
        "mfr_checkpoint_dir": "./multifacet_recommender_data/mfr_model_checkpoint/",
        "mfr_epochs": 100,
        "mfr_batch_size": 50,
        "merge_alpha": 0.8,
        "work_dir": "./",
        "use_cuda": true,
        "scores_path": "./"
    },
    "experiment_dir": "./experiment/"
}
Traceback (most recent call last):
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/site-packages/urllib3/util/connection.py", line 95, in create_connection
    raise err
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/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/gneubig/anaconda3/envs/affinity/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/site-packages/urllib3/connectionpool.py", line 398, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/site-packages/urllib3/connection.py", line 239, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/http/client.py", line 1256, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/http/client.py", line 1302, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/http/client.py", line 1251, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/http/client.py", line 1011, in _send_output
    self.send(msg)
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/http/client.py", line 951, in send
    self.connect()
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/site-packages/urllib3/connection.py", line 205, in connect
    conn = self._new_conn()
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f60091b67f0>: 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/gneubig/anaconda3/envs/affinity/lib/python3.8/site-packages/requests/adapters.py", line 440, in send
    resp = conn.urlopen(
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/site-packages/urllib3/connectionpool.py", line 785, in urlopen
    retries = retries.increment(
  File "/home/gneubig/anaconda3/envs/affinity/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='localhost', port=3001): Max retries exceeded with url: /login (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f60091b67f0>: 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/gneubig/anaconda3/envs/affinity/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/gneubig/march_22_acs/openreview-expertise/expertise/create_dataset.py", line 482, in <module>
    client_v2 = openreview.api.OpenReviewClient(
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/site-packages/openreview/api/client.py", line 85, in __init__
    self.login_user(username, password)
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/site-packages/openreview/api/client.py", line 126, in login_user
    response = requests.post(self.login_url, headers=self.headers, json=user)
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/site-packages/requests/api.py", line 117, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/site-packages/requests/sessions.py", line 529, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/site-packages/requests/sessions.py", line 645, in send
    r = adapter.send(request, **kwargs)
  File "/home/gneubig/anaconda3/envs/affinity/lib/python3.8/site-packages/requests/adapters.py", line 519, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=3001): Max retries exceeded with url: /login (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f60091b67f0>: Failed to establish a new connection: [Errno 111] Connection refused'))

Hi Graham, sorry about this, there was a change to allow the expertise model to process data from the new API v2. However, there was an undocumented change to the create_dataset script to allow for an additional command line argument for the new V2 baseurl. The error is occurring because no value is provided and is assuming that API v2 is running on the localhost.

The following command should work:
python -m expertise.create_dataset ../config.json --baseurl https://api.openreview.net --baseurl_v2 https://api2.openreview.net --username $ORUSER --password $ORPASS

Let me know if you still run into an issue! I will be opening a separate issue to update this documentation.

That indeed seems to have fixed the error! Thank you for the quick response.