"internal_error": "iterator 0 is not in ascending order" #491
-
|
Hi, I started seeing this error today, when checking certain relationships - eg:
The issue is happening on both my production and staging environments. ChatGPT thinks my postgres DB might be missing this index? Indeed, that index does not exist. But we don't usually touch these - we just run the I'm not sure what to do. Any help getting to the bottom of it would be appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 24 replies
-
Beta Was this translation helpful? Give feedback.
-
|
Which OpenFGA version are you using? The issue does not seem related to indexes. Can you reproduce it consistently? |
Beta Was this translation helpful? Give feedback.
-
|
Hi @aaguiarz, I'm on 1.9.3 I think have narrowed it down to a set of tuples, which consistently give the error on a certain relationship check... The relationship is basically like this: I get TRUE when checking I get TRUE when checking But I get the error when checking Obviously my actual user/team/project ids are not A/B/C. However, I created those exact tuples via the api to try and replicate the issue, and this time the check worked as expected. So I'm guessing there's something wrong with the actual data? I'm currently trying to delete and recreate tuples to see if I can narrow it down further. Any suggestions would be great though |
Beta Was this translation helpful? Give feedback.
-
|
Do you know how the DB Character set is configured? |
Beta Was this translation helpful? Give feedback.
-
|
OK, I can reliably replicate the issue with certain id values, which contain "-". It seems to be when there are multiple entries with the same prefix before the "-". But not always. This example breaks every time: Write these: Then check: Which gives: However, if I simplify my model right down to these relationships only, then the error goes away. So next I'll try and narrow that down. If so, I should have a fully reproducible example. |
Beta Was this translation helpful? Give feedback.
-
|
We are getting this error as well. It seems to be affecting users that have more relationships than others. { |
Beta Was this translation helpful? Give feedback.
-
|
Hi again. I have now created a git repo, which reproduces the error using the latest openfga docker image. https://github.com/danloiterton/openfga-iterator0-bug Note:
See repo README for more details. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @danloiterton , we'll take a look at it |
Beta Was this translation helpful? Give feedback.
-
|
Hey, I am still seeing this error in v1.10.2 (our dev environment) Applied migration, and here are the indexes in the tuple table: This is not happening in v1.9.0 (our production environment) |
Beta Was this translation helpful? Give feedback.


@danloiterton @harper we were able to reproduce the issue and we are working on a fix here openfga/openfga#2661
Thanks a lot for your help!