{"record":{"id":"ce99b8a1f85e2f2f","repo":"MuntashirAkon/AppManager","slug":"could-not-get-data-file","errorCode":null,"errorMessage":"Could not get data file","messagePattern":"Could not get data file","errorType":"exception","errorClass":"BackupException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/TBConverter.java","lineNumber":247,"sourceCode":"            baseApkFile.requireParent().delete();\n        }\n        // Overwrite with the new files\n        try {\n            sourceFiles = mBackupItem.encrypt(sourceFiles);\n        } catch (IOException e) {\n            throw new BackupException(\"Failed to encrypt \" + Arrays.toString(sourceFiles));\n        }\n        for (Path file : sourceFiles) {\n            mChecksum.add(file.getName(), DigestUtils.getHexDigest(mDestMetadata.info.checksumAlgo, file));\n        }\n    }\n\n    private void backupData() throws BackupException {\n        Path dataFile;\n        try {\n            dataFile = getDataFile(Paths.trimPathExtension(mPropFile.getName()), mSourceMetadata.tarType);\n        } catch (FileNotFoundException e) {\n            throw new BackupException(\"Could not get data file\", e);\n        }\n        String tarType = mDestMetadata.info.tarType;\n        int i = 0;\n        String intBackupFilePrefix = null;\n        String extBackupFilePrefix = null;\n        if (mDestMetadata.info.flags.backupInternalData()) {\n            intBackupFilePrefix = BackupUtils.getDataFilePrefix(i++, getExt(tarType));\n        }\n        if (mDestMetadata.info.flags.backupExternalData()) {\n            extBackupFilePrefix = BackupUtils.getDataFilePrefix(i, getExt(tarType));\n        }\n        try (BufferedInputStream bis = new BufferedInputStream(dataFile.openInputStream())) {\n            CompressorInputStream cis;\n            if (TAR_GZIP.equals(mSourceMetadata.tarType)) {\n                cis = new GzipCompressorInputStream(bis);\n            } else if (TAR_BZIP2.equals(mSourceMetadata.tarType)) {\n                cis = new BZip2CompressorInputStream(bis);\n            } else {","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/TBConverter.java#L229-L265","documentation":"TBConverter.backupData() calls getDataFile() to locate the source .tar data file for an OAndBackup-style backup; if the file cannot be found, the FileNotFoundException is rethrown as a BackupException with this message. It means the backup directory is missing the tar data archive that the .prop file describes. The conversion cannot proceed without it.","triggerScenarios":"Calling TBConverter.convert() on a backup whose <name>.tar data file (per getDataFile(prefix, tarType)) does not exist in the backup directory, causing getDataFile to throw FileNotFoundException.","commonSituations":"Incomplete/partial backup directories where the prop file was written but the tar data failed to save or was deleted; a renamed or trimmed prefix mismatch; pointing the converter at a metadata-only directory; restoring backups copied from another device without the large data archives.","solutions":["Verify the backup directory contains <propFile-name-without-extension>.tar and restore/re-create it if missing.","Re-run the original backup app (OAndBackup) to regenerate a complete backup set before converting.","Check the prop file's name vs the data file prefix: getDataFile uses Paths.trimPathExtension(mPropFile.getName()), so filenames must match exactly (case-sensitive on Linux).","Delete stale/incomplete backup entries from the directory instead of converting them."],"exampleFix":"// before\nconverter.convert(new File(\"/sdcard/AppManager/backup/incomplete.app\"));\n// after\nFile dir = new File(\"/sdcard/AppManager/backup/incomplete.app\");\nFile tar = new File(dir, \"incomplete.app.tar\");\nif (!tar.isFile()) throw new IllegalStateException(\"Data archive missing: \" + tar);\nconverter.convert(dir);","handlingStrategy":"validation","validationCode":"File dir = backupDir;\nFile tar = new File(dir, Paths.trimPathExtension(dir.getName()) + \".tar\"); // mirror getDataFile naming\nif (!tar.isFile()) throw new IllegalStateException(\"Data archive missing: \" + tar);","typeGuard":null,"tryCatchPattern":"try {\n    converter.convert(backupDir);\n} catch (BackupException e) {\n    if (e.getCause() instanceof FileNotFoundException) {\n        // skip or prompt re-backup\n    } else throw e;\n}","preventionTips":["Always copy complete backup sets (prop + tar + icons), never the prop alone.","Keep prop file name and tar prefix identical; Linux is case-sensitive.","Re-run the source backup app after any interrupted backup before converting."],"tags":["android","backup","file-not-found"],"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"}