Git Product home page Git Product logo

Comments (7)

josephschorr avatar josephschorr commented on June 12, 2024

@reza-ebrahimi I'm not sure I follow: the schema you presented is not valid and should not be able to be written into SpiceDB (permissions cannot be named *). I validated that the parser and WriteSchema calls do indeed fail with an expected error in #1713

from spicedb.

josephschorr avatar josephschorr commented on June 12, 2024

I also validated that attempting to use * as a permission in any of the permissions APIs results in an expected InvalidArgument error: #1714

from spicedb.

reza-ebrahimi avatar reza-ebrahimi commented on June 12, 2024

You are correct, WriteSchema returns error for * permission.

I prepared crash steps in the form of golang tests which you can easily reproduce it.

steps to produce:

  • Create a fresh database.
  • Run docker-compose up to migrate database and run spicedb server.
  • Run the tests below, should pass all tests without any error.
  • Change all permission for org object to *: should be permission * = read + create + update + delete.
  • Run tests again, server should crash.

Tests:

package main_test

import (
	"context"
	"errors"
	"io"
	"log"
	"testing"

	v1 "github.com/authzed/authzed-go/proto/authzed/api/v1"
	"github.com/authzed/authzed-go/v1"
	"github.com/authzed/grpcutil"
	"github.com/stretchr/testify/require"
	"google.golang.org/grpc"
	"google.golang.org/grpc/credentials/insecure"
)

var (
	ctx   context.Context
	authz *authzed.Client
)

var schema string = `
definition user {}

definition org {
    relation admin: user
    relation member: user

    permission read = admin + member
    permission create = admin
    permission update = admin
    permission delete = admin
    permission all = read + create + update + delete
}

definition workspace {
    relation parent: org
    relation admin: user
    relation member: user    

    permission read = member + admin + parent->member + parent->admin
    permission create = admin + parent->admin
    permission update = admin + parent->admin
    permission delete = admin + parent->admin
    permission all = read + create + update + delete
}

definition project {
    relation parent: workspace
    relation admin: user
    relation member: user    

    permission read = member + admin + parent->member + parent->admin
    permission create = admin + parent->admin
    permission update = admin + parent->admin
    permission delete = admin + parent->admin
    permission all = read + create + update + delete
}
`

func init() {
	client, err := authzed.NewClient(
		"localhost:50051",
		grpcutil.WithInsecureBearerToken("my_passphrase_key"),
		grpc.WithTransportCredentials(insecure.NewCredentials()),
	)
	if err != nil {
		log.Fatalf("unable to initialize client: %s", err)
	}

	authz = client
	ctx = context.Background()
}

func TestMutationCreateSchema(t *testing.T) {
	t.Run("create schema", func(t *testing.T) {
		resp, err := authz.WriteSchema(ctx, &v1.WriteSchemaRequest{
			Schema: schema,
		})
		token := resp.GetWrittenAt()

		require.NoError(t, err)
		require.NotNil(t, resp)
		require.NotEmpty(t, token)
	})

	t.Run("read schema", func(t *testing.T) {
		resp, err := authz.ReadSchema(ctx, &v1.ReadSchemaRequest{})
		token := resp.GetReadAt()

		require.NoError(t, err)
		require.NotNil(t, resp)
		require.NotEmpty(t, token)
	})
}

func TestMutationCreateRelationship(t *testing.T) {
	t.Run("create relationships", func(t *testing.T) {
		relationships := []*v1.RelationshipUpdate{
			{
				Operation: v1.RelationshipUpdate_OPERATION_CREATE,
				Relationship: &v1.Relationship{
					Resource: &v1.ObjectReference{
						ObjectType: "org",
						ObjectId:   "acme",
					},
					Relation: "admin",
					Subject: &v1.SubjectReference{
						Object: &v1.ObjectReference{
							ObjectType: "user",
							ObjectId:   "org_admin",
						},
					},
				},
			},
			{
				Operation: v1.RelationshipUpdate_OPERATION_CREATE,
				Relationship: &v1.Relationship{
					Resource: &v1.ObjectReference{
						ObjectType: "org",
						ObjectId:   "acme",
					},
					Relation: "member",
					Subject: &v1.SubjectReference{
						Object: &v1.ObjectReference{
							ObjectType: "user",
							ObjectId:   "org_member",
						},
					},
				},
			},
			{
				Operation: v1.RelationshipUpdate_OPERATION_CREATE,
				Relationship: &v1.Relationship{
					Resource: &v1.ObjectReference{
						ObjectType: "workspace",
						ObjectId:   "it_department",
					},
					Relation: "parent",
					Subject: &v1.SubjectReference{
						Object: &v1.ObjectReference{
							ObjectType: "org",
							ObjectId:   "acme",
						},
					},
				},
			},
			{
				Operation: v1.RelationshipUpdate_OPERATION_CREATE,
				Relationship: &v1.Relationship{
					Resource: &v1.ObjectReference{
						ObjectType: "workspace",
						ObjectId:   "it_department",
					},
					Relation: "member",
					Subject: &v1.SubjectReference{
						Object: &v1.ObjectReference{
							ObjectType: "user",
							ObjectId:   "ws_member",
						},
					},
				},
			},
		}
		resp, err := authz.WriteRelationships(ctx, &v1.WriteRelationshipsRequest{Updates: relationships})
		require.NoError(t, err)

		token := resp.GetWrittenAt()
		require.NotNil(t, resp)
		require.NotEmpty(t, token)
	})
}

func TestQueryReadRelationship(t *testing.T) {
	t.Run("read org relationships", func(t *testing.T) {
		resp, err := authz.ReadRelationships(ctx, &v1.ReadRelationshipsRequest{
			Consistency: &v1.Consistency{
				Requirement: &v1.Consistency_FullyConsistent{
					FullyConsistent: true,
				},
			},
			RelationshipFilter: &v1.RelationshipFilter{
				ResourceType: "org",
			},
		})

		require.NoError(t, err)
		require.NotNil(t, resp)

		for {
			relationship, err := resp.Recv()
			if errors.Is(err, io.EOF) {
				break
			}

			require.NoError(t, err)
			require.NotNil(t, relationship)
		}
		require.NoError(t, resp.CloseSend())
	})

	t.Run("read workspace relationships", func(t *testing.T) {
		resp, err := authz.ReadRelationships(ctx, &v1.ReadRelationshipsRequest{
			Consistency: &v1.Consistency{
				Requirement: &v1.Consistency_FullyConsistent{
					FullyConsistent: true,
				},
			},
			RelationshipFilter: &v1.RelationshipFilter{
				ResourceType: "workspace",
			},
		})

		require.NoError(t, err)
		require.NotNil(t, resp)

		for {
			relationship, err := resp.Recv()
			if errors.Is(err, io.EOF) {
				break
			}

			require.NoError(t, err)
			require.NotNil(t, relationship)
		}
		require.NoError(t, resp.CloseSend())
	})
}

func TestQueryLookups(t *testing.T) {
	t.Run("lookup user relationships", func(t *testing.T) {
		resp, err := authz.LookupSubjects(context.Background(), &v1.LookupSubjectsRequest{
			Consistency: &v1.Consistency{
				Requirement: &v1.Consistency_FullyConsistent{
					FullyConsistent: true,
				},
			},
			Resource: &v1.ObjectReference{
				ObjectType: "workspace",
				ObjectId:   "it_department",
			},
			Permission:        "create",
			SubjectObjectType: "user",
		})

		require.NoError(t, err)
		require.NotNil(t, resp)

		for {
			relationship, err := resp.Recv()
			if errors.Is(err, io.EOF) {
				break
			}

			require.NoError(t, err)
			require.NotNil(t, relationship)
		}
		require.NoError(t, resp.CloseSend())
	})
}

Test logs:

❯ go test -v
=== RUN   TestMutationCreateSchema
=== RUN   TestMutationCreateSchema/create_schema
    main_test.go:60: 
                Error Trace:    authz/spicedb/main_test.go:60
                Error:          Received unexpected error:
                                rpc error: code = InvalidArgument desc = parse error in `schema`, line 11, column 16: Expected identifier, found token TokenTypeStar
                Test:           TestMutationCreateSchema/create_schema
=== RUN   TestMutationCreateSchema/read_schema
    main_test.go:69: 
                Error Trace:    authz/spicedb/main_test.go:69
                Error:          Received unexpected error:
                                rpc error: code = NotFound desc = No schema has been defined; please call WriteSchema to start
                Test:           TestMutationCreateSchema/read_schema
--- FAIL: TestMutationCreateSchema (0.02s)
    --- FAIL: TestMutationCreateSchema/create_schema (0.00s)
    --- FAIL: TestMutationCreateSchema/read_schema (0.01s)
=== RUN   TestMutationCreateRelationship
=== RUN   TestMutationCreateRelationship/create_relationships
    main_test.go:144: 
                Error Trace:    authz/spicedb/main_test.go:144
                Error:          Received unexpected error:
                                rpc error: code = FailedPrecondition desc = object definition `org` not found
                Test:           TestMutationCreateRelationship/create_relationships
--- FAIL: TestMutationCreateRelationship (0.01s)
    --- FAIL: TestMutationCreateRelationship/create_relationships (0.01s)
=== RUN   TestQueryReadRelationship
=== RUN   TestQueryReadRelationship/read_org_relationships
    main_test.go:174: 
                Error Trace:    authz/spicedb/main_test.go:174
                Error:          Received unexpected error:
                                rpc error: code = FailedPrecondition desc = object definition `org` not found
                Test:           TestQueryReadRelationship/read_org_relationships
=== RUN   TestQueryReadRelationship/read_workspace_relationships
    main_test.go:203: 
                Error Trace:    authz/spicedb/main_test.go:203
                Error:          Received unexpected error:
                                rpc error: code = FailedPrecondition desc = object definition `workspace` not found
                Test:           TestQueryReadRelationship/read_workspace_relationships
--- FAIL: TestQueryReadRelationship (0.01s)
    --- FAIL: TestQueryReadRelationship/read_org_relationships (0.00s)
    --- FAIL: TestQueryReadRelationship/read_workspace_relationships (0.00s)
=== RUN   TestQueryLookups
=== RUN   TestQueryLookups/lookup_user_relationships
    main_test.go:239: 
                Error Trace:    authz/spicedb/main_test.go:239
                Error:          Received unexpected error:
                                rpc error: code = Unavailable desc = error reading from server: EOF
                Test:           TestQueryLookups/lookup_user_relationships
--- FAIL: TestQueryLookups (0.04s)
    --- FAIL: TestQueryLookups/lookup_user_relationships (0.04s)
FAIL
exit status 1
FAIL    authz/spicedb        0.661s

Crash logs:

❯ docker-compose up
Starting spicedb_spicedb-migrate_1 ... done
Recreating spicedb_spicedb_1       ... done
Attaching to spicedb_spicedb-migrate_1, spicedb_spicedb_1
spicedb_1          | {"level":"info","format":"auto","log_level":"info","provider":"zerolog","async":false,"time":"2024-01-18T12:55:51Z","message":"configured logging"}
spicedb_1          | {"level":"info","v":0,"provider":"none","endpoint":"","service":"spicedb","insecure":false,"sampleRatio":0.01,"time":"2024-01-18T12:55:51Z","message":"configured opentelemetry tracing"}
spicedb_1          | {"level":"warn","this-version":"v1.28.0","error":"GET https://api.github.com/repos/authzed/spicedb/releases/latest: 403 API rate limit exceeded for 213.172.123.242. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.) [rate reset in 5m33s]","time":"2024-01-18T12:55:51Z","message":"could not perform version checking; if this problem persists or to skip this check, add --skip-release-check=true"}
spicedb_1          | {"level":"info","ClusterDispatchCacheConfig.Enabled":true,"ClusterDispatchCacheConfig.MaxCost":"70%","ClusterDispatchCacheConfig.Metrics":true,"ClusterDispatchCacheConfig.Name":"cluster_dispatch","ClusterDispatchCacheConfig.NumCounters":100000,"Datastore":"nil","DatastoreConfig.BootstrapFileContents":"(map of size 0)","DatastoreConfig.BootstrapFiles":"[]","DatastoreConfig.BootstrapOverwrite":false,"DatastoreConfig.BootstrapTimeout":10000,"DatastoreConfig.ConnectRate":100,"DatastoreConfig.DisableStats":false,"DatastoreConfig.EnableConnectionBalancing":true,"DatastoreConfig.EnableDatastoreMetrics":true,"DatastoreConfig.Engine":"postgres","DatastoreConfig.FollowerReadDelay":4800,"DatastoreConfig.GCInterval":180000,"DatastoreConfig.GCMaxOperationTime":60000,"DatastoreConfig.GCWindow":86400000,"DatastoreConfig.LegacyFuzzing":-0.000001,"DatastoreConfig.MaxRetries":10,"DatastoreConfig.MaxRevisionStalenessPercent":0.1,"DatastoreConfig.MigrationPhase":"(empty)","DatastoreConfig.OverlapKey":"key","DatastoreConfig.OverlapStrategy":"static","DatastoreConfig.ReadConnPool.HealthCheckInterval":30000,"DatastoreConfig.ReadConnPool.MaxIdleTime":1800000,"DatastoreConfig.ReadConnPool.MaxLifetime":1800000,"DatastoreConfig.ReadConnPool.MaxLifetimeJitter":0,"DatastoreConfig.ReadConnPool.MaxOpenConns":20,"DatastoreConfig.ReadConnPool.MinOpenConns":20,"DatastoreConfig.ReadOnly":false,"DatastoreConfig.RequestHedgingEnabled":false,"DatastoreConfig.RequestHedgingInitialSlowValue":10,"DatastoreConfig.RequestHedgingMaxRequests":1000000,"DatastoreConfig.RequestHedgingQuantile":0.95,"DatastoreConfig.RevisionQuantization":5000,"DatastoreConfig.SchemaWatchHeartbeat":0,"DatastoreConfig.SpannerCredentialsFile":"(empty)","DatastoreConfig.SpannerEmulatorHost":"(empty)","DatastoreConfig.SpannerMaxSessions":400,"DatastoreConfig.SpannerMinSessions":100,"DatastoreConfig.TablePrefix":"(empty)","DatastoreConfig.URI":"(sensitive)","DatastoreConfig.WatchBufferLength":1024,"DatastoreConfig.WriteConnPool.HealthCheckInterval":30000,"DatastoreConfig.WriteConnPool.MaxIdleTime":1800000,"DatastoreConfig.WriteConnPool.MaxLifetime":1800000,"DatastoreConfig.WriteConnPool.MaxLifetimeJitter":0,"DatastoreConfig.WriteConnPool.MaxOpenConns":10,"DatastoreConfig.WriteConnPool.MinOpenConns":10,"DisableV1SchemaAPI":false,"DisableVersionResponse":false,"DispatchCacheConfig.Enabled":true,"DispatchCacheConfig.MaxCost":"30%","DispatchCacheConfig.Metrics":true,"DispatchCacheConfig.Name":"dispatch","DispatchCacheConfig.NumCounters":10000,"DispatchClientMetricsEnabled":true,"DispatchClientMetricsPrefix":"(empty)","DispatchClusterMetricsEnabled":true,"DispatchClusterMetricsPrefix":"(empty)","DispatchConcurrencyLimits.Check":0,"DispatchConcurrencyLimits.LookupResources":0,"DispatchConcurrencyLimits.LookupSubjects":0,"DispatchConcurrencyLimits.ReachableResources":0,"DispatchHashringReplicationFactor":100,"DispatchHashringSpread":1,"DispatchMaxDepth":50,"DispatchSecondaryUpstreamAddrs":"(map of size 0)","DispatchSecondaryUpstreamExprs":"(map of size 0)","DispatchServer.Address":":50053","DispatchServer.BufferSize":0,"DispatchServer.ClientCAPath":"(empty)","DispatchServer.Enabled":false,"DispatchServer.MaxConnAge":30000,"DispatchServer.MaxWorkers":0,"DispatchServer.Network":"tcp","DispatchServer.TLSCertPath":"(empty)","DispatchServer.TLSKeyPath":"(empty)","DispatchUpstreamAddr":"(empty)","DispatchUpstreamCAPath":"(empty)","DispatchUpstreamTimeout":60000,"Dispatcher":"nil","EnableExperimentalWatchableSchemaCache":false,"EnableRequestLogs":false,"EnableResponseLogs":false,"GRPCAuthFunc":"(value)","GRPCServer.Address":":50051","GRPCServer.BufferSize":0,"GRPCServer.ClientCAPath":"(empty)","GRPCServer.Enabled":true,"GRPCServer.MaxConnAge":30000,"GRPCServer.MaxWorkers":0,"GRPCServer.Network":"tcp","GRPCServer.TLSCertPath":"(empty)","GRPCServer.TLSKeyPath":"(empty)","GlobalDispatchConcurrencyLimit":50,"HTTPGateway.HTTPAddress":":8443","HTTPGateway.HTTPEnabled":true,"HTTPGateway.HTTPTLSCertPath":"(empty)","HTTPGateway.HTTPTLSKeyPath":"(empty)","HTTPGatewayCorsAllowedOrigins":"[*]","HTTPGatewayCorsEnabled":false,"HTTPGatewayUpstreamAddr":"(empty)","HTTPGatewayUpstreamTLSCertPath":"(empty)","MaxCaveatContextSize":4096,"MaxDatastoreReadPageSize":1000,"MaxRelationshipContextSize":25000,"MaximumPreconditionCount":1000,"MaximumUpdatesPerWrite":1000,"MetricsAPI.HTTPAddress":":9090","MetricsAPI.HTTPEnabled":true,"MetricsAPI.HTTPTLSCertPath":"(empty)","MetricsAPI.HTTPTLSKeyPath":"(empty)","NamespaceCacheConfig.Enabled":true,"NamespaceCacheConfig.MaxCost":"32MiB","NamespaceCacheConfig.Metrics":true,"NamespaceCacheConfig.Name":"namespace","NamespaceCacheConfig.NumCounters":1000,"PresharedSecureKey":"(sensitive)","SchemaPrefixesRequired":false,"ShutdownGracePeriod":0,"SilentlyDisableTelemetry":false,"StreamingAPITimeout":30000,"TelemetryCAOverridePath":"(empty)","TelemetryEndpoint":"https://telemetry.authzed.com","TelemetryInterval":3600000,"V1SchemaAdditiveOnly":false,"time":"2024-01-18T12:55:51Z","message":"configuration"}
spicedb_1          | {"level":"info","time":"2024-01-18T12:55:51Z","message":"using postgres datastore engine"}
spicedb_1          | {"level":"warn","details-url":"https://spicedb.dev/d/force-custom-plan","plan_cache_mode":"force_custom_plan","time":"2024-01-18T12:55:51Z","message":"defaulting value in Postgres DB URI"}
spicedb-migrate_1  | {"level":"info","format":"auto","log_level":"info","provider":"zerolog","async":false,"time":"2024-01-18T12:55:47Z","message":"configured logging"}
spicedb-migrate_1  | {"level":"info","v":0,"provider":"none","endpoint":"","service":"spicedb","insecure":false,"sampleRatio":0.01,"time":"2024-01-18T12:55:47Z","message":"configured opentelemetry tracing"}
spicedb-migrate_1  | {"level":"warn","this-version":"v1.28.0","error":"GET https://api.github.com/repos/authzed/spicedb/releases/latest: 403 API rate limit exceeded for 213.172.123.242. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.) [rate reset in 5m37s]","time":"2024-01-18T12:55:47Z","message":"could not perform version checking; if this problem persists or to skip this check, add --skip-release-check=true"}
spicedb-migrate_1  | {"level":"info","time":"2024-01-18T12:55:47Z","message":"migrating postgres datastore"}
spicedb-migrate_1  | {"level":"info","targetRevision":"head","time":"2024-01-18T12:55:47Z","message":"running migrations"}
spicedb_1          | {"level":"warn","time":"2024-01-18T12:55:51Z","message":"watch API disabled, postgres must be run with track_commit_timestamp=on"}
spicedb-migrate_1  | {"level":"error","module":"pgx","pgx":{"args":[],"err":"ERROR: relation \"alembic_version\" does not exist (SQLSTATE 42P01)","pid":3296,"sql":"SELECT version_num from alembic_version","time":0.398161},"time":"2024-01-18T12:55:47Z","message":"Query"}
spicedb_1          | {"level":"info","interval":180000,"time":"2024-01-18T12:55:51Z","message":"datastore garbage collection worker started"}
spicedb-migrate_1  | {"level":"error","module":"pgx","pgx":{"args":[],"err":"ERROR: relation \"alembic_version\" does not exist (SQLSTATE 42P01)","pid":3296,"sql":"SELECT version_num from alembic_version","time":0.211748},"time":"2024-01-18T12:55:47Z","message":"Query"}
spicedb-migrate_1  | {"level":"info","from":"","to":"1eaeba4b8a73","time":"2024-01-18T12:55:47Z","message":"migrating"}
spicedb_1          | {"level":"info","maxCost":"32 MiB","numCounters":1000,"defaultTTL":0,"time":"2024-01-18T12:55:51Z","message":"configured namespace cache"}
spicedb_1          | {"level":"info","datastore-type":"*proxy.singleflightProxy","time":"2024-01-18T12:55:51Z","message":"datastore driver explicitly asked to skip schema watch"}
spicedb-migrate_1  | {"level":"info","from":"1eaeba4b8a73","to":"add-reverse-index","time":"2024-01-18T12:55:48Z","message":"migrating"}
spicedb-migrate_1  | {"level":"info","from":"add-reverse-index","to":"add-unique-living-ns","time":"2024-01-18T12:55:48Z","message":"migrating"}
spicedb-migrate_1  | {"level":"info","from":"add-unique-living-ns","to":"add-transaction-timestamp-index","time":"2024-01-18T12:55:48Z","message":"migrating"}
spicedb-migrate_1  | {"level":"info","from":"add-transaction-timestamp-index","to":"change-transaction-timestamp-default","time":"2024-01-18T12:55:49Z","message":"migrating"}
spicedb-migrate_1  | {"level":"info","from":"change-transaction-timestamp-default","to":"add-gc-index","time":"2024-01-18T12:55:49Z","message":"migrating"}
spicedb_1          | {"level":"info","maxCost":"108 MiB","numCounters":10000,"defaultTTL":20600,"time":"2024-01-18T12:55:51Z","message":"configured dispatch cache"}
spicedb-migrate_1  | {"level":"info","from":"add-gc-index","to":"add-unique-datastore-id","time":"2024-01-18T12:55:49Z","message":"migrating"}
spicedb-migrate_1  | {"level":"info","from":"add-unique-datastore-id","to":"add-ns-config-id","time":"2024-01-18T12:55:50Z","message":"migrating"}
spicedb_1          | {"level":"info","concurrency-limit-check-permission":50,"concurrency-limit-lookup-resources":50,"concurrency-limit-lookup-subjects":50,"concurrency-limit-reachable-resources":50,"balancerconfig":{"loadBalancingConfig":[{"consistent-hashring":{"replicationFactor":100,"spread":1}}]},"time":"2024-01-18T12:55:51Z","message":"configured dispatcher"}
spicedb-migrate_1  | {"level":"info","from":"add-ns-config-id","to":"add-caveats","time":"2024-01-18T12:55:50Z","message":"migrating"}
spicedb_1          | {"level":"warn","reason":"","time":"2024-01-18T12:55:51Z","message":"watch api disabled; underlying datastore does not support it"}
spicedb_1          | {"level":"info","addr":":50051","network":"tcp","service":"grpc","workers":0,"insecure":true,"time":"2024-01-18T12:55:51Z","message":"grpc server started serving"}
spicedb-migrate_1  | {"level":"info","from":"add-caveats","to":"add-xid-columns","time":"2024-01-18T12:55:50Z","message":"migrating"}
spicedb_1          | {"level":"info","upstream":":50051","time":"2024-01-18T12:55:51Z","message":"starting REST gateway"}
spicedb-migrate_1  | {"level":"info","from":"add-xid-columns","to":"backfill-xid-add-indices","time":"2024-01-18T12:55:50Z","message":"migrating"}
spicedb-migrate_1  | {"level":"info","statement":"UPDATE relation_tuple_transaction \n\t\tSET xid = id::text::xid8, snapshot = CONCAT(id, ':', id, ':')::pg_snapshot\n\t\tWHERE id IN (\n\t\t\tSELECT id FROM relation_tuple_transaction\n\t\t\tWHERE snapshot IS NULL\n\t\t\tLIMIT 1000\n\t\t\tFOR UPDATE\n\t\t);","time":"2024-01-18T12:55:50Z","message":"starting backfill"}
spicedb-migrate_1  | {"level":"info","statement":"UPDATE relation_tuple \n\t\tSET deleted_xid = deleted_transaction::text::xid8,\n\t\tcreated_xid = created_transaction::text::xid8\n\t\tWHERE (namespace, object_id, relation, userset_namespace, userset_object_id,\n\t\t\t   userset_relation, created_transaction, deleted_transaction\n\t\t) IN (\n\t\t\tSELECT namespace, object_id, relation, userset_namespace, userset_object_id,\n\t\t\t\tuserset_relation, created_transaction, deleted_transaction\n\t\t\tFROM relation_tuple\n\t\t\tWHERE created_xid IS NULL\n\t\t\tLIMIT 1000\n\t\t\tFOR UPDATE\n\t\t);","time":"2024-01-18T12:55:50Z","message":"starting backfill"}
spicedb_1          | {"level":"info","datastore":"*proxy.observableProxy","time":"2024-01-18T12:55:51Z","message":"running server"}
spicedb_1          | {"level":"info","time":"2024-01-18T12:55:51Z","message":"checking for startable datastore"}
spicedb-migrate_1  | {"level":"info","statement":"UPDATE namespace_config \n\t\tSET deleted_xid = deleted_transaction::text::xid8,\n\t\tcreated_xid = created_transaction::text::xid8\n\t\tWHERE (namespace, created_transaction, deleted_transaction) IN (\n\t\t\tSELECT namespace, created_transaction, deleted_transaction\n\t\t\tFROM namespace_config\n\t\t\tWHERE created_xid IS NULL\n\t\t\tLIMIT 1000\n\t\t\tFOR UPDATE\n\t\t);","time":"2024-01-18T12:55:50Z","message":"starting backfill"}
spicedb-migrate_1  | {"level":"info","statement":"UPDATE caveat \n\t\tSET deleted_xid = deleted_transaction::text::xid8,\n\t\tcreated_xid = created_transaction::text::xid8\n\t\tWHERE (name, created_transaction, deleted_transaction) IN (\n\t\t\tSELECT name, created_transaction, deleted_transaction\n\t\t\tFROM caveat\n\t\t\tWHERE created_xid IS NULL\n\t\t\tLIMIT 1000\n\t\t\tFOR UPDATE\n\t\t);","time":"2024-01-18T12:55:50Z","message":"starting backfill"}
spicedb-migrate_1  | {"level":"info","from":"backfill-xid-add-indices","to":"add-xid-constraints","time":"2024-01-18T12:55:51Z","message":"migrating"}
spicedb-migrate_1  | {"level":"info","from":"add-xid-constraints","to":"drop-id-constraints","time":"2024-01-18T12:55:51Z","message":"migrating"}
spicedb-migrate_1  | {"level":"info","from":"drop-id-constraints","to":"drop-bigserial-ids","time":"2024-01-18T12:55:51Z","message":"migrating"}
spicedb_1          | {"level":"info","addr":":8443","service":"http","insecure":true,"time":"2024-01-18T12:55:51Z","message":"http server started serving"}
spicedb-migrate_1  | {"level":"info","from":"drop-bigserial-ids","to":"add-gc-covering-index","time":"2024-01-18T12:55:51Z","message":"migrating"}
spicedb-migrate_1  | {"level":"info","from":"add-gc-covering-index","to":"add-tuned-gc-index","time":"2024-01-18T12:55:51Z","message":"migrating"}
spicedb_1          | {"level":"info","addr":":9090","service":"metrics","insecure":true,"time":"2024-01-18T12:55:51Z","message":"http server started serving"}
spicedb-migrate_1  | {"level":"info","from":"add-tuned-gc-index","to":"add-rel-by-alive-resource-relation-subject","time":"2024-01-18T12:55:51Z","message":"migrating"}
spicedb_1          | {"level":"info","interval":"1h0m0s","endpoint":"https://telemetry.authzed.com","next":"33s","time":"2024-01-18T12:55:51Z","message":"telemetry reporter scheduled"}
spicedb_spicedb-migrate_1 exited with code 0
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"WriteSchema","grpc.method_type":"unary","requestID":"2541204d42fc7e9b34f43b46abbfb70e","peer.address":"172.18.0.1:44232","grpc.start_time":"2024-01-18T12:56:42Z","grpc.code":"OK","grpc.time_ms":48,"time":"2024-01-18T12:56:42Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"ReadSchema","grpc.method_type":"unary","requestID":"6546610eb8d6ac628d36c4dfc09950d2","peer.address":"172.18.0.1:44232","grpc.start_time":"2024-01-18T12:56:42Z","grpc.code":"OK","grpc.time_ms":5,"time":"2024-01-18T12:56:42Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"WriteRelationships","grpc.method_type":"unary","requestID":"83d1b6a45ec3fc1d533fca7f9282170f","peer.address":"172.18.0.1:44232","grpc.start_time":"2024-01-18T12:56:42Z","grpc.code":"OK","grpc.time_ms":11,"time":"2024-01-18T12:56:42Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"ReadRelationships","grpc.method_type":"server_stream","requestID":"262747cb8802068d9338a8938f2cc3fa","peer.address":"172.18.0.1:44232","grpc.start_time":"2024-01-18T12:56:42Z","grpc.code":"OK","grpc.time_ms":3,"time":"2024-01-18T12:56:42Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"ReadRelationships","grpc.method_type":"server_stream","requestID":"69a8df697e46bfbed2741c9ee39c1c9d","peer.address":"172.18.0.1:44232","grpc.start_time":"2024-01-18T12:56:42Z","grpc.code":"OK","grpc.time_ms":1,"time":"2024-01-18T12:56:42Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"LookupSubjects","grpc.method_type":"server_stream","requestID":"42f7c0dd4a2df72c3252f7d0ad87f162","peer.address":"172.18.0.1:44232","grpc.start_time":"2024-01-18T12:56:42Z","grpc.code":"OK","grpc.time_ms":5,"time":"2024-01-18T12:56:42Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"WriteSchema","grpc.method_type":"unary","requestID":"9a3e3d83a3257105d1b6ed115319a6ab","peer.address":"172.18.0.1:44238","grpc.start_time":"2024-01-18T12:56:46Z","grpc.code":"OK","grpc.time_ms":22,"time":"2024-01-18T12:56:46Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"ReadSchema","grpc.method_type":"unary","requestID":"bd708b414828465361c5d1e8d9e1ea8e","peer.address":"172.18.0.1:44238","grpc.start_time":"2024-01-18T12:56:46Z","grpc.code":"OK","grpc.time_ms":1,"time":"2024-01-18T12:56:46Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"WriteRelationships","grpc.method_type":"unary","requestID":"fb7cd7c2605f9534727779785102d0fd","peer.address":"172.18.0.1:44238","grpc.start_time":"2024-01-18T12:56:46Z","grpc.code":"OK","grpc.time_ms":15,"time":"2024-01-18T12:56:46Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"ReadRelationships","grpc.method_type":"server_stream","requestID":"7cf8d3a4bb76f8d31f34202f68252532","peer.address":"172.18.0.1:44238","grpc.start_time":"2024-01-18T12:56:46Z","grpc.code":"OK","grpc.time_ms":1,"time":"2024-01-18T12:56:46Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"ReadRelationships","grpc.method_type":"server_stream","requestID":"2a72c0bdcd44210a34bb19b863f72936","peer.address":"172.18.0.1:44238","grpc.start_time":"2024-01-18T12:56:46Z","grpc.code":"OK","grpc.time_ms":1,"time":"2024-01-18T12:56:46Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"LookupSubjects","grpc.method_type":"server_stream","requestID":"70aef34b6b28790b75b3b397f10b9153","peer.address":"172.18.0.1:44238","grpc.start_time":"2024-01-18T12:56:46Z","grpc.code":"OK","grpc.time_ms":2,"time":"2024-01-18T12:56:46Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"WriteSchema","grpc.method_type":"unary","requestID":"0cc6e0a5ba2e448c4e2863d8493ec9fb","peer.address":"172.18.0.1:36390","grpc.start_time":"2024-01-18T12:56:58Z","grpc.code":"InvalidArgument","grpc.error":"parse error in `schema`, line 10, column 16: Expected identifier, found token TokenTypeStar","grpc.time_ms":0,"time":"2024-01-18T12:56:58Z","message":"finished call"}
spicedb_1          | {"level":"warn","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"CheckPermission","grpc.method_type":"unary","requestID":"f19637923d5f5994dbc4fcbef2a61d44","peer.address":"172.18.0.1:36390","grpc.start_time":"2024-01-18T12:56:58Z","grpc.code":"FailedPrecondition","grpc.error":"object definition `group` not found","grpc.time_ms":8,"time":"2024-01-18T12:56:58Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"WriteSchema","grpc.method_type":"unary","requestID":"e5b754772086effffe3ce34aa2d00b44","peer.address":"172.18.0.1:42056","grpc.start_time":"2024-01-18T12:57:03Z","grpc.code":"InvalidArgument","grpc.error":"parse error in `schema`, line 10, column 16: Expected identifier, found token TokenTypeStar","grpc.time_ms":0,"time":"2024-01-18T12:57:03Z","message":"finished call"}
spicedb_1          | {"level":"warn","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"CheckPermission","grpc.method_type":"unary","requestID":"d2661009834598a27ff17896d4a5c23d","peer.address":"172.18.0.1:42056","grpc.start_time":"2024-01-18T12:57:03Z","grpc.code":"FailedPrecondition","grpc.error":"object definition `group` not found","grpc.time_ms":0,"time":"2024-01-18T12:57:03Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"WriteSchema","grpc.method_type":"unary","requestID":"c129f065629c3e866d16633c027f412a","peer.address":"172.18.0.1:54864","grpc.start_time":"2024-01-18T12:57:43Z","grpc.code":"InvalidArgument","grpc.error":"parse error in `schema`, line 10, column 16: Expected identifier, found token TokenTypeStar","grpc.time_ms":1,"time":"2024-01-18T12:57:43Z","message":"finished call"}
spicedb_1          | {"level":"warn","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"LookupResources","grpc.method_type":"server_stream","requestID":"cd75cdbde35994db6d4cae4968771780","peer.address":"172.18.0.1:54864","grpc.start_time":"2024-01-18T12:57:43Z","grpc.code":"FailedPrecondition","grpc.error":"object definition `group` not found","grpc.time_ms":2,"time":"2024-01-18T12:57:43Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"WriteSchema","grpc.method_type":"unary","requestID":"2d360631ceaf6b63994bb578d8613f75","peer.address":"172.18.0.1:41370","grpc.start_time":"2024-01-18T12:58:47Z","grpc.code":"InvalidArgument","grpc.error":"parse error in `schema`, line 10, column 16: Expected identifier, found token TokenTypeStar","grpc.time_ms":0,"time":"2024-01-18T12:58:47Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"LookupSubjects","grpc.method_type":"server_stream","requestID":"db560a6f76c47b75e94ae72ae07770bb","peer.address":"172.18.0.1:41370","grpc.start_time":"2024-01-18T12:58:47Z","grpc.code":"OK","grpc.time_ms":1,"time":"2024-01-18T12:58:47Z","message":"finished call"}
spicedb_1          | {"level":"info","interval":180000,"window":86400000,"timeout":60000,"time":"2024-01-18T12:58:51Z","message":"running garbage collection worker"}
spicedb_1          | {"level":"warn","error":"unable to load alembic revision: no rows in result set","next-attempt-in":510.576826,"time":"2024-01-18T12:58:51Z","message":"error attempting to perform garbage collection"}
spicedb_1          | {"level":"info","interval":510.576826,"window":86400000,"timeout":60000,"time":"2024-01-18T12:58:52Z","message":"running garbage collection worker"}
spicedb_1          | {"level":"warn","error":"unable to load alembic revision: no rows in result set","next-attempt-in":789.06632,"time":"2024-01-18T12:58:52Z","message":"error attempting to perform garbage collection"}
spicedb_1          | {"level":"info","interval":789.06632,"window":86400000,"timeout":60000,"time":"2024-01-18T12:58:53Z","message":"running garbage collection worker"}
spicedb_1          | {"level":"warn","error":"unable to load alembic revision: no rows in result set","next-attempt-in":899.331144,"time":"2024-01-18T12:58:53Z","message":"error attempting to perform garbage collection"}
spicedb_1          | {"level":"info","interval":899.331144,"window":86400000,"timeout":60000,"time":"2024-01-18T12:58:54Z","message":"running garbage collection worker"}
spicedb_1          | {"level":"warn","error":"unable to load alembic revision: no rows in result set","next-attempt-in":1154.44131,"time":"2024-01-18T12:58:54Z","message":"error attempting to perform garbage collection"}
spicedb_1          | {"level":"info","interval":1154.44131,"window":86400000,"timeout":60000,"time":"2024-01-18T12:58:55Z","message":"running garbage collection worker"}
spicedb_1          | {"level":"warn","error":"unable to load alembic revision: no rows in result set","next-attempt-in":2684.26383,"time":"2024-01-18T12:58:55Z","message":"error attempting to perform garbage collection"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"WriteSchema","grpc.method_type":"unary","requestID":"0d7b7f4d1438abf75438f160010de173","peer.address":"172.18.0.1:59724","grpc.start_time":"2024-01-18T12:58:57Z","grpc.code":"InvalidArgument","grpc.error":"parse error in `schema`, line 10, column 16: Expected identifier, found token TokenTypeStar","grpc.time_ms":0,"time":"2024-01-18T12:58:57Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"LookupSubjects","grpc.method_type":"server_stream","requestID":"60d2ad65e2160b724bf6668ca020bb73","peer.address":"172.18.0.1:59724","grpc.start_time":"2024-01-18T12:58:57Z","grpc.code":"OK","grpc.time_ms":0,"time":"2024-01-18T12:58:57Z","message":"finished call"}
spicedb_1          | {"level":"info","interval":2684.26383,"window":86400000,"timeout":60000,"time":"2024-01-18T12:58:57Z","message":"running garbage collection worker"}
spicedb_1          | {"level":"warn","error":"unable to load alembic revision: no rows in result set","next-attempt-in":5366.35276,"time":"2024-01-18T12:58:57Z","message":"error attempting to perform garbage collection"}
spicedb_1          | {"level":"info","interval":5366.35276,"window":86400000,"timeout":60000,"time":"2024-01-18T12:59:03Z","message":"running garbage collection worker"}
spicedb_1          | {"level":"warn","error":"unable to load alembic revision: no rows in result set","next-attempt-in":4283.544027,"time":"2024-01-18T12:59:03Z","message":"error attempting to perform garbage collection"}
spicedb_1          | {"level":"info","interval":4283.544027,"window":86400000,"timeout":60000,"time":"2024-01-18T12:59:07Z","message":"running garbage collection worker"}
spicedb_1          | {"level":"warn","error":"unable to load alembic revision: no rows in result set","next-attempt-in":11827.70312,"time":"2024-01-18T12:59:07Z","message":"error attempting to perform garbage collection"}
spicedb_1          | {"level":"info","interval":11827.70312,"window":86400000,"timeout":60000,"time":"2024-01-18T12:59:19Z","message":"running garbage collection worker"}
spicedb_1          | {"level":"warn","error":"unable to load alembic revision: no rows in result set","next-attempt-in":15679.586465,"time":"2024-01-18T12:59:19Z","message":"error attempting to perform garbage collection"}
spicedb_1          | {"level":"info","interval":15679.586465,"window":86400000,"timeout":60000,"time":"2024-01-18T12:59:35Z","message":"running garbage collection worker"}
spicedb_1          | {"level":"warn","error":"unable to load alembic revision: no rows in result set","next-attempt-in":21745.175187,"time":"2024-01-18T12:59:35Z","message":"error attempting to perform garbage collection"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"WriteSchema","grpc.method_type":"unary","requestID":"9ad8870319d79ecc5869a8c238b3e0ec","peer.address":"172.18.0.1:51402","grpc.start_time":"2024-01-18T12:59:37Z","grpc.code":"InvalidArgument","grpc.error":"parse error in `schema`, line 10, column 16: Expected identifier, found token TokenTypeStar","grpc.time_ms":3,"time":"2024-01-18T12:59:37Z","message":"finished call"}
spicedb_1          | {"level":"info","interval":21745.175187,"window":86400000,"timeout":60000,"time":"2024-01-18T12:59:56Z","message":"running garbage collection worker"}
spicedb_1          | {"level":"warn","error":"unable to load alembic revision: no rows in result set","next-attempt-in":39439.140022,"time":"2024-01-18T12:59:56Z","message":"error attempting to perform garbage collection"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"WriteSchema","grpc.method_type":"unary","requestID":"f97b23300f32541f7cd2ecfe5d48a317","peer.address":"172.18.0.1:40510","grpc.start_time":"2024-01-18T13:00:12Z","grpc.code":"InvalidArgument","grpc.error":"parse error in `schema`, line 10, column 16: Expected identifier, found token TokenTypeStar","grpc.time_ms":0,"time":"2024-01-18T13:00:12Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"LookupSubjects","grpc.method_type":"server_stream","requestID":"95638b90aadfc54fed8b49a9a0662848","peer.address":"172.18.0.1:40510","grpc.start_time":"2024-01-18T13:00:12Z","grpc.code":"OK","grpc.time_ms":3,"time":"2024-01-18T13:00:12Z","message":"finished call"}
spicedb_1          | {"level":"info","interval":39439.140022,"window":86400000,"timeout":60000,"time":"2024-01-18T13:00:36Z","message":"running garbage collection worker"}
spicedb_1          | {"level":"warn","error":"unable to load alembic revision: no rows in result set","next-attempt-in":27592.765927,"time":"2024-01-18T13:00:36Z","message":"error attempting to perform garbage collection"}
spicedb_1          | {"level":"info","interval":27592.765927,"window":86400000,"timeout":60000,"time":"2024-01-18T13:01:03Z","message":"running garbage collection worker"}
spicedb_1          | {"level":"warn","error":"unable to load alembic revision: no rows in result set","next-attempt-in":43277.164447,"time":"2024-01-18T13:01:04Z","message":"error attempting to perform garbage collection"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"WriteSchema","grpc.method_type":"unary","requestID":"2e0bb9721d69a04415cf89ee672afca8","peer.address":"172.18.0.1:53776","grpc.start_time":"2024-01-18T13:01:26Z","grpc.code":"InvalidArgument","grpc.error":"parse error in `schema`, line 10, column 16: Expected identifier, found token TokenTypeStar","grpc.time_ms":0,"time":"2024-01-18T13:01:26Z","message":"finished call"}
spicedb_1          | {"level":"warn","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"LookupSubjects","grpc.method_type":"server_stream","requestID":"95513cb4a55f768f12211572ca623cb9","peer.address":"172.18.0.1:53776","grpc.start_time":"2024-01-18T13:01:26Z","grpc.code":"FailedPrecondition","grpc.error":"object definition `workspace` not found","grpc.time_ms":1,"time":"2024-01-18T13:01:26Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"WriteSchema","grpc.method_type":"unary","requestID":"67ec62eb1a8c759c3af31495ae8a6db9","peer.address":"172.18.0.1:53778","grpc.start_time":"2024-01-18T13:01:31Z","grpc.code":"InvalidArgument","grpc.error":"parse error in `schema`, line 10, column 16: Expected identifier, found token TokenTypeStar","grpc.time_ms":0,"time":"2024-01-18T13:01:31Z","message":"finished call"}
spicedb_1          | {"level":"warn","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"LookupSubjects","grpc.method_type":"server_stream","requestID":"64fe37b8d32a0b268860868c498590c9","peer.address":"172.18.0.1:53778","grpc.start_time":"2024-01-18T13:01:31Z","grpc.code":"FailedPrecondition","grpc.error":"object definition `workspace` not found","grpc.time_ms":1,"time":"2024-01-18T13:01:31Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"WriteSchema","grpc.method_type":"unary","requestID":"5bc26a9e6680ce4e6910946dd746072f","peer.address":"172.18.0.1:47550","grpc.start_time":"2024-01-18T13:01:33Z","grpc.code":"InvalidArgument","grpc.error":"parse error in `schema`, line 10, column 16: Expected identifier, found token TokenTypeStar","grpc.time_ms":0,"time":"2024-01-18T13:01:33Z","message":"finished call"}
spicedb_1          | {"level":"warn","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"LookupSubjects","grpc.method_type":"server_stream","requestID":"163d452746beb2daa4e51e748a72042c","peer.address":"172.18.0.1:47550","grpc.start_time":"2024-01-18T13:01:33Z","grpc.code":"FailedPrecondition","grpc.error":"object definition `workspace` not found","grpc.time_ms":1,"time":"2024-01-18T13:01:33Z","message":"finished call"}
spicedb_1          | {"level":"info","interval":43277.164447,"window":86400000,"timeout":60000,"time":"2024-01-18T13:01:47Z","message":"running garbage collection worker"}
spicedb_1          | {"level":"warn","error":"unable to load alembic revision: no rows in result set","next-attempt-in":58375.76967,"time":"2024-01-18T13:01:47Z","message":"error attempting to perform garbage collection"}
spicedb_1          | {"level":"info","interval":58375.76967,"window":86400000,"timeout":60000,"time":"2024-01-18T13:02:45Z","message":"running garbage collection worker"}
spicedb_1          | {"level":"warn","error":"unable to load alembic revision: no rows in result set","next-attempt-in":165451.267152,"time":"2024-01-18T13:02:45Z","message":"error attempting to perform garbage collection"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"WriteSchema","grpc.method_type":"unary","requestID":"2ff0bc57cc7c7ea125bc23d91ada3479","peer.address":"172.18.0.1:43326","grpc.start_time":"2024-01-18T13:05:21Z","grpc.code":"OK","grpc.time_ms":42,"time":"2024-01-18T13:05:21Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"ReadSchema","grpc.method_type":"unary","requestID":"6d8bc4feeb05bd3be01e81ce8333fec6","peer.address":"172.18.0.1:43326","grpc.start_time":"2024-01-18T13:05:21Z","grpc.code":"OK","grpc.time_ms":1,"time":"2024-01-18T13:05:21Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"WriteRelationships","grpc.method_type":"unary","requestID":"f18dd4a9339fd8f456dc90a42c22b7b1","peer.address":"172.18.0.1:43326","grpc.start_time":"2024-01-18T13:05:21Z","grpc.code":"OK","grpc.time_ms":8,"time":"2024-01-18T13:05:21Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"ReadRelationships","grpc.method_type":"server_stream","requestID":"4d7124ba1771f7e578a3c2907eca5167","peer.address":"172.18.0.1:43326","grpc.start_time":"2024-01-18T13:05:21Z","grpc.code":"OK","grpc.time_ms":3,"time":"2024-01-18T13:05:21Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"ReadRelationships","grpc.method_type":"server_stream","requestID":"f3779aedde17dd3356230a80ee61a78a","peer.address":"172.18.0.1:43326","grpc.start_time":"2024-01-18T13:05:21Z","grpc.code":"OK","grpc.time_ms":1,"time":"2024-01-18T13:05:21Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"LookupSubjects","grpc.method_type":"server_stream","requestID":"840b2df06f1853ab6d2a72bef1401dcc","peer.address":"172.18.0.1:43326","grpc.start_time":"2024-01-18T13:05:21Z","grpc.code":"OK","grpc.time_ms":2,"time":"2024-01-18T13:05:21Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"WriteSchema","grpc.method_type":"unary","requestID":"2f442d3d71cb4b1a988da345dfc15f5b","peer.address":"172.18.0.1:56440","grpc.start_time":"2024-01-18T13:05:24Z","grpc.code":"OK","grpc.time_ms":27,"time":"2024-01-18T13:05:24Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"ReadSchema","grpc.method_type":"unary","requestID":"7a543df854e8f3ad9896a35c22ef0eed","peer.address":"172.18.0.1:56440","grpc.start_time":"2024-01-18T13:05:24Z","grpc.code":"OK","grpc.time_ms":2,"time":"2024-01-18T13:05:24Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"WriteRelationships","grpc.method_type":"unary","requestID":"d9005c8c274753e6810732d2a7ae160b","peer.address":"172.18.0.1:56440","grpc.start_time":"2024-01-18T13:05:24Z","grpc.code":"OK","grpc.time_ms":12,"time":"2024-01-18T13:05:24Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"ReadRelationships","grpc.method_type":"server_stream","requestID":"7202f6fdf7167d4aa290e2449b5a345a","peer.address":"172.18.0.1:56440","grpc.start_time":"2024-01-18T13:05:24Z","grpc.code":"OK","grpc.time_ms":1,"time":"2024-01-18T13:05:24Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"ReadRelationships","grpc.method_type":"server_stream","requestID":"c22ab0aba49ca8853250913b80e89441","peer.address":"172.18.0.1:56440","grpc.start_time":"2024-01-18T13:05:24Z","grpc.code":"OK","grpc.time_ms":3,"time":"2024-01-18T13:05:24Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"LookupSubjects","grpc.method_type":"server_stream","requestID":"886ecd2f93bae89ad4bce7d6e2e065b7","peer.address":"172.18.0.1:56440","grpc.start_time":"2024-01-18T13:05:24Z","grpc.code":"OK","grpc.time_ms":3,"time":"2024-01-18T13:05:24Z","message":"finished call"}
spicedb_1          | {"level":"info","interval":165451.267152,"window":86400000,"timeout":60000,"time":"2024-01-18T13:05:31Z","message":"running garbage collection worker"}
spicedb_1          | {"level":"warn","error":"unable to load alembic revision: no rows in result set","next-attempt-in":183113.832796,"time":"2024-01-18T13:05:31Z","message":"error attempting to perform garbage collection"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"WriteSchema","grpc.method_type":"unary","requestID":"194da165cea8ddb19d18f11626690c3f","peer.address":"172.18.0.1:34032","grpc.start_time":"2024-01-18T13:06:23Z","grpc.code":"OK","grpc.time_ms":32,"time":"2024-01-18T13:06:23Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"ReadSchema","grpc.method_type":"unary","requestID":"009518f99fa5bc491dea941b6cc0e9fc","peer.address":"172.18.0.1:34032","grpc.start_time":"2024-01-18T13:06:23Z","grpc.code":"OK","grpc.time_ms":2,"time":"2024-01-18T13:06:23Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"WriteRelationships","grpc.method_type":"unary","requestID":"9aee271e78df30fd35b6f8afad74a307","peer.address":"172.18.0.1:34032","grpc.start_time":"2024-01-18T13:06:23Z","grpc.code":"OK","grpc.time_ms":8,"time":"2024-01-18T13:06:23Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"ReadRelationships","grpc.method_type":"server_stream","requestID":"fb69ced2445d8a4f9fe9db82c29157ac","peer.address":"172.18.0.1:34032","grpc.start_time":"2024-01-18T13:06:23Z","grpc.code":"OK","grpc.time_ms":1,"time":"2024-01-18T13:06:23Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"ReadRelationships","grpc.method_type":"server_stream","requestID":"df5e86862e06975d6f9c9612c800aeb8","peer.address":"172.18.0.1:34032","grpc.start_time":"2024-01-18T13:06:23Z","grpc.code":"OK","grpc.time_ms":1,"time":"2024-01-18T13:06:23Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"LookupSubjects","grpc.method_type":"server_stream","requestID":"fca6985265ec8f2c167fdd330f359488","peer.address":"172.18.0.1:34032","grpc.start_time":"2024-01-18T13:06:23Z","grpc.code":"OK","grpc.time_ms":4,"time":"2024-01-18T13:06:23Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"WriteSchema","grpc.method_type":"unary","requestID":"e7c839f35d25d930d19e4a2eb8c9f3b4","peer.address":"172.18.0.1:55160","grpc.start_time":"2024-01-18T13:06:36Z","grpc.code":"InvalidArgument","grpc.error":"parse error in `schema`, line 11, column 16: Expected identifier, found token TokenTypeStar","grpc.time_ms":0,"time":"2024-01-18T13:06:36Z","message":"finished call"}
spicedb_1          | {"level":"info","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.SchemaService","grpc.method":"ReadSchema","grpc.method_type":"unary","requestID":"220df8f80d6745673591963a7eee6108","peer.address":"172.18.0.1:55160","grpc.start_time":"2024-01-18T13:06:36Z","grpc.code":"NotFound","grpc.error":"rpc error: code = NotFound desc = No schema has been defined; please call WriteSchema to start","grpc.time_ms":12,"time":"2024-01-18T13:06:36Z","message":"finished call"}
spicedb_1          | {"level":"warn","error":"object definition `org` not found","time":"2024-01-18T13:06:36Z","message":"unable to determine if pgx error is retryable"}
spicedb_1          | {"level":"warn","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"WriteRelationships","grpc.method_type":"unary","requestID":"6f71e6c2f8aea1972f15989a90d854cc","peer.address":"172.18.0.1:55160","grpc.start_time":"2024-01-18T13:06:36Z","grpc.code":"FailedPrecondition","grpc.error":"object definition `org` not found","grpc.time_ms":3,"time":"2024-01-18T13:06:36Z","message":"finished call"}
spicedb_1          | {"level":"warn","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"ReadRelationships","grpc.method_type":"server_stream","requestID":"a7a53954023f852acd9906accba11d11","peer.address":"172.18.0.1:55160","grpc.start_time":"2024-01-18T13:06:36Z","grpc.code":"FailedPrecondition","grpc.error":"object definition `org` not found","grpc.time_ms":2,"time":"2024-01-18T13:06:36Z","message":"finished call"}
spicedb_1          | {"level":"warn","protocol":"grpc","grpc.component":"server","grpc.service":"authzed.api.v1.PermissionsService","grpc.method":"ReadRelationships","grpc.method_type":"server_stream","requestID":"0203646938c4f4087c6082ffa1de6bf3","peer.address":"172.18.0.1:55160","grpc.start_time":"2024-01-18T13:06:36Z","grpc.code":"FailedPrecondition","grpc.error":"object definition `workspace` not found","grpc.time_ms":2,"time":"2024-01-18T13:06:36Z","message":"finished call"}
spicedb_1          | panic: runtime error: invalid memory address or nil pointer dereference
spicedb_1          | [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x12fb7a8]
spicedb_1          | 
spicedb_1          | goroutine 853 [running]:
spicedb_1          | github.com/authzed/spicedb/internal/namespace.CheckNamespaceAndRelations({0x32dca60, 0xc000a0d3b0}, {0xc000d62508, 0x2, 0x2b3be40?}, {0x32e8d68, 0xc000e5b990})
spicedb_1          |    /home/runner/actions-runner/_work/spicedb/spicedb/internal/namespace/util.go:72 +0x3c8
spicedb_1          | github.com/authzed/spicedb/internal/services/v1.(*permissionServer).LookupSubjects(0xc000a16960, 0xc00010ed80, {0x32e6890, 0xc000e5b960})
spicedb_1          |    /home/runner/actions-runner/_work/spicedb/spicedb/internal/services/v1/permissions.go:474 +0x2ec
spicedb_1          | github.com/authzed/authzed-go/proto/authzed/api/v1._PermissionsService_LookupSubjects_Handler({0x2a54000?, 0xc000a16960}, {0x32e2fe8, 0xc000b92000})
spicedb_1          |    /home/runner/go/pkg/mod/github.com/authzed/[email protected]/proto/authzed/api/v1/permission_service_grpc.pb.go:391 +0xd0
spicedb_1          | github.com/authzed/spicedb/internal/services/v1.NewPermissionsServer.MustStreamServerInterceptor.func2({0x2a54000, 0xc000a16960}, {0x32e1988, 0xc001285f80}, 0x29ba840?, 0x2d6e2e0)
spicedb_1          |    /home/runner/actions-runner/_work/spicedb/spicedb/internal/middleware/streamtimeout/streamtimeout.go:29 +0x148
spicedb_1          | github.com/authzed/spicedb/internal/services/v1.NewPermissionsServer.ChainStreamServer.func3.1.1({0x2a54000?, 0xc000a16960?}, {0x32e1988?, 0xc001285f80?})
spicedb_1          |    /home/runner/actions-runner/_work/spicedb/spicedb/internal/middleware/chain.go:47 +0x37
spicedb_1          | github.com/authzed/spicedb/internal/services/v1.NewPermissionsServer.StreamServerInterceptor.StreamServerInterceptor.func5({0x2a54000, 0xc000a16960}, {0x32e3e48, 0xc000c00cf0}, 0x297fb00?, 0xc0001249c0)
spicedb_1          |    /home/runner/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware/[email protected]/interceptors/server.go:35 +0x2db
spicedb_1          | github.com/authzed/spicedb/internal/services/v1.NewPermissionsServer.ChainStreamServer.func3.1.1({0x2a54000?, 0xc000a16960?}, {0x32e3e48?, 0xc000c00cf0?})
spicedb_1          |    /home/runner/actions-runner/_work/spicedb/spicedb/internal/middleware/chain.go:47 +0x37
spicedb_1          | github.com/authzed/spicedb/internal/middleware/handwrittenvalidation.StreamServerInterceptor({0x2a54000, 0xc000a16960}, {0x32e3e00?, 0xc0009f77b8}, 0x29e0580?, 0xc000124a20)
spicedb_1          |    /home/runner/actions-runner/_work/spicedb/spicedb/internal/middleware/handwrittenvalidation/handwrittenvalidation.go:33 +0x7f
spicedb_1          | github.com/authzed/spicedb/internal/services/v1.NewPermissionsServer.ChainStreamServer.func3.1.1({0x2a54000?, 0xc000a16960?}, {0x32e3e00?, 0xc0009f77b8?})
spicedb_1          |    /home/runner/actions-runner/_work/spicedb/spicedb/internal/middleware/chain.go:47 +0x37
spicedb_1          | github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/validator.StreamServerInterceptor.func1({0x2a54000, 0xc000a16960}, {0x32e1940?, 0xc0001249a0}, 0x32ec988?, 0xc000124aa0)
spicedb_1          |    /home/runner/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware/[email protected]/interceptors/validator/interceptors.go:58 +0xaf
spicedb_1          | github.com/authzed/spicedb/internal/services/v1.NewPermissionsServer.ChainStreamServer.func3.1.1({0x2a54000?, 0xc000a16960?}, {0x32e1940?, 0xc0001249a0?})
spicedb_1          |    /home/runner/actions-runner/_work/spicedb/spicedb/internal/middleware/chain.go:47 +0x37
spicedb_1          | github.com/authzed/spicedb/internal/services/v1.NewPermissionsServer.ChainStreamServer.func3({0x2a54000, 0xc000a16960}, {0x32e1940, 0xc0001249a0}, 0xc0001249a0?, 0x20?)
spicedb_1          |    /home/runner/actions-runner/_work/spicedb/spicedb/internal/middleware/chain.go:56 +0xb5
spicedb_1          | github.com/authzed/spicedb/internal/middleware/servicespecific.StreamServerInterceptor({0x2a54000, 0xc000a16960}, {0x32e1940, 0xc0001249a0}, 0xc0001249a0?, 0x2d6e2e0)
spicedb_1          |    /home/runner/actions-runner/_work/spicedb/spicedb/internal/middleware/servicespecific/servicespecific.go:35 +0x83
spicedb_1          | google.golang.org/grpc.getChainStreamHandler.func1({0x2a54000, 0xc000a16960}, {0x32e1940, 0xc0001249a0})
spicedb_1          |    /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1489 +0xb2
spicedb_1          | github.com/authzed/spicedb/pkg/cmd/server.DefaultStreamingMiddleware.StreamServerInterceptor.func15({0x2a54000, 0xc000a16960}, {0x32e1868?, 0xc000124960?}, 0xc0009f7728, 0xc000c12b40)
spicedb_1          |    /home/runner/actions-runner/_work/spicedb/spicedb/internal/middleware/consistency/consistency.go:204 +0x1a2
spicedb_1          | google.golang.org/grpc.getChainStreamHandler.func1({0x2a54000, 0xc000a16960}, {0x32e1868, 0xc000124960})
spicedb_1          |    /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1489 +0xb2
spicedb_1          | github.com/authzed/spicedb/pkg/cmd/server.DefaultStreamingMiddleware.StreamServerInterceptor.func13({0x2a54000, 0xc000a16960}, {0x32e1868?, 0xc000124960?}, 0xc0009f7728?, 0xc000c12b00)
spicedb_1          |    /home/runner/actions-runner/_work/spicedb/spicedb/internal/middleware/datastore/datastore.go:83 +0xc2
spicedb_1          | google.golang.org/grpc.getChainStreamHandler.func1({0x2a54000, 0xc000a16960}, {0x32e1868, 0xc000124960})
spicedb_1          |    /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1489 +0xb2
spicedb_1          | github.com/authzed/spicedb/pkg/cmd/server.DefaultStreamingMiddleware.StreamServerInterceptor.func11({0x2a54000, 0xc000a16960}, {0x32e1988?, 0xc001285e60?}, 0xc0009f7728?, 0xc000c12ac0)
spicedb_1          |    /home/runner/actions-runner/_work/spicedb/spicedb/internal/middleware/dispatcher/dispatcher.go:79 +0xc2
spicedb_1          | google.golang.org/grpc.getChainStreamHandler.func1({0x2a54000, 0xc000a16960}, {0x32e1988, 0xc001285e60})
spicedb_1          |    /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1489 +0xb2
spicedb_1          | github.com/authzed/spicedb/pkg/cmd/server.DefaultStreamingMiddleware.StreamServerInterceptor.StreamServerInterceptor.func20({0x2a54000, 0xc000a16960}, {0x32e1868, 0xc000124940}, 0xc0009f7728?, 0xc000c12a80)
spicedb_1          |    /home/runner/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware/[email protected]/interceptors/server.go:35 +0x2db
spicedb_1          | google.golang.org/grpc.getChainStreamHandler.func1({0x2a54000, 0xc000a16960}, {0x32e1868, 0xc000124940})
spicedb_1          |    /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1489 +0xb2
spicedb_1          | github.com/authzed/spicedb/pkg/cmd/server.DefaultStreamingMiddleware.StreamServerInterceptor.func8({0x2a54000, 0xc000a16960}, {0x32e2c90?, 0xc0009f77a0?}, 0xc0009f7728, 0xc000c12a40)
spicedb_1          |    /home/runner/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware/[email protected]/interceptors/auth/auth.go:68 +0x143
spicedb_1          | google.golang.org/grpc.getChainStreamHandler.func1({0x2a54000, 0xc000a16960}, {0x32e2c90, 0xc0009f77a0})
spicedb_1          |    /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1489 +0xb2
spicedb_1          | github.com/grpc-ecosystem/go-grpc-prometheus.init.(*ServerMetrics).StreamServerInterceptor.func4({0x2a54000, 0xc000a16960}, {0x32e2d20?, 0xc000c12800}, 0xc0009f7728, 0xc000c129c0)
spicedb_1          |    /home/runner/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/server_metrics.go:121 +0xd2
spicedb_1          | google.golang.org/grpc.getChainStreamHandler.func1({0x2a54000, 0xc000a16960}, {0x32e2d20, 0xc000c12800})
spicedb_1          |    /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1489 +0xb2
spicedb_1          | go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.StreamServerInterceptor.func1({0x2a54000, 0xc000a16960}, {0x32e1988, 0xc001285ce0}, 0xc0009f7728, 0xc000c12780)
spicedb_1          |    /home/runner/go/pkg/mod/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/[email protected]/interceptor.go:495 +0x4ea
spicedb_1          | google.golang.org/grpc.getChainStreamHandler.func1({0x2a54000, 0xc000a16960}, {0x32e1988, 0xc001285ce0})
spicedb_1          |    /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1489 +0xb2
spicedb_1          | github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging.StreamServerInterceptor.StreamServerInterceptor.func2({0x2a54000, 0xc000a16960}, {0x32e1988, 0xc001285bc0}, 0xc0009f7728?, 0xc000c12700)
spicedb_1          |    /home/runner/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware/[email protected]/interceptors/server.go:35 +0x2db
spicedb_1          | google.golang.org/grpc.getChainStreamHandler.func1({0x2a54000, 0xc000a16960}, {0x32e1988, 0xc001285bc0})
spicedb_1          |    /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1489 +0xb2
spicedb_1          | github.com/authzed/spicedb/pkg/cmd/server.DefaultStreamingMiddleware.StreamServerInterceptor.StreamServerInterceptor.func18({0x2a54000, 0xc000a16960}, {0x32e1988, 0xc001285a40}, 0xc0009f7728?, 0xc000c12640)
spicedb_1          |    /home/runner/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware/[email protected]/interceptors/server.go:35 +0x2db
spicedb_1          | google.golang.org/grpc.getChainStreamHandler.func1({0x2a54000, 0xc000a16960}, {0x32e1988, 0xc001285a40})
spicedb_1          |    /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1489 +0xb2
spicedb_1          | github.com/authzed/spicedb/pkg/middleware/requestid.StreamServerInterceptor.StreamServerInterceptor.func1({0x2a54000, 0xc000a16960}, {0x32e2b28, 0xc00128c780}, 0xc0009f7728?, 0xc000c125c0)
spicedb_1          |    /home/runner/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware/[email protected]/interceptors/server.go:35 +0x2db
spicedb_1          | google.golang.org/grpc.NewServer.chainStreamServerInterceptors.chainStreamInterceptors.func2({0x2a54000, 0xc000a16960}, {0x32e2b28, 0xc00128c780}, 0x2558b60?, 0xc000c008b0?)
spicedb_1          |    /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1480 +0x85
spicedb_1          | google.golang.org/grpc.(*Server).processStreamingRPC(0xc000c601e0, {0x32dca28, 0xc0012857a0}, {0x32ea858, 0xc0010b4680}, 0xc00028cc60, 0xc001284d80, 0x4d03fc0, 0x0)
spicedb_1          |    /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1644 +0x1327
spicedb_1          | google.golang.org/grpc.(*Server).handleStream(0xc000c601e0, {0x32ea858, 0xc0010b4680}, 0xc00028cc60)
spicedb_1          |    /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1741 +0xbfb
spicedb_1          | google.golang.org/grpc.(*Server).serveStreams.func1.1()
spicedb_1          |    /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:986 +0x86
spicedb_1          | created by google.golang.org/grpc.(*Server).serveStreams.func1 in goroutine 836
spicedb_1          |    /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:997 +0x145

from spicedb.

reza-ebrahimi avatar reza-ebrahimi commented on June 12, 2024

I forgot to add, in tests above, I'm truncating database tables before all tests to have empty tables in each test run.

var conn *pgx.Conn

const truncateQuery = `
TRUNCATE
	"public"."alembic_version",
	"public"."metadata",
	"public"."relation_tuple_transaction",
	"public"."relation_tuple",
	"public"."namespace_config",
	"public"."caveat";
`

func truncateSpiceDBTables(ctx context.Context, conn *pgx.Conn) error {
	_, err := conn.Exec(ctx, truncateQuery)
	if err != nil {
		fmt.Fprintf(os.Stderr, "[TRUNCATE] failed: %v\n", err)
		return err
	}

	return nil
}

func TestMutationTruncateTables(t *testing.T) {
	t.Run("truncate tables", func(t *testing.T) {
		err := truncateSpiceDBTables(ctx, conn)
		require.NoError(t, err)
	})
}

from spicedb.

josephschorr avatar josephschorr commented on June 12, 2024

@reza-ebrahimi Are you truncating the tables while SpiceDB is still running?

from spicedb.

reza-ebrahimi avatar reza-ebrahimi commented on June 12, 2024

@reza-ebrahimi Are you truncating the tables while SpiceDB is still running?

Yes

from spicedb.

josephschorr avatar josephschorr commented on June 12, 2024

@reza-ebrahimi Are you truncating the tables while SpiceDB is still running?

Yes

Unfortunately, this is completely unsupported - SpiceDB was not written to handle the case where the datastore behind it is emptied while it is running and it can manifest in random behavior (as we are seeing here).

We'll investigate if we can get a nicer error out instead of a crash, but as this is unsupported behavior, I'll also close the ticket.

If you need a cleared instance of SpiceDB on a per test case, we recommend using serve-testing: https://authzed.com/docs/guides/validation-and-testing#testing-code-against-spicedb

from spicedb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.