Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-477

Database corrupted (Invalid top array)

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None

      <!---

      Questions: If you have questions about HOW TO use Realm, please ask on
      StackOverflow: http://stackoverflow.com/questions/ask?tags=realm
      We monitor the realm tag.

      Feature Request: Just fill in the first two sections below.

      Bugs: To help you as fast as possible with an issue please describe your issue
      and the steps you have taken to reproduce it in as much detail as possible.

      -->
      Hello I am using realm in my project with react-native and one client has a problem with his realm database, this was corrupted and I don't know how happened. I took the database file from the tablet's client and I tried to open it with Realm Studio (with versions 3.8.0, 3.9.0-beta.0 and 3.10) but only get the same error Invalid top array. Also I tried to open this db in a android emulator with react native 0.61.5 with realm 3.6.4 and fails, and also I updated realm in mi app to 3.6.5 and get same error (Invalid top array). Also a tried to compare files in hexadecimal with a sane realm db but I couldn't fix anything.

      Are there any tools other than Realm Studio which could serve me to diagnose, or better, save some of the data?

      Goals

      <!--- What are you trying to achieve? -->
      I try to open a client realm db generated in a tablet (using react-native with android 9)

      Expected Results

      <!--- What did you expect to happen? -->
      Open correctly db in the tablet or in realm studio.

      Actual Results

      <!--- What happened instead? -->
      The smartphone fails and throw the error:

      [Error: Unable to open a realm at path '/path/to/default.realm': Invalid top array (ref: 11312616, size: 6436966)
      Exception backtrace:
      <backtrace not supported on this platform> Path:Exception backtrace:
      <backtrace not supported on this platform>.]
      

      Realm studio (v3.10.0) also fails with:

      Unable to open a realm at path '/path/to/default.realm': Invalid top array (ref: 11312616, size: 6436966)
      Exception backtrace:
      0 .io.realm.realm-studio.wHfWNA 0x000000010fc2a271 _ZN5realm15InvalidDatabaseC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_ + 49
      1 .io.realm.realm-studio.wHfWNA 0x000000010fc18660 _ZN5realm5Group18validate_top_arrayERKNS_5ArrayERKNS_9SlabAllocE + 1632
      2 .io.realm.realm-studio.wHfWNA 0x000000010fc22710 _ZN5realm11SharedGroup7do_openERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbbNS_18SharedGroupOptionsE + 5136
      3 .io.realm.realm-studio.wHfWNA 0x000000010f925a1c _ZN5realm11SharedGroup4openERNS_11ReplicationENS_18SharedGroupOptionsE + 236
      4 .io.realm.realm-studio.wHfWNA 0x000000010f925403 _ZN5realm11SharedGroupC2ERNS_11ReplicationENS_18SharedGroupOptionsE + 1587
      .......
      

      <!--- e.g. the stack trace of a crash -->

      Steps to Reproduce

      <!--- What are steps we can follow to reproduce this issue? -->
      I don't know. This is a DB from a client's tablet and the only thing she said to me is that "the app failed". So I've extracted the file from the device, and tinkered a little bit with it, but couldn't get anything

      Code Sample

      <!---
      Please provide a code sample or test case that highlights the issue.
      If relevant, include your model definitions.
      For larger code samples, links to external gists/repositories are preferred.
      Full projects that we can compile and run ourselves are ideal!
      -->

      Version of Realm and Tooling

      • Realm JS SDK Version: 3.6.4
      • Realm Studio: 3.8.0, 3.9.0-beta.0 and 3.10
      • Node or React Native: React native 0.61.5

            Assignee:
            jorgen.edelbo@mongodb.com Jørgen Edelbo
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: