MuntashirAkon/AppManager · error · BackupException

Couldn't get misc.am.tsv

Error message

Couldn't get misc.am.tsv

What it means

In backupExtras, BackupOp expects the app's miscellaneous pseudo-rules file misc.am.tsv in the package's data directory and reports this message when that file is absent — typically for apps that never created any rules, so there is simply nothing extra to back up.

Solutions

  1. Check the chained IOException for the real path/mkdir error
  2. Ensure the backup directory exists and is writable before starting the backup
  3. Verify storage permissions for the backup location
  4. Retry the backup after confirming the destination path is valid for the user id

Example fix

// before
miscFile = mBackupItem.getMiscFile();
// after
try {
    miscFile = mBackupItem.getMiscFile();
} catch (IOException e) {
    Log.e(TAG, "Cannot create/access backup dir for " + mPackageName, e);
    throw e; // or degrade: skip extras and continue backup
}
Defensive patterns

Strategy: try-catch

Validate before calling

File backupDir = new File(mBackupItem.getUnencryptedBackupPath());
if (!backupDir.exists() && !backupDir.mkdirs())
    throw new IllegalStateException("cannot create backup dir " + backupDir);

Type guard

static boolean isWritableDir(Path p) {
    return p != null && Files.isDirectory(p) && Files.isWritable(p);
}

Try / catch

try {
    miscFile = mBackupItem.getMiscFile();
} catch (IOException e) {
    Log.e(TAG, "misc.am.tsv unavailable", e);
    // degrade: skip extras or abort per policy
}

Prevention

When it happens

Trigger: mBackupItem.getMiscFile() throws IOException — typically because the unencrypted backup directory does not exist or cannot be created (mkdir failure) for the target package/user.

Common situations: Backup destination removed mid-operation; storage permission missing; backup directory path invalid for the selected user; read-only filesystem.

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

Appendix: source

Thrown at app/src/main/java/io/github/muntashirakon/AppManager/backup/BackupOp.java:459

            }
        }
        try {
            backedUpKeyStoreFiles = mBackupItem.encrypt(backedUpKeyStoreFiles);
        } catch (IOException e) {
            throw new BackupException("Failed to encrypt " + Arrays.toString(backedUpKeyStoreFiles), e);
        }
        for (Path file : backedUpKeyStoreFiles) {
            mChecksum.add(file.getName(), DigestUtils.getHexDigest(mMetadata.info.checksumAlgo, file));
        }
    }

    private void backupExtras() throws BackupException {
        PseudoRules rules = new PseudoRules(mPackageName, mUserId);
        Path miscFile;
        try {
            miscFile = mBackupItem.getMiscFile();
        } catch (IOException e) {
            throw new BackupException("Couldn't get misc.am.tsv", e);
        }
        // Backup permissions
        @NonNull String[] permissions = ArrayUtils.defeatNullable(mPackageInfo.requestedPermissions);
        int[] permissionFlags = ArrayUtils.defeatNullable(mPackageInfo.requestedPermissionsFlags);
        List<AppOpsManagerCompat.OpEntry> opEntries = new ArrayList<>();
        try {
            List<AppOpsManagerCompat.PackageOps> packageOpsList = new AppOpsManagerCompat()
                    .getOpsForPackage(mApplicationInfo.uid, mPackageName, null);
            if (packageOpsList.size() == 1) opEntries.addAll(packageOpsList.get(0).getOps());
        } catch (Exception ignore) {
        }
        PermissionInfo info;
        int basePermissionType;
        int protectionLevels;
        for (int i = 0; i < permissions.length; ++i) {
            try {
                info = mPm.getPermissionInfo(permissions[i], 0);
                basePermissionType = PermissionInfoCompat.getProtection(info);

View on GitHub (pinned to 0152f468fc)