MuntashirAkon/AppManager · error · BackupException

Backup failed for

Error message

Backup failed for 

What it means

OABConverter.backupData wraps any IOException raised during the per-data-file backup pipeline (zip extraction, tar creation, splitting, checksum, encryption) into BackupException('Backup failed for <dataFile>'). It marks which source data file the pipeline failed on; the cause holds the real error.

Source

Thrown at app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/OABConverter.java:374

                        if (tmpFile != null) {
                            // Copy from the temporary file
                            try (FileInputStream fis = new FileInputStream(tmpFile)) {
                                IoUtils.copy(fis, tos);
                            } finally {
                                FileCache.getGlobalFileCache().delete(tmpFile);
                            }
                        }
                        tos.closeArchiveEntry();
                    }
                    tos.finish();
                }
                // Encrypt backups
                Path[] newBackupFiles = mBackupItem.encrypt(sos.getFiles().toArray(new Path[0]));
                for (Path file : newBackupFiles) {
                    mChecksum.add(file.getName(), DigestUtils.getHexDigest(mDestMetadata.info.checksumAlgo, file));
                }
            } catch (IOException e) {
                throw new BackupException("Backup failed for " + dataFile, e);
            }
        }
    }
}

View on GitHub (pinned to 0152f468fc)

Solutions

  1. Free up storage space in the destination backup location
  2. Check the cause stack trace to identify which pipeline stage (zip read, tar write, encrypt) failed
  3. Verify the destination path is writable and the storage is mounted
  4. Retry conversion after replacing a corrupted source data file
Defensive patterns

Strategy: try-catch

Validate before calling

// preflight before conversion
if (new File(mBackupItem.getUnencryptedBackupPath()).getUsableSpace() < requiredBytes) {
    throw new IOException("Not enough free space for backup");
}

Try / catch

try {
    converter.convert(...);
} catch (BackupException e) {
    Throwable cause = e.getCause();
    if (cause instanceof IOException && cause.getMessage() != null && cause.getMessage().contains("No space")) {
        // free storage and retry
    }
}

Prevention

When it happens

Trigger: Any IOException while streaming the decrypted APK through ZipInputStream into a (possibly compressed, split) tar output, computing checksums, or encrypting the produced backup files via mBackupItem.encrypt.

Common situations: Insufficient free space in the backup directory triggering split/write failures; corrupted source zip streams; destination storage unmounted or full; encryption key issues surfacing as IO errors.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


AI-assisted analysis of MuntashirAkon/AppManager@0152f468fc (2026-09-12). Data as JSON: /api/errors/9a4009ee741bf788. Report an issue: GitHub.