Encryption error when opening Realm

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintableJSON

      How frequently does the bug occur?

      Sometimes

      Description

      I have several devices running without any problems, but one device is giving me this error when opening the database at all times

      const KEY = '7pwYH@pg-Exw1Z0+VOV3J!OV3*JNxBw@ZW0V1OVa!3JNN-WrMql@SEkIz8+KB2GH;
      const encryptionKey = new Uint8Array(KEY.split('').map((val) => val.charCodeAt(0)));
      ew Realm({
           path: 'app.db',
           encryptionKey,
           inMemory: false,
           schemaVersion: 3,
           schema: [schemas.schemaReduxPersist, schemas.schemaPosition, schemas.schemaChat],
           shouldCompact: (totalBytes, usedBytes) => {
             const oneHundredMB = 1 * 1024 * 1024 * 1024; // 1 Gb
             return totalBytes > oneHundredMB && usedBytes / totalBytes < 0.5;
           },
         })
      

      Stacktrace & log output

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      "stack":"Error: Exception in HostFunction: Unable to open a realm at path '/data/data/com.spacecom.mpmobile/files/app.db': Realm file decryption failed Path:Exception backtrace:\n<backtrace not supported on this platform>.\n    at Realm (native)\n    at apply (native)\n    at Realm (JavaScript:8:41)\n    at connect (address at index.android.bundle:1:1067456)\n    at use (address at index.android.bundle:1:1067697)\n    at size (address at index.android.bundle:1:1715039)\n    at ?anon_0_ (address ..."}
      

      Can you reproduce the bug?

      No

      Reproduction Steps

      No response

      Version

      30

      What services are you using?

      Local Database only

      Are you using encryption?

      Yes

      Platform OS and version(s)

      Android

      Build environment

      Which debugger for React Native: ..

      Cocoapods version

      No response

            Assignee:
            Unassigned
            Reporter:
            Unito Sync Bot
            Archiver:
            Marc Greenfield

              Created:
              Updated:
              Resolved:
              Archived: