Problem with UNIQUE constraint failed

#1

When the store is open, it is show this error:
UNIQUE constraint failed: temp_fdroid_app.packageId, temp_fdroid_app.repoId (code 1555)

I did a ctrl + shift + F by temp_fdroid_app but not show nothing code.

What can be?

0 Likes

#2

This is a custom build of F-Droid? What did you change?

0 Likes

#3

Yes it is customized, I did a lot of changes.
But What is this issue?

0 Likes

#4

unique constraint come from SQL, those fields must be unique in the database

0 Likes

#5

Along with the above error, this error is also displayed: no such table: temp_update_db.temp_fdroid_app
I do not know what might be happening, any ideas?

0 Likes

#6

In this method:

private Map<String, Long> flushAppsToDbInBatch() throws RepoUpdater.UpdateException {
    ArrayList<ContentProviderOperation> appOperations = insertApps(appsToSave);

    try {
        context.getContentResolver().applyBatch(TempAppProvider.getAuthority(), appOperations);
        return getIdsForPackages(appsToSave);
    } catch (RemoteException | OperationApplicationException e) {
        throw new RepoUpdater.UpdateException(repo, "An internal error occurred while updating the database", e);
    }
}

In this line:
context.getContentResolver().applyBatch(TempAppProvider.getAuthority(), appOperations);

0 Likes

Mastodon