{"record":{"id":"e9c6d7b72b9ffbf2","repo":"gchq/CyberChef","slug":"error-while-attempting-to-extract-detectedfile-f","errorCode":null,"errorMessage":"Error while attempting to extract ${detectedFile.fileDetails.name} at offset ${detectedFile.offset}:\\n${err.message}","messagePattern":"Error while attempting to extract (.+?) at offset (.+?):\\\\n(.+?)","errorType":"exception","errorClass":"OperationError","httpStatus":null,"severity":"warning","filePath":"src/core/operations/ExtractFiles.mjs","lineNumber":104,"sourceCode":"        const errors = [];\n        detectedFiles.forEach(detectedFile => {\n            try {\n                const file = extractFile(bytes, detectedFile.fileDetails, detectedFile.offset);\n                if (file.size >= minSize)\n                    files.push(file);\n            } catch (err) {\n                if (!ignoreFailedExtractions && err.message.indexOf(\"No extraction algorithm available\") < 0) {\n                    errors.push(\n                        `Error while attempting to extract ${detectedFile.fileDetails.name} ` +\n                        `at offset ${detectedFile.offset}:\\n` +\n                        `${err.message}`\n                    );\n                }\n            }\n        });\n\n        if (errors.length) {\n            throw new OperationError(errors.join(\"\\n\\n\"));\n        }\n\n        return files;\n    }\n\n\n    /**\n     * Displays the files in HTML for web apps.\n     *\n     * @param {File[]} files\n     * @returns {html}\n     */\n    async present(files) {\n        return await Utils.displayFilesAsHTML(files);\n    }\n\n}\n","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/gchq/CyberChef/blob/4290ea753912378913b1f3f54e0fc5720afeda5d/src/core/operations/ExtractFiles.mjs#L86-L122","documentation":"Thrown by the Extract Files operation when one or more file carving extractions fail and the 'Ignore failed extractions' option is disabled. The operation scans input for known file signatures and attempts extraction; failures are collected and surfaced as a combined error listing each failed file name and offset.","triggerScenarios":"run(input, args) where ignoreFailedExtractions (second-to-last arg) is false, and at least one detected file signature's extractFile() throws an error whose message does NOT contain 'No extraction algorithm available'. All such errors are accumulated and thrown at line 104.","commonSituations":"User unchecks 'Ignore failed extractions' and processes data containing partial/overlapping file signatures, corrupted embedded files, or false-positive signature matches that fail during extraction.","solutions":["Enable the 'Ignore failed extractions' option (default is true) to suppress non-fatal extraction errors.","Increase 'Minimum File Size' to filter out small false-positive signatures that fail extraction.","Inspect the error message for each offset to identify which embedded file is problematic.","Provide cleaner input data without truncated or overlapping embedded files."],"exampleFix":"// before: args 'Ignore failed extractions' = false\n// extraction of a corrupted ZIP at offset 0x100 fails -> error\n\n// after: set 'Ignore failed extractions' = true\n// failed extractions are silently skipped, valid files returned","handlingStrategy":"validation","validationCode":"// Enable 'Ignore failed extractions' to suppress non-fatal carving errors\nconst args = [...categories, true /* ignoreFailed */, 100 /* minSize */];","typeGuard":null,"tryCatchPattern":"try {\n  const files = chef.extractFiles(input, args);\n} catch (e) {\n  if (e.message.includes('Error while attempting to extract')) {\n    // Toggle ignoreFailedExtractions or increase minSize and retry\n  } else throw e;\n}","preventionTips":["Keep 'Ignore failed extractions' enabled (the default) unless debugging.","Set a reasonable Minimum File Size to filter false positives.","Inspect which offsets fail to identify problematic embedded files."],"tags":["file-carving","forensics","extraction","config"],"backgroundTag":null,"analyzedSha":"4290ea753912378913b1f3f54e0fc5720afeda5d","analyzedAt":"2026-08-13T06:05:50.210Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}