Hi, I think I've found a bug. It's not
# spicedb
d
Hi, I think I've found a bug. It's not directly with one of the open source products, so I didn't make a bug in github, but I'm glad to do that. I have a workaround as well, so it's not super critical. invalid expression for caveat `unexpired_grant`: ERROR: unexpired_grant๐Ÿ‘Ž0: expression code point size exceeds limit: size: 100306, limit 100000 See https://play.authzed.com/s/_zPjtwifESOy/schema. The workaround is to move the caveat to the top of the file, see https://play.authzed.com/s/NBlMsgoakVic/assertions.
Obviously this example is contrived, I have a large schema and didn't want to share all the internal details ๐Ÿ™‚
Oh, and the place I see the error is the playground (hopefully clear from the links, but just in case...)
e
Nice find! I think this is worth a writeup in Github if you have the time (if not, let me know and I'll write it up) Looks like some problem with how source locations are mapped into the CEL parser for caveats.
j
its because comments are attached to the first definition or caveat below them
so in your former example, you have the giant
//////
comment attaching to the caveat
in the latter, it attaches to the definition
and definitions can be larger
if I may ask: why the giant comment>?
d
@Joey the comment isn't really super special, in my private version, it's a bunch of very large definitions. But I didn't want to publicly share them, so I replaced it with a comment. Here's a version without any comments that replicates the issue https://play.authzed.com/s/AebNlkloDCyD/schema
j
thanks
will take a look; can I use that ^ schema for testing?
i.e. add it into unit tests
@d.richardson ^
d
Sorry, in a meeting, I'll get back to you soon
Thanks for your patience. Sorry about that. Obviously most of what is there is randomly generated. I'd prefer my name doesn't end up in the unit tests though, and I'll rename iam_role_name to something even more generic just in case. This is totally fine to use in the unit tests https://play.authzed.com/s/b1-RN001EQpW/schema
j
sounds good
figured it out; PR coming in
d
Thanks @Joey that was fast, that fixes it on my real schema as well!
j
cool
will be in the next release candidate