Uploaded image for project: 'Realm .NET SDK'
  1. Realm .NET SDK
  2. RNET-1052

Fatal Exception: realm::KeyNotFound

      What happened?

      Hello, occasionally we receive crash reports like the one below from our live game. We obtain these reports through Firebase Crashlytics.

      > Fatal Exception: realm::KeyNotFound
      No object with key '-1' in 'flx_subscription_sets'

      It seems that the occurrence of this error is causing a crash in another thread. Details of the crashed thread are as follows:

      > Crashed: com.google.firebase.crashlytics.ios.exception
      SIGABRT ABORT 0x00000001e15e9198
      0 FirebaseCrashlytics 0x1eea8 FIRCLSProcessRecordAllThreads + 184
      1 FirebaseCrashlytics 0x1f288 FIRCLSProcessRecordAllThreads + 1176
      2 FirebaseCrashlytics 0x164dc FIRCLSHandler + 48
      3 FirebaseCrashlytics 0x111e4 __FIRCLSExceptionRecord_block_invoke + 92
      4 libdispatch.dylib 0x64780 _dispatch_client_callout + 16
      5 libdispatch.dylib 0x46a50 _dispatch_lane_barrier_sync_invoke_and_complete + 52
      6 FirebaseCrashlytics 0x101f0 FIRCLSExceptionRecord + 204
      7 FirebaseCrashlytics 0xff00 FIRCLSTerminateHandler() + 588
      8 libc++abi.dylib 0x13424 std::__terminate(void ()) + 12
      9 libc++abi.dylib 0x15da0 __cxa_get_exception_ptr + 30
      10 libc++abi.dylib 0x15d60 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*) + 130
      11 realm-wrappers 0x29d0f8 realm::ClusterNode::get(realm::ObjKey, realm::ClusterNode::State&) const + 300
      12 realm-wrappers 0x3a734c realm::Table::get_object_with_primary_key(realm::Mixed) const + 180
      13 realm-wrappers 0x260244 realm::sync::SubscriptionStore::get_mutable_by_version(long long) + 200
      14 realm-wrappers 0x1e2ae4 realm::sync::SessionWrapper::on_download_completion() + 364
      15 realm-wrappers 0x22fed4 realm::sync::ClientImpl::Session::receive_mark_message(unsigned long long) + 360
      16 realm-wrappers 0x22c4e0 void realm::impl::ClientProtocol::parse_message_received<realm::sync::ClientImpl::Connection>(realm::sync::ClientImpl::Connection&, std::1::basic_string_view<char, std::_1::char_traits<char>>) + 248
      17 realm-wrappers 0x236350 realm::sync::ClientImpl::Connection::WebSocketObserverShim::websocket_binary_message_received(realm::util::Span<char const, 18446744073709551615ul>) + 148
      18 realm-wrappers 0x21ab64 (anonymous namespace)::WebSocket::frame_reader_loop() + 136
      19 realm-wrappers 0x20dba0 realm::sync::network::Service::BasicStreamOps<realm::sync::network::ssl::Stream>::BufferedReadOper<realm::util::UniqueFunction<void (std::__1::error_code, unsigned long)>>::recycle_and_execute() + 220
      20 realm-wrappers 0x2144d4 realm::sync::network::Service::Impl::run_impl(bool) + 388
      21 realm-wrappers 0x2059f8 realm::sync::websocket::DefaultSocketProvider::event_loop() + 220
      22 realm-wrappers 0x2076c4 void* std::1::*thread_proxy<std::*1::tuple<std::*1::unique_ptr<std::*1::*thread_struct, std::*1::default_delete<std::*1::_thread_struct>>, void (realm::sync::websocket::DefaultSocketProvider::)(), realm::sync::websocket::DefaultSocketProvider_>>(void) + 64
      23 libsystem_pthread.dylib 0x30ec _pthread_start + 116
      24 libsystem_pthread.dylib 0x172c thread_start + 8

      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

            Assignee:
            jonathan.reams@mongodb.com Jonathan Reams
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: