{"record":{"id":"16d8f98323f8c7c0","repo":"MuntashirAkon/AppManager","slug":"failed-to-create-checksum-file-sbconverter","errorCode":null,"errorMessage":"Failed to create checksum file.","messagePattern":"Failed to create checksum file\\.","errorType":"exception","errorClass":"BackupException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/SBConverter.java","lineNumber":117,"sourceCode":"        BackupMetadataV2 sourceMetadata = generateMetadata();\n        // Simulate a backup creation\n        try {\n            mBackupItem = BackupItems.createBackupItemGracefully(mUserId, \"SB\", mPackageName);\n        } catch (IOException e) {\n            throw new BackupException(\"Could not get backup files.\", e);\n        }\n        boolean backupSuccess = false;\n        try {\n            try {\n                // Destination metadata\n                mDestMetadata = ConvertUtils.getV5Metadata(sourceMetadata, mBackupItem);\n            } catch (CryptoException e) {\n                throw new BackupException(\"Failed to get crypto \" + mDestMetadata.info.crypto, e);\n            }\n            try {\n                mChecksum = mBackupItem.getChecksum();\n            } catch (IOException e) {\n                throw new BackupException(\"Failed to create checksum file.\", e);\n            }\n            // Backup icon\n            backupIcon();\n            if (mDestMetadata.info.flags.backupApkFiles()) {\n                backupApkFile();\n            }\n            if (mDestMetadata.info.flags.backupData()) {\n                backupData();\n            }\n            // Write modified metadata\n            try {\n                Map<String, String> filenameChecksumMap = MetadataManager.writeMetadata(mDestMetadata, mBackupItem);\n                for (Map.Entry<String, String> filenameChecksumPair : filenameChecksumMap.entrySet()) {\n                    mChecksum.add(filenameChecksumPair.getKey(), filenameChecksumPair.getValue());\n                }\n            } catch (IOException e) {\n                throw new BackupException(\"Failed to write metadata.\");\n            }","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/SBConverter.java#L99-L135","documentation":"SBConverter.convert throws BackupException('Failed to create checksum file.') when mBackupItem.getChecksum() throws IOException, meaning the checksums.txt file for the destination backup could not be created/opened. Checksum tracking is mandatory for a valid backup, so conversion aborts.","triggerScenarios":"BackupItem.getChecksum() fails opening/creating the checksum file: unwritable backup directory, full storage, or file handle/I/O errors.","commonSituations":"Read-only or full destination storage; Android scoped-storage permission issues; leftover stale checksum files blocking creation.","solutions":["Ensure the backup destination is writable and has free space","Check the wrapped IOException cause for the exact filesystem error","Clear stale files in the in-progress backup directory and retry","Verify storage permissions (scoped storage) for the app"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"File dir = new File(mBackupItem.getBackupPath());\nif (!dir.canWrite() || dir.getUsableSpace() < MIN_FREE_BYTES) {\n    throw new IOException(\"Cannot create checksum file: destination unwritable or full\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    converter.convert(...);\n} catch (BackupException e) {\n    if (\"Failed to create checksum file.\".equals(e.getMessage())) {\n        // check storage/permissions and retry\n    }\n}","preventionTips":["Check free space before conversion","Clear stale in-progress backup directories","Request and verify storage permissions"],"tags":["android","backup","checksum","io"],"backgroundTag":"file-write-failed","analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}