Skip to content

Unable to retrieve backends #58

@xf345

Description

@xf345

Working in a Rigetti JupyterHub notebook, the following error is occurring and unable to get the backends available for the Rigetti qiskit provider.

Code:

from qiskit_rigetti import RigettiQCSProvider

provider = RigettiQCSProvider()
backend = provider.backends()

Version:

qiskit-rigetti==0.4.5 

Error:

ConnectError: [Errno -2] Name or service not known

Stack Trace
ConnectError                              Traceback (most recent call last)
/opt/conda/lib/python3.9/site-packages/httpx/_exceptions.py in map_exceptions(mapping, **kwargs)
    338     try:
--> 339         yield
    340     except Exception as exc:

/opt/conda/lib/python3.9/site-packages/httpx/_client.py in _send_single_request(self, request, timeout)
    853         with map_exceptions(HTTPCORE_EXC_MAP, request=request):
--> 854             (status_code, headers, stream, ext) = transport.request(
    855                 request.method.encode(),

/opt/conda/lib/python3.9/site-packages/httpcore/_sync/connection_pool.py in request(self, method, url, headers, stream, ext)
    199             try:
--> 200                 response = connection.request(
    201                     method, url, headers=headers, stream=stream, ext=ext

/opt/conda/lib/python3.9/site-packages/httpcore/_sync/connection.py in request(self, method, url, headers, stream, ext)
     86                     )
---> 87                     self.socket = self._open_socket(timeout)
     88                 self._create_connection(self.socket)

/opt/conda/lib/python3.9/site-packages/httpcore/_sync/connection.py in _open_socket(self, timeout)
    107             if self.uds is None:
--> 108                 return self.backend.open_tcp_stream(
    109                     hostname,

/opt/conda/lib/python3.9/site-packages/httpcore/_backends/sync.py in open_tcp_stream(self, hostname, port, ssl_context, timeout, local_address)
    143                 )
--> 144             return SyncSocketStream(sock=sock)
    145 

/opt/conda/lib/python3.9/contextlib.py in __exit__(self, typ, value, traceback)
    136             try:
--> 137                 self.gen.throw(typ, value, traceback)
    138             except StopIteration as exc:

/opt/conda/lib/python3.9/site-packages/httpcore/_exceptions.py in map_exceptions(map)
     11             if isinstance(exc, from_exc):
---> 12                 raise to_exc(exc) from None
     13         raise

ConnectError: [Errno -2] Name or service not known

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

ConnectError                              Traceback (most recent call last)
/tmp/ipykernel_202/1099804041.py in <module>
----> 1 provider.get_backend()

/opt/conda/lib/python3.9/site-packages/qiskit/providers/provider.py in get_backend(self, name, **kwargs)
     47                 more than one backend matches the filtering criteria.
     48         """
---> 49         backends = self.backends(name, **kwargs)
     50         if len(backends) > 1:
     51             raise QiskitBackendNotFoundError('More than one backend matches the criteria')

/opt/conda/lib/python3.9/site-packages/qiskit_rigetti/_qcs_provider.py in backends(self, name, **__)
     66         """
     67         if not self._backends:
---> 68             for qpu, data in self._get_quantum_processors().items():
     69                 configuration = _configuration(qpu, num_qubits=data["num_qubits"], local=False, simulator=False)
     70                 self._backends.append(

/opt/conda/lib/python3.9/site-packages/qiskit_rigetti/_qcs_provider.py in _get_quantum_processors(self)
    110         with build_sync_client(configuration=self._client_configuration) as qcs_client:  # type: httpx.Client
    111             return cast(
--> 112                 Dict[str, Any], qcs_client.get("https://forest-server.qcs.rigetti.com/devices").json()["devices"]
    113             )
    114 

/opt/conda/lib/python3.9/site-packages/httpx/_client.py in get(self, url, params, headers, cookies, auth, allow_redirects, timeout)
    898         **Parameters**: See `httpx.request`.
    899         """
--> 900         return self.request(
    901             "GET",
    902             url,

/opt/conda/lib/python3.9/site-packages/httpx/_client.py in request(self, method, url, content, data, files, json, params, headers, cookies, auth, allow_redirects, timeout)
    719             cookies=cookies,
    720         )
--> 721         return self.send(
    722             request, auth=auth, allow_redirects=allow_redirects, timeout=timeout
    723         )

/opt/conda/lib/python3.9/site-packages/httpx/_client.py in send(self, request, stream, auth, allow_redirects, timeout)
    751         auth = self._build_request_auth(request, auth)
    752 
--> 753         response = self._send_handling_auth(
    754             request,
    755             auth=auth,

/opt/conda/lib/python3.9/site-packages/httpx/_client.py in _send_handling_auth(self, request, auth, timeout, allow_redirects, history)
    789 
    790         while True:
--> 791             response = self._send_handling_redirects(
    792                 request,
    793                 timeout=timeout,

/opt/conda/lib/python3.9/site-packages/httpx/_client.py in _send_handling_redirects(self, request, timeout, allow_redirects, history)
    821                 )
    822 
--> 823             response = self._send_single_request(request, timeout)
    824             response.history = list(history)
    825 

/opt/conda/lib/python3.9/site-packages/httpx/_client.py in _send_single_request(self, request, timeout)
    852 
    853         with map_exceptions(HTTPCORE_EXC_MAP, request=request):
--> 854             (status_code, headers, stream, ext) = transport.request(
    855                 request.method.encode(),
    856                 request.url.raw,

/opt/conda/lib/python3.9/contextlib.py in __exit__(self, typ, value, traceback)
    135                 value = typ()
    136             try:
--> 137                 self.gen.throw(typ, value, traceback)
    138             except StopIteration as exc:
    139                 # Suppress StopIteration *unless* it's the same exception that

/opt/conda/lib/python3.9/site-packages/httpx/_exceptions.py in map_exceptions(mapping, **kwargs)
    354 
    355         message = str(exc)
--> 356         raise mapped_exc(message, **kwargs) from exc  # type: ignore
    357 
    358 

ConnectError: [Errno -2] Name or service not known

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