Jake
10/19/2022, 7:35 PMpermission reader = nil // Not sure what this should be yet
symion
10/19/2022, 8:29 PMJoey
10/19/2022, 8:31 PMsymion
10/19/2022, 8:32 PMsymion
10/19/2022, 8:33 PMJoey
10/19/2022, 8:33 PMJoey
10/19/2022, 8:34 PMJoey
10/19/2022, 8:36 PMJoey
10/19/2022, 8:36 PM__alexb__
10/19/2022, 11:36 PM{"level":"error","requestID":"4fb88c480756c86269cef27e5015b574","error":"unable to read namespace config: context canceled","time":"2022-10-19T23:01:14Z","message":"received unexpected error"}
{"level":"error","grpc.component":"server","grpc.method":"CheckPermission","grpc.method_type":"unary","grpc.service":"authzed.api.v1.PermissionsService","peer.address":"192.168.32.4:46070","protocol":"grpc","requestID":"4fb88c480756c86269cef27e5015b574","grpc.start_time":"2022-10-19T23:01:14Z","grpc.code":"Unknown","grpc.error":"unable to read namespace config: context canceled","grpc.time_ms":"29.173","time":"2022-10-19T23:01:14Z","message":"finished call"}
the same issue was mentioned here before by a couple of people, but I didn't find any advice how this can be solved. Just like in the previously reported cases we started to get this issue in integration tests. Switching to serve-testing
helps with the tests but we've seen the same error a couple of times in the live system as well. We've tried to adjust lots of settings like SPICEDB_NS_CACHE_DISABLED, SPICEDB_DATASTORE_MAX_TX_RETRIES, etc., but nothing has made our tests reliable.
The tests aren't heavy at all, we create less than 100 relatioships and do various calls to check permissions and lookup resources. We run them using docker-compose and the official SpiceDB Python client.
Any hints would be really apreciated.Jake
10/20/2022, 1:31 AM--datastore-revision-quantization-interval
to 0__alexb__
10/20/2022, 8:52 AMSPICEDB_CONSISTENCY=fully_consistent
, adding --datastore-revision-quantization-interval=0
didn't have any noticeable effect - out of 10 test runs 2-3 still fail in seemingly random places - both on CheckPermission and WriteRelationships with the error I posted abovevroldanbet
10/20/2022, 8:55 AM__alexb__
10/20/2022, 8:58 AMwilliamdclt
10/20/2022, 10:58 AMunable to read namespace config: context canceled
in live environment too. They've not been quite problematic enough to bring it up here yet, but the time would have come at some point 😉
I don't understand how we'd have "a consistency error" here? (and as a side-note, seems like the logging can be improved here to make the root cause clearer?)Jake
10/20/2022, 1:23 PMJake
10/20/2022, 1:27 PMserve-testing
which uses the memdb datastore, do you still get the error after that switch or only when running with the postgres datastore?herb2193
10/20/2022, 2:33 PMJake
10/20/2022, 2:37 PMdefinition organization {
relation member: user // beth
permission do_an_expensive_thing = member
}
Jake
10/20/2022, 2:38 PMresource: organization:org_a, permission:do_an_expensive_thing subject: user:beth
__alexb__
10/20/2022, 2:45 PMserve-testing
it works just fine, so it's only postgresherb2193
10/20/2022, 2:48 PMJake
10/20/2022, 4:28 PMPrchowdh
10/20/2022, 4:38 PMdefinition usergroup {
relation admin: user
relation member: user + admin
}
Joey
10/20/2022, 5:02 PMuser + admin
mean?Joey
10/20/2022, 5:03 PMmember
include members and admins, you'd do:
definition usergroup {
relation admin: user
relation direct_member: user
permission member = admin + direct_member
}
Joey
10/20/2022, 5:03 PMmember
in your other relationJoey
10/20/2022, 5:03 PMdefinition document {
relation viewer: user | usergroup#member
}
Prchowdh
10/20/2022, 5:07 PMJoey
10/20/2022, 5:08 PM