{"record":{"id":"5e353fb870355236","repo":"MuntashirAkon/AppManager","slug":"couldn-t-get-misc-am-tsv","errorCode":null,"errorMessage":"Couldn't get misc.am.tsv","messagePattern":"Couldn't get misc\\.am\\.tsv","errorType":"exception","errorClass":"BackupException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/backup/BackupOp.java","lineNumber":459,"sourceCode":"            }\n        }\n        try {\n            backedUpKeyStoreFiles = mBackupItem.encrypt(backedUpKeyStoreFiles);\n        } catch (IOException e) {\n            throw new BackupException(\"Failed to encrypt \" + Arrays.toString(backedUpKeyStoreFiles), e);\n        }\n        for (Path file : backedUpKeyStoreFiles) {\n            mChecksum.add(file.getName(), DigestUtils.getHexDigest(mMetadata.info.checksumAlgo, file));\n        }\n    }\n\n    private void backupExtras() throws BackupException {\n        PseudoRules rules = new PseudoRules(mPackageName, mUserId);\n        Path miscFile;\n        try {\n            miscFile = mBackupItem.getMiscFile();\n        } catch (IOException e) {\n            throw new BackupException(\"Couldn't get misc.am.tsv\", e);\n        }\n        // Backup permissions\n        @NonNull String[] permissions = ArrayUtils.defeatNullable(mPackageInfo.requestedPermissions);\n        int[] permissionFlags = ArrayUtils.defeatNullable(mPackageInfo.requestedPermissionsFlags);\n        List<AppOpsManagerCompat.OpEntry> opEntries = new ArrayList<>();\n        try {\n            List<AppOpsManagerCompat.PackageOps> packageOpsList = new AppOpsManagerCompat()\n                    .getOpsForPackage(mApplicationInfo.uid, mPackageName, null);\n            if (packageOpsList.size() == 1) opEntries.addAll(packageOpsList.get(0).getOps());\n        } catch (Exception ignore) {\n        }\n        PermissionInfo info;\n        int basePermissionType;\n        int protectionLevels;\n        for (int i = 0; i < permissions.length; ++i) {\n            try {\n                info = mPm.getPermissionInfo(permissions[i], 0);\n                basePermissionType = PermissionInfoCompat.getProtection(info);","sourceCodeStart":441,"sourceCodeEnd":477,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/backup/BackupOp.java#L441-L477","documentation":"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.","triggerScenarios":"mBackupItem.getMiscFile() throws IOException — typically because the unencrypted backup directory does not exist or cannot be created (mkdir failure) for the target package/user.","commonSituations":"Backup destination removed mid-operation; storage permission missing; backup directory path invalid for the selected user; read-only filesystem.","solutions":["Check the chained IOException for the real path/mkdir error","Ensure the backup directory exists and is writable before starting the backup","Verify storage permissions for the backup location","Retry the backup after confirming the destination path is valid for the user id"],"exampleFix":"// before\nmiscFile = mBackupItem.getMiscFile();\n// after\ntry {\n    miscFile = mBackupItem.getMiscFile();\n} catch (IOException e) {\n    Log.e(TAG, \"Cannot create/access backup dir for \" + mPackageName, e);\n    throw e; // or degrade: skip extras and continue backup\n}","handlingStrategy":"try-catch","validationCode":"File backupDir = new File(mBackupItem.getUnencryptedBackupPath());\nif (!backupDir.exists() && !backupDir.mkdirs())\n    throw new IllegalStateException(\"cannot create backup dir \" + backupDir);","typeGuard":"static boolean isWritableDir(Path p) {\n    return p != null && Files.isDirectory(p) && Files.isWritable(p);\n}","tryCatchPattern":"try {\n    miscFile = mBackupItem.getMiscFile();\n} catch (IOException e) {\n    Log.e(TAG, \"misc.am.tsv unavailable\", e);\n    // degrade: skip extras or abort per policy\n}","preventionTips":["Ensure the backup destination directory exists and is writable before the op","Verify storage permissions","Keep the device storage from filling mid-backup"],"tags":["backup","io","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"}