MuntashirAkon/AppManager · error · BackupException

No data files at index " + i + ".

Error message

No data files at index " + i + ".

What it means

verifyData() iterates mBackupMetadata.dataDirs (each backed-up data directory index) and finds that mBackupItem.getDataFiles(i) returns an empty array for index i — the data directory is declared in metadata but contains no data files in the backup. The backup is incomplete, so verification fails.

Solutions

  1. Copy the missing data files for the index named in the message from the original backup location.
  2. Recreate the backup ensuring the copy completes for all data directories.
  3. Unset the data flag (BackupFlags.backupData) if you intend an APK-only restore, so verifyData() is skipped.

Example fix

// before
//   No data files at index 1.
// after: ensure full backup dir copied, e.g.
// $ adb pull /sdcard/AppManager/backups/com.example/ ./com.example/  # includes all data* files
Defensive patterns

Strategy: validation

Validate before calling

// Ensure every declared dataDir has files before verify
for (int i = 0; i < metadata.dataDirs.length; i++) {
    if (backupItem.getDataFiles(i).length == 0) {
        throw new IllegalStateException("backup incomplete: no data files for dir index " + i);
    }
}

Try / catch

try {
    verifyOp.verify();
} catch (BackupException e) {
    if (e.getMessage().startsWith("No data files at index")) {
        // re-copy the missing data part or disable the data flag
    }
}

Prevention

When it happens

Trigger: verify() -> verifyData() when mBackupFlags.backupData() is set; for any i in 0..dataDirs.length-1, mBackupItem.getDataFiles(i).length == 0 — i.e. no archive/chunk files present for that data directory (e.g. missing .tar.gz data split parts).

Common situations: Only part of a multi-part data backup was copied (e.g. data 0 copied, data 1 lost); user deleted large data archives to save space; backup was interrupted and one dataDir never got written; moving the backup across devices dropped files with unusual names.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of MuntashirAkon/AppManager@0152f468fc (2026-09-12). Data as JSON: /api/errors/31723243769cd342. Report an issue: GitHub.

Appendix: source

Thrown at app/src/main/java/io/github/muntashirakon/AppManager/backup/VerifyOp.java:181

        String checksum;
        for (Path file : keyStoreFiles) {
            checksum = DigestUtils.getHexDigest(mBackupInfo.checksumAlgo, file);
            if (!checksum.equals(mChecksum.get(file.getName()))) {
                throw new BackupException("Could not verify KeyStore files." +
                        "\nFile: " + file.getName() +
                        "\nFound: " + checksum +
                        "\nRequired: " + mChecksum.get(file.getName()));
            }
        }
    }

    private void verifyData() throws BackupException {
        Path[] dataFiles;
        String checksum;
        for (int i = 0; i < mBackupMetadata.dataDirs.length; ++i) {
            dataFiles = mBackupItem.getDataFiles(i);
            if (dataFiles.length == 0) {
                throw new BackupException("No data files at index " + i + ".");
            }
            for (Path file : dataFiles) {
                checksum = DigestUtils.getHexDigest(mBackupInfo.checksumAlgo, file);
                if (!checksum.equals(mChecksum.get(file.getName()))) {
                    throw new BackupException("Could not verify data files at index " + i + "." +
                            "\nFile: " + file.getName() +
                            "\nFound: " + checksum +
                            "\nRequired: " + mChecksum.get(file.getName()));
                }
            }
        }
    }

    private void verifyExtras() throws BackupException {
        Path miscFile;
        try {
            miscFile = mBackupItem.getMiscFile();
        } catch (IOException ignore) {

View on GitHub (pinned to 0152f468fc)