{"record":{"id":"31723243769cd342","repo":"MuntashirAkon/AppManager","slug":"no-data-files-at-index-i","errorCode":null,"errorMessage":"No data files at index \" + i + \".","messagePattern":"No data files at index \" \\+ i \\+ \"\\.","errorType":"exception","errorClass":"BackupException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/backup/VerifyOp.java","lineNumber":181,"sourceCode":"        String checksum;\n        for (Path file : keyStoreFiles) {\n            checksum = DigestUtils.getHexDigest(mBackupInfo.checksumAlgo, file);\n            if (!checksum.equals(mChecksum.get(file.getName()))) {\n                throw new BackupException(\"Could not verify KeyStore files.\" +\n                        \"\\nFile: \" + file.getName() +\n                        \"\\nFound: \" + checksum +\n                        \"\\nRequired: \" + mChecksum.get(file.getName()));\n            }\n        }\n    }\n\n    private void verifyData() throws BackupException {\n        Path[] dataFiles;\n        String checksum;\n        for (int i = 0; i < mBackupMetadata.dataDirs.length; ++i) {\n            dataFiles = mBackupItem.getDataFiles(i);\n            if (dataFiles.length == 0) {\n                throw new BackupException(\"No data files at index \" + i + \".\");\n            }\n            for (Path file : dataFiles) {\n                checksum = DigestUtils.getHexDigest(mBackupInfo.checksumAlgo, file);\n                if (!checksum.equals(mChecksum.get(file.getName()))) {\n                    throw new BackupException(\"Could not verify data files at index \" + i + \".\" +\n                            \"\\nFile: \" + file.getName() +\n                            \"\\nFound: \" + checksum +\n                            \"\\nRequired: \" + mChecksum.get(file.getName()));\n                }\n            }\n        }\n    }\n\n    private void verifyExtras() throws BackupException {\n        Path miscFile;\n        try {\n            miscFile = mBackupItem.getMiscFile();\n        } catch (IOException ignore) {","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/backup/VerifyOp.java#L163-L199","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Copy the missing data files for the index named in the message from the original backup location.","Recreate the backup ensuring the copy completes for all data directories.","Unset the data flag (BackupFlags.backupData) if you intend an APK-only restore, so verifyData() is skipped."],"exampleFix":"// before\n//   No data files at index 1.\n// after: ensure full backup dir copied, e.g.\n// $ adb pull /sdcard/AppManager/backups/com.example/ ./com.example/  # includes all data* files","handlingStrategy":"validation","validationCode":"// Ensure every declared dataDir has files before verify\nfor (int i = 0; i < metadata.dataDirs.length; i++) {\n    if (backupItem.getDataFiles(i).length == 0) {\n        throw new IllegalStateException(\"backup incomplete: no data files for dir index \" + i);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    verifyOp.verify();\n} catch (BackupException e) {\n    if (e.getMessage().startsWith(\"No data files at index\")) {\n        // re-copy the missing data part or disable the data flag\n    }\n}","preventionTips":["After a backup, copy every data part (data0, data1, ...) — check counts against metadata.dataDirs.length.","Avoid deleting 'large' files from backup dirs to save space; they may be data archives.","Interrupted backups should be discarded and re-created, not partially copied.","Confirm file counts after moving backups across devices."],"tags":["backup","data","missing-files"],"backgroundTag":"file-not-found","analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}