Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

State condition failed in table:60 #1072

Open
asegurpe opened this issue Apr 20, 2022 · 11 comments
Open

State condition failed in table:60 #1072

asegurpe opened this issue Apr 20, 2022 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@asegurpe
Copy link

asegurpe commented Apr 20, 2022

Describe the bug
When querying a collection you get the error:
State condition failed in table:60
The problem occurs when the paging limit is greater than 1. When the paging limit is 1 it has no problem.

Basic info (please complete the following information):

  • ObjectBox version: 2.9.1
  • Reproducibility: always on a single computer (database), on other computers (databases) it does not happen
  • Device: Computer
  • OS: Windows 10

To Reproduce
I don't know how reproduce it

Expected behavior
Find results

Code

private List<GenericBox> getPagination(Query<GenericBox> b, ParamsDao params) {
               if (params.getLimit() > 0) {
                              return b.find(params.getIndex(), params.getLimit());
               }
               return b.find();
}

Logs, stack traces

Caused by: java.lang.IllegalStateException: State condition failed in table:60: object
               at io.objectbox.query.Query.nativeFind(Native Method)
               at io.objectbox.query.Query.lambda$find$3(Query.java:230)
               at io.objectbox.BoxStore.callInReadTx(BoxStore.java:897)
               at io.objectbox.BoxStore.callInReadTxWithRetry(BoxStore.java:843)
               at io.objectbox.query.Query.callInReadTx(Query.java:292)
               at io.objectbox.query.Query.find(Query.java:229)

Additional context
We have had to rebuild the entire database to fix the problem, but we are concerned about it happening again.

@asegurpe asegurpe added the bug Something isn't working label Apr 20, 2022
@ivahnenkoAnna
Copy link
Contributor

Thanks for the report. We're looking into this and will reply as soon as possible.

@asegurpe
Copy link
Author

asegurpe commented Apr 22, 2022

I await with curiosity the resolution of the bug.
Thank you very much Anna 😀

@greenrobot-team
Copy link
Member

Thanks for the code snippet. We have not found the specific cause, yet, but are tracking this internally and will update this issue once we have more info.

@greenrobot
Copy link
Member

Reproducibility: always on a single computer (database), on other computers (databases) it does not happen

Are any things special for this computer?

Also, the code seems to be triggered in 32-bit only code. Thus, this PC seems to be running the 32-bit version of the lib. Does that match the actual CPU?

@asegurpe
Copy link
Author

asegurpe commented May 2, 2022

No, this computer is not special and the process runs on the 32-bit platform because of other 32-bit dll dependencies.

So far it has only happened on this computer but we can't be sure that it can't happen on others in the future.

Thanks.

@greenrobot
Copy link
Member

greenrobot commented May 2, 2022

Thanks. Still trying to reproduce this... So far no luck...

  1. Can you give an example on the numbers when this happens? I.e. total query result count, offset, and limit?
  2. Is there also a sort order in the query defined? If so, does it also happen without it?
  3. Do you have conditions on the query? If so, is at least one of the conditions based on an indexed property?

@greenrobot-team greenrobot-team added the more info required Further information is requested label May 3, 2022
@asegurpe
Copy link
Author

asegurpe commented May 3, 2022

Thanks again for your help.

As I said, it has only happened to us once on a production computer but we cannot share the database due to confidentiality.

What we have seen is:

  • Is related to sorted queries (by any field and ascending and descending order).
  • If we put a limit, it occurs between 2800 and 3200 records, out of a total of 5000. If the limit is 1, there is no problem.
  • apparently, the stored data are correct and valid and do not have any special characters.

@github-actions github-actions bot removed the more info required Further information is requested label May 10, 2022
@greenrobot-team
Copy link
Member

@asegurpe Thanks for these details! The new 3.1.3 release adds additional information to error messages that might help us diagnose this issue.

@greenrobot-team greenrobot-team added the more info required Further information is requested label May 11, 2022
@asegurpe
Copy link
Author

Hi,

We have upgraded to 3.1.3 as you say and the stacktrace shows a different message:

Caused by: java.lang.IllegalStateException: State condition failed in visitMatchesOrdered:221: id != lastId
	at io.objectbox.query.Query.nativeFind(Native Method)
	at io.objectbox.query.Query.lambda$find$3(Query.java:235)
	at io.objectbox.BoxStore.callInReadTx(BoxStore.java:936)
	at io.objectbox.BoxStore.callInReadTxWithRetry(BoxStore.java:882)
	at io.objectbox.query.Query.callInReadTx(Query.java:297)
	at io.objectbox.query.Query.find(Query.java:234)

Thanks.

@greenrobot
Copy link
Member

Thanks; interestingly it now fails a different location. Which is not exactly expected... Can you confirm that from your side, nothing changed?

@asegurpe
Copy link
Author

Yes, it is the same code and the same database.

Thanks.

@github-actions github-actions bot removed the more info required Further information is requested label May 13, 2022
@greenrobot-team greenrobot-team self-assigned this Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants