Skip to content

Issue When Trying to Import AttributeQuery and TextQuery #90

@yenon118

Description

@yenon118

Hi RCSB PDB group,

I was trying to use the rcsb-api (https://github.com/rcsb/py-rcsb-api) to get some data today. However, I was experiencing connection refuse error when I was trying to import AttributeQuery and TextQuery. Could you please help me with this issue? If that is an issue with your server, please let me know as well. The error messages are attached below:

>>> from rcsbapi.search import AttributeQuery, TextQuery
Traceback (most recent call last):
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/httpx/_transports/default.py", line 101, in map_httpcore_exceptions
    yield
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/httpx/_transports/default.py", line 250, in handle_request
    resp = self._pool.handle_request(req)
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/httpcore/_sync/connection_pool.py", line 256, in handle_request
    raise exc from None
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/httpcore/_sync/connection_pool.py", line 236, in handle_request
    response = connection.handle_request(
        pool_request.request
    )
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/httpcore/_sync/connection.py", line 101, in handle_request
    raise exc
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/httpcore/_sync/connection.py", line 78, in handle_request
    stream = self._connect(request)
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/httpcore/_sync/connection.py", line 124, in _connect
    stream = self._network_backend.connect_tcp(**kwargs)
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/httpcore/_backends/sync.py", line 207, in connect_tcp
    with map_exceptions(exc_map):
         ~~~~~~~~~~~~~~^^^^^^^^^
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/contextlib.py", line 162, in __exit__
    self.gen.throw(value)
    ~~~~~~~~~~~~~~^^^^^^^
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
    raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 111] Connection refused

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

Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    from rcsbapi.search import AttributeQuery, TextQuery
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/rcsbapi/search/__init__.py", line 4, in <module>
    from rcsbapi.search.search_query import SEARCH_SCHEMA  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/rcsbapi/search/search_query.py", line 662, in <module>
    SEARCH_SCHEMA = SearchSchema(Attr)
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/rcsbapi/search/search_schema.py", line 195, in __init__
    self.struct_schema = self._reload_schema(struct_attr_schema_url, struct_attr_schema_file, refetch, use_fallback)
                         ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/rcsbapi/search/search_schema.py", line 209, in _reload_schema
    sD = self._fetch_schema(schema_url)
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/rcsbapi/search/search_schema.py", line 223, in _fetch_schema
    response = httpx.get(url, timeout=None, headers={"User-Agent": const.USER_AGENT}, follow_redirects=True)
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/httpx/_api.py", line 195, in get
    return request(
        "GET",
    ...<9 lines>...
        trust_env=trust_env,
    )
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/httpx/_api.py", line 109, in request
    return client.request(
           ~~~~~~~~~~~~~~^
        method=method,
        ^^^^^^^^^^^^^^
    ...<8 lines>...
        follow_redirects=follow_redirects,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/httpx/_client.py", line 825, in request
    return self.send(request, auth=auth, follow_redirects=follow_redirects)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/httpx/_client.py", line 914, in send
    response = self._send_handling_auth(
        request,
    ...<2 lines>...
        history=[],
    )
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/httpx/_client.py", line 942, in _send_handling_auth
    response = self._send_handling_redirects(
        request,
        follow_redirects=follow_redirects,
        history=history,
    )
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
    response = self._send_single_request(request)
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/httpx/_client.py", line 1014, in _send_single_request
    response = transport.handle_request(request)
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/httpx/_transports/default.py", line 249, in handle_request
    with map_httpcore_exceptions():
         ~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/contextlib.py", line 162, in __exit__
    self.gen.throw(value)
    ~~~~~~~~~~~~~~^^^^^^^
  File "/mnt/pixstor/joshitr-lab/chanye/tools/miniconda/envs/rcsb-api/lib/python3.13/site-packages/httpx/_transports/default.py", line 118, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 111] Connection refused

Thank you.

Best,
Yen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions