Hi team Why `"path":"/ory.keto.relation_tuples.v1a...
# general
p
Hi team Why
"path":"/ory.keto.relation_tuples.v1alpha2.ReadService/ListRelationTuples"
return
\"status\":404,\"text_status\":\"Not Found\"
P.S. I use self-hosted keto
m
Is Keto running and reachable? Maybe a network issue.
p
it log from keto
here is full log
Copy code
{
  "http_request": {
    "headers": {
      "accept-encoding": "gzip",
      "content-type": "application/grpc",
      "te": "trailers",
      "user-agent": "grpc-go/1.65.0",
      "x-forwarded-for": "1.1.1.1",
      "x-forwarded-host": "<http://keto-r.example.com:443|keto-r.example.com:443>",
      "x-forwarded-port": "443",
      "x-forwarded-proto": "https",
      "x-forwarded-server": "traefik",
      "x-real-ip": "1.1.1.1"
    },
    "host": "<http://keto-r.example.com:443|keto-r.example.com:443>",
    "method": "POST",
    "path": "/ory.keto.relation_tuples.v1alpha2.ReadService/ListRelationTuples",
    "query": null,
    "remote": "172.18.0.7:41446",
    "scheme": "http"
  },
  "http_response": {
    "headers": {
      "content-type": "text/plain; charset=utf-8",
      "x-content-type-options": "nosniff"
    },
    "size": 19,
    "status": 404,
    "text_status": "Not Found",
    "took": 234294
  },
  "level": "info",
  "msg": "completed handling request",
  "time": "2024-08-28T11:58:29.99733834Z"
}
@magnificent-energy-493 REST api
ory/keto-client-go
work properly But grpc not
@magnificent-energy-493 here is too old example https://github.com/ory/keto/blob/v0.7.0-alpha.1/contrib/docs-code-samples/list-api-display-objects/01-list-PM/main.go#L1-L35 and this is a part of my code
Copy code
func (s KetoGRPCService) ListRelations(ctx context.Context, props ListRelationProps) {
  log := xLogger.GetLogger("ketogrpcServiceV1.ListRelations")
  client := rts.NewReadServiceClient(s.connections.ReadConn)

  rq := &rts.RelationQuery{
   Namespace: &props.Namespace,
   Object:    props.Object,
   Relation:  props.Relation,
  }
  if props.SubjectId != nil {
   rq.Subject = rts.NewSubjectID(*props.SubjectId)
  } else if props.SubjectSet != nil {
   rq.Subject = rts.NewSubjectSet(
    props.SubjectSet.Namespace, props.SubjectSet.Object, props.SubjectSet.Relation,
   )
  }

  log.Debug().Interface("rq", rq).Msgf("RelationQuery")

  req := &rts.ListRelationTuplesRequest{
   RelationQuery: rq,
  }

  res, err := client.ListRelationTuples(ctx, req)
  if err != nil {
   log.Error().Err(err).Msgf("ListRelationTuples error: %v", err.Error())
   return
  }

  log.Debug().
   Str("NextPageToken", res.NextPageToken).
   Str("raw", res.String()).
   Interface("rt", res.GetRelationTuples()).Msgf("ListRelationTuples result")

}
Error
Copy code
"error": "rpc error: code = Unimplemented desc = unexpected HTTP status code received from server: 404 (Not Found); transport: received unexpected content-type \"text/plain; charset=utf-8\""