{"record":{"id":"2dfbee0a7c16aec7","repo":"MuntashirAkon/AppManager","slug":"could-not-get-data-files","errorCode":null,"errorMessage":"Could not get data files","messagePattern":"Could not get data files","errorType":"exception","errorClass":"BackupException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/SBConverter.java","lineNumber":214,"sourceCode":"        for (Path file : sourceFiles) {\n            mChecksum.add(file.getName(), DigestUtils.getHexDigest(mDestMetadata.info.checksumAlgo, file));\n        }\n    }\n\n    private void backupData() throws BackupException {\n        List<Path> dataFiles = new ArrayList<>(3);\n        try {\n            if (mDestMetadata.info.flags.backupInternalData()) {\n                dataFiles.add(getIntDataFile());\n            }\n            if (mDestMetadata.info.flags.backupExternalData()) {\n                dataFiles.add(getExtDataFile());\n            }\n            if (mDestMetadata.info.flags.backupMediaObb()) {\n                dataFiles.add(getObbFile());\n            }\n        } catch (FileNotFoundException e) {\n            throw new BackupException(\"Could not get data files\", e);\n        }\n        String tarType = mDestMetadata.info.tarType;\n        int i = 0;\n        for (Path dataFile : dataFiles) {\n            String dataBackupFilePrefix = BackupUtils.getDataFilePrefix(i++, getExt(tarType));\n            try (ZipInputStream zis = new ZipInputStream(new BufferedInputStream(dataFile.openInputStream()));\n                 SplitOutputStream sos = new SplitOutputStream(mBackupItem.getUnencryptedBackupPath(), dataBackupFilePrefix, DEFAULT_SPLIT_SIZE);\n                 BufferedOutputStream bos = new BufferedOutputStream(sos);\n                 OutputStream os = TarUtils.createCompressedStream(bos, tarType)) {\n                // TODO: 31/5/21 Check backup format (each zip file has a comment section which can be parsed as JSON)\n                try (TarArchiveOutputStream tos = new TarArchiveOutputStream(os)) {\n                    tos.setLongFileMode(TarArchiveOutputStream.LONGFILE_POSIX);\n                    tos.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX);\n                    ZipEntry zipEntry;\n                    while ((zipEntry = zis.getNextEntry()) != null) {\n                        File tmpFile = null;\n                        if (!zipEntry.isDirectory()) {\n                            // We need to use a temporary file","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/SBConverter.java#L196-L232","documentation":"Thrown by SBConverter.backupData when opening the source data zip files (internal data, external data, or OBB) throws FileNotFoundException. Only the files matching the enabled backup flags are opened, so the error names whichever data zip was requested but does not exist.","triggerScenarios":"convert() with backupInternalData/backupExternalData/backupMediaObb flags set while the corresponding Swift Backup source zip (app data, external data, or OBB archive) is absent from the source folder; a data-only conversion of a source that never had data backed up.","commonSituations":"User enabled 'backup external data' for a converted backup whose original Swift Backup only captured internal data; source folder trimmed or partially restored; OBB archive missing because the app has no OBB files but the flag was enabled anyway.","solutions":["Disable flags in destination metadata for data types that don't exist in the source (backupExternalData / backupMediaObb / backupInternalData as applicable).","Verify the source Swift Backup folder actually contains the data zip files expected by getIntDataFile/getExtDataFile/getObbFile.","Re-export or re-copy the original Swift Backup archive if files are missing.","Inspect the FileNotFoundException message to learn which specific data file path was missing."],"exampleFix":"// before: enable all data flags unconditionally\nmetadata.info.flags.backupExternalData = true;\n// after: enable only when the source archive exists\nmetadata.info.flags.backupExternalData =\n    new File(sourceDir, \"ext_data.zip\").isFile();","handlingStrategy":"validation","validationCode":"if (flags.backupInternalData && !new File(sourceDir, \"data.zip\").isFile())\n    flags.backupInternalData = false;\nif (flags.backupExternalData && !new File(sourceDir, \"ext_data.zip\").isFile())\n    flags.backupExternalData = false;\nif (flags.backupMediaObb && !new File(sourceDir, \"obb.zip\").isFile())\n    flags.backupMediaObb = false;","typeGuard":null,"tryCatchPattern":"try { converter.convert(); }\ncatch (BackupException e) {\n    if (e.getCause() instanceof FileNotFoundException) {\n        // disable the missing data flag and retry\n    }\n}","preventionTips":["Match backup flags to what the source archive actually contains","Inspect the source folder contents before enabling data flags","Re-export incomplete Swift Backup archives","Read the FileNotFoundException cause to identify the missing file"],"tags":["android","backup","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"}