MuntashirAkon/AppManager · error · BackupException

Could not get data file

Error message

Could not get data file

What it means

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.

Solutions

  1. Verify the backup directory contains <propFile-name-without-extension>.tar and restore/re-create it if missing.
  2. Re-run the original backup app (OAndBackup) to regenerate a complete backup set before converting.
  3. 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).
  4. Delete stale/incomplete backup entries from the directory instead of converting them.

Example fix

// before
converter.convert(new File("/sdcard/AppManager/backup/incomplete.app"));
// after
File dir = new File("/sdcard/AppManager/backup/incomplete.app");
File tar = new File(dir, "incomplete.app.tar");
if (!tar.isFile()) throw new IllegalStateException("Data archive missing: " + tar);
converter.convert(dir);
Defensive patterns

Strategy: validation

Validate before calling

File dir = backupDir;
File tar = new File(dir, Paths.trimPathExtension(dir.getName()) + ".tar"); // mirror getDataFile naming
if (!tar.isFile()) throw new IllegalStateException("Data archive missing: " + tar);

Try / catch

try {
    converter.convert(backupDir);
} catch (BackupException e) {
    if (e.getCause() instanceof FileNotFoundException) {
        // skip or prompt re-backup
    } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

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/ce99b8a1f85e2f2f. Report an issue: GitHub.

Appendix: source

Thrown at app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/TBConverter.java:247

            baseApkFile.requireParent().delete();
        }
        // Overwrite with the new files
        try {
            sourceFiles = mBackupItem.encrypt(sourceFiles);
        } catch (IOException e) {
            throw new BackupException("Failed to encrypt " + Arrays.toString(sourceFiles));
        }
        for (Path file : sourceFiles) {
            mChecksum.add(file.getName(), DigestUtils.getHexDigest(mDestMetadata.info.checksumAlgo, file));
        }
    }

    private void backupData() throws BackupException {
        Path dataFile;
        try {
            dataFile = getDataFile(Paths.trimPathExtension(mPropFile.getName()), mSourceMetadata.tarType);
        } catch (FileNotFoundException e) {
            throw new BackupException("Could not get data file", e);
        }
        String tarType = mDestMetadata.info.tarType;
        int i = 0;
        String intBackupFilePrefix = null;
        String extBackupFilePrefix = null;
        if (mDestMetadata.info.flags.backupInternalData()) {
            intBackupFilePrefix = BackupUtils.getDataFilePrefix(i++, getExt(tarType));
        }
        if (mDestMetadata.info.flags.backupExternalData()) {
            extBackupFilePrefix = BackupUtils.getDataFilePrefix(i, getExt(tarType));
        }
        try (BufferedInputStream bis = new BufferedInputStream(dataFile.openInputStream())) {
            CompressorInputStream cis;
            if (TAR_GZIP.equals(mSourceMetadata.tarType)) {
                cis = new GzipCompressorInputStream(bis);
            } else if (TAR_BZIP2.equals(mSourceMetadata.tarType)) {
                cis = new BZip2CompressorInputStream(bis);
            } else {

View on GitHub (pinned to 0152f468fc)