jawnsyy
08/23/2023, 2:25 PMgrpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses; last error: UNKNOWN: ipv4:10.30.181.203:50051: Endpoint is neither UDS or TCP loopback address."
debug_error_string = "UNKNOWN:failed to connect to all addresses; last error: UNKNOWN: ipv4:10.30.181.203:50051: Endpoint is neither UDS or TCP loopback address. {created_time:"2023-08-23T14:19:24.347552207+00:00", grpc_status:14}"
From a look at the code (admittedly I'm not too familiar with gRPC), the code is always initializing a secure channel - so maybe the problem is that the Python library doesn't support plaintext connections except on localhost? https://github.com/authzed/authzed-py/blob/6ad60c5a20cd195363381a434efe8d64f76c1e53/authzed/api/v1/__init__.py#L54-L58vroldanbet
08/23/2023, 2:34 PMjawnsyy
08/23/2023, 2:36 PMjawnsyy
08/23/2023, 2:36 PMjawnsyy
08/23/2023, 2:37 PMvroldanbet
08/23/2023, 2:37 PMjawnsyy
08/23/2023, 2:37 PMjawnsyy
08/23/2023, 2:37 PMjawnsyy
08/23/2023, 2:38 PMvroldanbet
08/23/2023, 2:52 PMjawnsyy
08/23/2023, 2:54 PMvroldanbet
08/23/2023, 2:56 PMjawnsyy
08/23/2023, 2:56 PMjawnsyy
08/23/2023, 2:57 PMAlexB
08/23/2023, 3:12 PMclass Client(BaseClient):
def __init__(
self,
target: str,
credentials: Any,
options: list[tuple[str, object]] | None = None,
compression: Any = None,
use_async_client: bool = True,
):
...
# super ugly way to get the token value from the grpc credentials object
self.metadata = [
(
"authorization",
"bearer "
+ credentials._credentials._call_credentialses[0]._metadata_plugin._metadata_plugin._access_token,
)
]
...
and then in every call we have this
resp = await client.CheckPermission(
request=request,
metadata=client.metadata,
)AlexB
08/23/2023, 3:16 PMclient = Client(
f"{settings.SPICEDB_GRPC_HOST}:{settings.SPICEDB_GRPC_PORT}",
insecure_bearer_token_credentials(settings.SPICEDB_PRESHARED_KEY),
)jawnsyy
08/23/2023, 3:30 PMjawnsyy
08/23/2023, 4:40 PMvroldanbet
08/23/2023, 6:17 PMvroldanbet
08/23/2023, 6:18 PMjawnsyy
08/23/2023, 6:21 PMvroldanbet
08/23/2023, 8:57 PMjawnsyy
08/24/2023, 4:38 PMvroldanbet
08/25/2023, 8:43 AM