Skip to content

attempt to write a readonly database (code 1032 SQLITE_READONLY_DBMOVED[1032]) #422

Closed
@kevinranks

Description

@kevinranks

I have users receiving this error:

attempt to write a readonly database (code 1032 SQLITE_READONLY_DBMOVED[1032])

Some Googling and #178 even mentions that this could be related to the default max storage size (6MB). However, I've already implemented this (we're on v1.7.0 prior to AsyncStorage_db_size_in_MB implementation) into our MainApplication.java but it has had no affect:

@Override
public void onCreate() {
	super.onCreate();
	SoLoader.init(this, /* native exopackage */ false);
	long size = 50L * 1024L * 1024L; // 50 MB
	com.facebook.react.modules.storage.ReactDatabaseSupplier.getInstance(getApplicationContext()).setMaximumSize(size);
}

I verified that the size increase was working by implementing a custom NativeModule which calls ReactDatabaseSupplier then getMaximumSize() to retrieve the size and send it across the bridge to JavaScript. When inside my app and calling getMaxSize() it successfully returns 50 MB:

@ReactMethod
public void getMaxSize(Callback successCallback) {
	Long maxDatabaseSize = com.facebook.react.modules.storage.ReactDatabaseSupplier.getInstance(reactContext).get().getMaximumSize();
	successCallback.invoke(maxDatabaseSize.doubleValue());
}

Does this look correct for verifying that size? Is this error unrelated to Android AsyncStorage size? Looking through the Sentry breadcrumbs this error always seems to occur after the user backgrounds & foregrounds the app following by low memory:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions