Skip to content
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

Error: Database has an unsupported version (24) and cannot be upgraded #6786

Closed
ryansherby opened this issue Jul 11, 2024 · 2 comments
Closed
Labels
Encryption:Off Frequency:Always More-information-needed More information is needed to progress. The issue will close automatically in 2 weeks. O-Community Repro:Always SDK-Use:Local T-Bug Waiting-For-Reporter Waiting for more information from the reporter before we can proceed

Comments

@ryansherby
Copy link

How frequently does the bug occur?

Always

Description

package.json for App.tsx
{
"@realm/react": "^0.8.0",
"realm": "^12.6.2"
}

package.json for prepopulateRealm.js
{
"realm": "^12.6.2",
}

The schemas for each realm are identical.

const config = {
schemaVersion: 1,
schema: schemas,
};

Run prepopulateRealm.js, then add to bundle as /assets/realm/bundle.realm

Then run below with the path in the realmConfig to the DocumentsDirectory.

Realm.copyBundledRealmFiles();
const realmContext = createRealmContext(realmConfig);
const {RealmProvider} = realmContext;

export default function App():React.JSX.Element {
return (



<Stack.Navigator>

</Stack.Navigator>


);
}

I then receive this error. I would expect that the uptake for the bundled realm should be seamless. Within the DocumentsDirectory I see it creates the .lock and .management files.

I can also ping this location using a separate js file using this config:
const config = {
schemaVersion: 1,
schema: schemas,
path: "/path/to/DocumentsDirectory/bundle.realm"
};
And the data is there.

Stacktrace & log output

ERROR  Error: Database has an unsupported version (24) and cannot be upgraded

This error is located at:
    in Unknown (created by App)
    in EnsureSingleNavigator
    in BaseNavigationContainer
    in ThemeProvider
    in NavigationContainerInner (created by App)
    in App
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in bacBuddy(RootComponent), js engine: hermes

Can you reproduce the bug?

Always

Reproduction Steps

  1. Create a bundled realm file with schema
  2. Add bundled realm file to BundlePath
  3. Realm.copyBundledRealmFiles();
  4. Create RealmProvider from createRealmContext using schema

Version

"realm": "^12.6.2"

What services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

iOS 17.5

Build environment

Which debugger for React Native: ..

Cocoapods version

No response

Copy link

sync-by-unito bot commented Jul 11, 2024

➤ PM Bot commented:

Jira ticket: RJS-2862

@kneth
Copy link
Contributor

kneth commented Jul 11, 2024

@ryansherby

The file format was changed in v12.7.0 (to version 24). As you have an app and a script (you mention two package.json files), you should check if both are using file format 23 or 24 (grep \"version\": node_modules/realm/package.json | cut -f2 -d: | cut -f2 -d\" will give you the SDK version).

My guess is that your app is using Realm JS v12.6.2 and your script is using v12.7.0 or newer.

@sync-by-unito sync-by-unito bot added More-information-needed More information is needed to progress. The issue will close automatically in 2 weeks. Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Jul 11, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Encryption:Off Frequency:Always More-information-needed More information is needed to progress. The issue will close automatically in 2 weeks. O-Community Repro:Always SDK-Use:Local T-Bug Waiting-For-Reporter Waiting for more information from the reporter before we can proceed
Projects
None yet
Development

No branches or pull requests

2 participants