Uploaded image for project: 'Realm Core'
  1. Realm Core
  2. RCORE-1888

EncryptionKeyCheck test failure on exfat

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Core
    • None

      Expected results

      Test pass

      Actual Results

      test_shared.cpp:2213: ERROR in Shared_EncryptionKeyCheck_3: Unhandled exception after line 2213 realm::InvalidDatabase: Failed to open Realm file at path '...': Realm file decryption failed (Decryption failed)

      Steps & Code to Reproduce

      Reproduces somewhat often when relevant tests run on exfat fs:

      ``UNITTEST_KEEP_FILES=1 UNITTEST_FILTER=_EncryptionKey ./test/realm-tests.app/Contents/MacOS/realm-tests /Volumes/exfat/``

      CI run with logs but there is nothing other than logged exception

      With added logs and additional checks it can be seen where it fails (one such example):

      Thread[2]: /Users/user/r/core/test/test_shared.cpp:2197: ERROR in Shared_EncryptionKeyCheck: CHECK_NOTHROW(db = DB::create(path, false, DBOptions(crypt_key(true)))) failed: Did throw realm::InvalidDatabase: Failed to open Realm file at path '/Volumes/SD8/tmp/Shared_EncryptionKeyCheck.1.path.realm': Realm file decryption failed (Decryption failed: 'refresh_page failed: 18, 0, , 16384, 0, 24')                     
      Thread[2]: /Users/user/r/core/test/test_shared.cpp:2198: ERROR in Shared_EncryptionKeyCheck: CHECK(db) failed
      Thread[2]: /Users/user/r/core/test/test_shared.cpp:2200: ERROR in Shared_EncryptionKeyCheck: CHECK_NOTHROW(db = DB::create(path, false, DBOptions(crypt_key(true)))) failed: Did throw realm::InvalidDatabase: Failed to open Realm file at path '/Volumes/SD8/tmp/Shared_EncryptionKeyCheck.1.path.realm': Realm file decryption failed (Decryption failed: 'refresh_page failed: 8, 0, , 16384, 0, 24')                      
      Thread[2]: /Users/user/r/core/test/test_shared.cpp:2201: ERROR in Shared_EncryptionKeyCheck: CHECK(db) failed
      FAILURE: 1 out of 3 tests failed (4 out of 15 checks failed).
      Test time: 132.56ms
      Note: 1576 tests were excluded!
      
      Top 3 time usage:
      -------------------------------------
      Shared_EncryptionKeyCheck    132.48ms
      Shared_EncryptionKeyCheck_3   18.28ms
      Shared_EncryptionKeyCheck_2   18.28ms
      

      All three relevant test should run concurrently to trigger the issue from what i can tell. Resulting realm files will be invalid and can't be read after such failure: realm-trawler will report the same DecryptionFailed error. I suspect it's the same type of issue as here #6959 since encrypted mapping also uses file uids.

      Core version

      Core version: 13.23.4

            Assignee:
            Unassigned Unassigned
            Reporter:
            kirill.burtsev@mongodb.com Kirill Burtsev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: