zed icon indicating copy to clipboard operation
zed copied to clipboard

Unable to import relationships without a schema file

Open heytrav opened this issue 9 months ago • 7 comments

I'm attempting to import relationships for an existing schema. I've tried defining the relationships files a few different ways but without any luck.

My relations file is structured like in the examples:

relationships: >-
  document:firstdoc#writer@user:tom

  document:firstdoc#reader@user:fred

  document:seconddoc#reader@user:tom

Because I already have a schema loaded into SpiceDB I would expect that I can import the relationships separately, however I always get an error mesages:

 zed import --schema=false  dev-resources/k8s-data/spicedb-data/relations/documents.yaml

2:01PM ERR terminated with errors error="either schema or schemaFile must be present"

heytrav avatar May 08 '25 02:05 heytrav

That's unintentional; i'll have a look.

tstirrat15 avatar May 08 '25 16:05 tstirrat15

As a workaround in the meantime, you should be able to add an empty schema key

tstirrat15 avatar May 08 '25 16:05 tstirrat15

I have tried that. When I do though it deletes the schema.

heytrav avatar May 08 '25 17:05 heytrav

Even with schema=false? That's even more surprising. I'm getting a test together.

tstirrat15 avatar May 08 '25 18:05 tstirrat15

Yes even with schema=false. It doesn't give me the error, but afterwards the schema that was loaded is gone.

heytrav avatar May 08 '25 18:05 heytrav

If it helps, I do see this error in my logs a lot

the version of SpiceDB being called is out of date. See: [https://github.com/authzed/spicedb/releases/tag/v1.43.0](https://github.com/authzed/spicedb/releases/tag/v1.43.0%22%7D)

I am installing it in my cluster like this:

kubectl apply -o yaml --server-side -f https://github.com/authzed/spicedb-operator/releases/latest/download/bundle.yaml

heytrav avatar May 08 '25 18:05 heytrav

Yeah, I'm expecting that this is a bug in zed, not in SpiceDB - it's about the calls that zed is making to SpiceDB (or not). Zed will yell if it knows about a newer version of SpiceDB than the one you're on, and the installation method you're using defaults to the stable channel, which is usually a version or two behind the latest release.

tstirrat15 avatar May 09 '25 15:05 tstirrat15