-
Notifications
You must be signed in to change notification settings - Fork 165
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
Fatal Exception: realm::KeyNotFound #3431
Comments
@danieltabacaru from a quick scan of Core, this seems to be impossible since we explicitly check for So this is either a race condition (where someone sets |
@nirinchev I don't think it's possible that multiple threads call |
We have extracted the details of the error report from Firebase Crashlytics. I am sharing the error report details. Additionally, based on the creation date of the report, when we looked at the error logs in App Services, we identified a session that we believe could be related. We're not entirely sure if it's directly related, but I'm also sharing that session report. Session details: {"logs":[{"_id":"64ef14030f40c41bcb23a945","co_id":"64ef14000f40c41bcb238b86","type":"SYNC_CONNECTION_END","user_id":"64ef13ffcb1cc6eb86834833","domain_id":"648b15954d2ea9036199b5bb","app_id":"648b15954d2ea9036199b5ba","group_id":"64187f8ff7eff8439d0f865a","request_url":"/api/client/v2.0/app/lm-application-pqiww/realm-sync","request_method":"GET","remote_ip_address":"85.96.214.21","started":"2023-08-30T10:03:47.943Z","completed":"2023-08-30T10:03:47.946Z","function_call_location":"DE-FF","function_call_provider_region":"aws-eu-central-1","status":101,"messages":["Connection was active for: 3s"],"platform":"iOS","platform_version":"22.6.0.0","sdk_name":"Dotnet","sdk_version":"11.3.0","framework_name":"Unity","framework_version":"4.0.30319.17020"},{"_id":"64ef14030f40c41bcb23a944","co_id":"64ef14000f40c41bcb238b86","type":"SYNC_SESSION_END","user_id":"64ef13ffcb1cc6eb86834833","domain_id":"648b15954d2ea9036199b5bb","app_id":"648b15954d2ea9036199b5ba","group_id":"64187f8ff7eff8439d0f865a","request_url":"/api/client/v2.0/app/lm-application-pqiww/realm-sync","request_method":"GET","remote_ip_address":"85.96.214.21","started":"2023-08-30T10:03:47.943Z","completed":"2023-08-30T10:03:47.943Z","function_call_location":"DE-FF","function_call_provider_region":"aws-eu-central-1","messages":["Session was closed by Sync Server","Session was active for: 1s"],"platform":"iOS","platform_version":"22.6.0.0","sdk_name":"Dotnet","sdk_version":"11.3.0","framework_name":"Unity","framework_version":"4.0.30319.17020","sync_query":{"RealmPref":"(owner_id == \"d723a6f6-266b-4b88-89be-43b0786fcb8f\")"},"sync_session_metrics":{"uploads":1,"changesets":1}},{"_id":"64ef14030f40c41bcb23a13f","co_id":"64ef14000f40c41bcb238b86","type":"SYNC_CLIENT_WRITE","user_id":"64ef13ffcb1cc6eb86834833","domain_id":"648b15954d2ea9036199b5bb","app_id":"648b15954d2ea9036199b5ba","group_id":"64187f8ff7eff8439d0f865a","request_url":"/api/client/v2.0/app/lm-application-pqiww/realm-sync","request_method":"GET","remote_ip_address":"85.96.214.21","started":"2023-08-30T10:03:46.916Z","completed":"2023-08-30T10:03:47.057Z","function_call_location":"DE-FF","function_call_provider_region":"aws-eu-central-1","messages":["Upload message contains 1 changesets (total size 637.3 kB) to be integrated","Integrated 1 of 1 remaining changesets (total size 637.3 kB) (0 required conflict resolution) in 1 attempts to bring server version to 25183092"],"platform":"iOS","platform_version":"22.6.0.0","sdk_name":"Dotnet","sdk_version":"11.3.0","framework_name":"Unity","framework_version":"4.0.30319.17020","sync_query":{"RealmPref":"(owner_id == \"d723a6f6-266b-4b88-89be-43b0786fcb8f\")"},"sync_write_summary":{"RealmPref":{"inserted":["d723a6f6-266b-4b88-89be-43b0786fcb8f_Game.SaveData.SuperPowerSaveDataSynced_prod","d723a6f6-266b-4b88-89be-43b0786fcb8f_TutorialSaveDataSynced_prod","d723a6f6-266b-4b88-89be-43b0786fcb8f_FitTheBlocks.Store.StoreSaveDataSynced_prod","d723a6f6-266b-4b88-89be-43b0786fcb8f_Game.Team.TeamSaveDataSynced_prod","d723a6f6-266b-4b88-89be-43b0786fcb8f_Game.SaveDatas.RushEventSaveDataSynced_prod","d723a6f6-266b-4b88-89be-43b0786fcb8f_Game.EndlessLeague.EndlessLeagueSaveDataSynced_prod","d723a6f6-266b-4b88-89be-43b0786fcb8f_Game.DailyReward.DailyRewardSaveDataSynced_prod","d723a6f6-266b-4b88-89be-43b0786fcb8f_Game.PlayerHealth.PlayerHealthSaveDataSynced_prod","d723a6f6-266b-4b88-89be-43b0786fcb8f_Game.Leaderboard.LeaderboardSaveDataSynced_prod","d723a6f6-266b-4b88-89be-43b0786fcb8f_Game.EventSystem.ProgressiveEvent.PlayerEventSaveDataSynced_prod","d723a6f6-266b-4b88-89be-43b0786fcb8f_PlayerValueSystemSaveDataSynced_prod","d723a6f6-266b-4b88-89be-43b0786fcb8f_Game.Common.HintLoadingSaveDataSynced_prod","d723a6f6-266b-4b88-89be-43b0786fcb8f_AdSaveDataSynced_prod","d723a6f6-266b-4b88-89be-43b0786fcb8f_Game.MetaScene.MetaSceneSaveDataSynced_prod","d723a6f6-266b-4b88-89be-43b0786fcb8f_Game.SaveData.GlobalSaveDataSynced_prod"]}}},{"_id":"64ef14020f40c41bcb239de5","co_id":"64ef14000f40c41bcb238b86","type":"SYNC_SESSION_START","user_id":"64ef13ffcb1cc6eb86834833","domain_id":"648b15954d2ea9036199b5bb","app_id":"648b15954d2ea9036199b5ba","group_id":"64187f8ff7eff8439d0f865a","request_url":"/api/client/v2.0/app/lm-application-pqiww/realm-sync","request_method":"GET","remote_ip_address":"85.96.214.21","started":"2023-08-30T10:03:46.623Z","completed":"2023-08-30T10:03:46.641Z","function_call_location":"DE-FF","function_call_provider_region":"aws-eu-central-1","messages":["Roles selected for sync:"," user: [ RealmPref ]"],"platform":"iOS","platform_version":"22.6.0.0","sdk_name":"Dotnet","sdk_version":"11.3.0","framework_name":"Unity","framework_version":"4.0.30319.17020","sync_query":{"RealmPref":"(owner_id == \"d723a6f6-266b-4b88-89be-43b0786fcb8f\")"}},{"_id":"64ef14020f40c41bcb239a8c","co_id":"64ef14000f40c41bcb238b86","type":"SYNC_SESSION_END","user_id":"64ef13ffcb1cc6eb86834833","domain_id":"648b15954d2ea9036199b5bb","app_id":"648b15954d2ea9036199b5ba","group_id":"64187f8ff7eff8439d0f865a","request_url":"/api/client/v2.0/app/lm-application-pqiww/realm-sync","request_method":"GET","remote_ip_address":"85.96.214.21","started":"2023-08-30T10:03:46.288Z","completed":"2023-08-30T10:03:46.288Z","function_call_location":"DE-FF","function_call_provider_region":"aws-eu-central-1","messages":["Session closed after receiving UNBIND event","Session was active for: 0s"],"platform":"iOS","platform_version":"22.6.0.0","sdk_name":"Dotnet","sdk_version":"11.3.0","framework_name":"Unity","framework_version":"4.0.30319.17020","sync_query":{"RealmPref":"(owner_id == \"d723a6f6-266b-4b88-89be-43b0786fcb8f\")"},"sync_session_metrics":{"downloads":2,"downloaded_changesets":2,"downloaded_changesets_size":66}},{"_id":"64ef14020f40c41bcb23990c","co_id":"64ef14000f40c41bcb238b86","type":"SYNC_OTHER","user_id":"64ef13ffcb1cc6eb86834833","domain_id":"648b15954d2ea9036199b5bb","app_id":"648b15954d2ea9036199b5ba","group_id":"64187f8ff7eff8439d0f865a","request_url":"/api/client/v2.0/app/lm-application-pqiww/realm-sync","request_method":"GET","remote_ip_address":"85.96.214.21","started":"2023-08-30T10:03:46.085Z","completed":"2023-08-30T10:03:46.111Z","function_call_location":"DE-FF","function_call_provider_region":"aws-eu-central-1","messages":["changing query from existing query to new query","Roles selected for sync:"," user: [ RealmPref ]"],"platform":"iOS","platform_version":"22.6.0.0","sdk_name":"Dotnet","sdk_version":"11.3.0","framework_name":"Unity","framework_version":"4.0.30319.17020","sync_query":{"RealmPref":"(owner_id == \"d723a6f6-266b-4b88-89be-43b0786fcb8f\")"}},{"_id":"64ef14010f40c41bcb23961a","co_id":"64ef14000f40c41bcb238b86","type":"SYNC_SESSION_START","user_id":"64ef13ffcb1cc6eb86834833","domain_id":"648b15954d2ea9036199b5bb","app_id":"648b15954d2ea9036199b5ba","group_id":"64187f8ff7eff8439d0f865a","request_url":"/api/client/v2.0/app/lm-application-pqiww/realm-sync","request_method":"GET","remote_ip_address":"85.96.214.21","started":"2023-08-30T10:03:45.723Z","completed":"2023-08-30T10:03:45.758Z","function_call_location":"DE-FF","function_call_provider_region":"aws-eu-central-1","platform":"iOS","platform_version":"22.6.0.0","sdk_name":"Dotnet","sdk_version":"11.3.0","framework_name":"Unity","framework_version":"4.0.30319.17020","sync_query":{}},{"_id":"64ef14000f40c41bcb238dc7","co_id":"64ef14000f40c41bcb238b86","type":"SYNC_SESSION_START","user_id":"64ef13ffcb1cc6eb86834833","domain_id":"648b15954d2ea9036199b5bb","app_id":"648b15954d2ea9036199b5ba","group_id":"64187f8ff7eff8439d0f865a","request_url":"/api/client/v2.0/app/lm-application-pqiww/realm-sync","request_method":"GET","remote_ip_address":"85.96.214.21","started":"2023-08-30T10:03:44.784Z","completed":"2023-08-30T10:03:44.786Z","function_call_location":"DE-FF","function_call_provider_region":"aws-eu-central-1","error":"client sent incorrect file ident salt (1566239614975697207 != 5929118636970194382). This is likely due to using a synchronized realm after terminating and re-enabling sync. Please wipe the file on the client to resume synchronization. { sessionIdent: 1, clientFileIdent: 14556 } (ProtocolErrorCode=211)","error_code":"DivergingHistories","messages":["Roles selected for sync:"," user: [ RealmPref ]"],"platform":"iOS","platform_version":"22.6.0.0","sdk_name":"Dotnet","sdk_version":"11.3.0","framework_name":"Unity","framework_version":"4.0.30319.17020","sync_query":{"RealmPref":"(owner_id == \"d723a6f6-266b-4b88-89be-43b0786fcb8f\")"}},{"_id":"64ef14000f40c41bcb238b91","co_id":"64ef14000f40c41bcb238b86","type":"SYNC_CONNECTION_START","user_id":"64ef13ffcb1cc6eb86834833","domain_id":"648b15954d2ea9036199b5bb","app_id":"648b15954d2ea9036199b5ba","group_id":"64187f8ff7eff8439d0f865a","request_url":"/api/client/v2.0/app/lm-application-pqiww/realm-sync","request_method":"GET","remote_ip_address":"85.96.214.21","started":"2023-08-30T10:03:44.518Z","completed":"2023-08-30T10:03:44.518Z","function_call_location":"DE-FF","function_call_provider_region":"aws-eu-central-1","platform":"iOS","platform_version":"22.6.0.0","sdk_name":"Dotnet","sdk_version":"11.3.0","framework_name":"Unity","framework_version":"4.0.30319.17020"}]} |
We see a |
We think the root cause of these errors may be realm/realm-core#6961. |
We are using the ClientResetHandler, but only for logging purposes. I'm also sharing the FlexibleSyncConfiguration that we use for Realm files.
In addition, we do not attempt to log in again or create a new instance of the Realm files as long as the JWT token has not expired. However, in some cases, we call SyncSession.Stop() and SyncSession.Start(), and this happens asynchronously. Unfortunately, I don't have any more information about the error. What do we need to do to ensure that the situation you are thinking of never occurs? |
The ticket I linked it's a bug on our side and we'll fix it. It's still not fully clear if that's causing these errors. It was discovered while investigating this (we are still looking into it). |
@avolkangursel As mentioned, we'll fix realm/realm-core#6961 which may cause this (and #3430). If that's the real root cause then there is nothing needed on your side. Some logs would really help here. |
➤ Jonathan Reams commented: I think this was fixed in realm/realm-core#7088 (core version 13.23.3). I think what's happening here is that you're getting a client reset which eventually resets your latest subscription set version but doesn't update the variable we use to track whether that subscription set needs to be marked as complete, then when we get a MARK message and try to update the non-existent subscription set as complete we get an error from the DB because the subscription set version no longer maps to any objects on disk. If you've already upgraded to 13.23.3, does this still reproduce for you? |
For context, the first version of the .NET SDK that pulls in Core 13.23.3+ is 11.6.1. @avolkangursel please try to update to that version and let us know if you still experience the problem. |
What happened?
Hello, occasionally we receive crash reports like the one below from our live game. We obtain these reports through Firebase Crashlytics.
It seems that the occurrence of this error is causing a crash in another thread. Details of the crashed thread are as follows:
From the older version (realm-dotnet v11.0.0), these reports were coming from about 1.5-2% of the players. Currently, it is much less frequent (around 0.2-0.3%). However, it persists. How can we prevent this?
Unity version: 2021.3.26f1
Repro steps
Unfortunately, we are unable to capture it in our own tests. This error report doesn't occur very often, but it's affecting the smooth operation of our game.
Version
11.3.0
What Atlas Services are you using?
Both Atlas Device Sync and Atlas App Services
What type of application is this?
Unity
Client OS and version
iOS16.6.0
Code snippets
No response
Stacktrace of the exception/crash you're getting
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: