{"record":{"id":"5b0d2c919e7e9ce7","repo":"tonhowtf/omniget","slug":"n-o-foi-poss-vel-abrir-o-zip","errorCode":null,"errorMessage":"não foi possível abrir o zip: {}","messagePattern":"não foi possível abrir o zip: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/reddit/gdpr.rs","lineNumber":262,"sourceCode":"                }\n            }\n        }\n        if out.is_empty() {\n            return Err(anyhow!(\n                \"nenhum .csv nesta pasta — aponte para a pasta do export ou para o zip\"\n            ));\n        }\n        return Ok(out);\n    }\n    let lower = path.to_string_lossy().to_ascii_lowercase();\n    if !lower.ends_with(\".zip\") {\n        return Err(anyhow!(\n            \"escolha o zip do export do Reddit ou a pasta onde ele foi descompactado\"\n        ));\n    }\n    let file = std::fs::File::open(path)?;\n    let mut zip =\n        zip::ZipArchive::new(file).map_err(|e| anyhow!(\"não foi possível abrir o zip: {}\", e))?;\n    for i in 0..zip.len() {\n        let mut entry = match zip.by_index(i) {\n            Ok(e) => e,\n            Err(_) => continue,\n        };\n        if !entry.is_file() || !is_csv(entry.name()) {\n            continue;\n        }\n        let name = short_name(entry.name());\n        let mut buf = Vec::new();\n        if entry.read_to_end(&mut buf).is_ok() {\n            out.insert(name, String::from_utf8_lossy(&buf).to_string());\n        }\n    }\n    if out.is_empty() {\n        return Err(anyhow!(\"este zip não tem nenhum .csv do export do Reddit\"));\n    }\n    Ok(out)","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/reddit/gdpr.rs#L244-L280","documentation":"The path was a .zip but zip::ZipArchive::new failed, so the archive cannot be opened or indexed. The underlying zip error is embedded in the message (e.g. invalid archive, unsupported compression, I/O error).","triggerScenarios":"File::open succeeded but the bytes are not a valid zip: truncated/corrupt download, HTML error page saved as .zip, unsupported zip variant, or empty file.","commonSituations":"Interrupted download of the export; browser saved a login/error page with a .zip name; disk full or antivirus quarantining content; wrong file renamed to .zip.","solutions":["Read the embedded {} detail to identify the specific zip error","Re-download the GDPR export from Reddit and verify the file size/checksum","Open the zip with `unzip -t file.zip` to confirm integrity","Ensure the file is not 0 bytes or an HTML page (`file export.zip`)"],"exampleFix":"// before\npath: \"export.zip\"  // 0-byte truncated download\n// after\n# re-download, verify, then\npath: \"export.zip\"  # valid, unzip -t passes","handlingStrategy":"validation","validationCode":"fn zip_is_valid(path: &str) -> bool {\n    std::fs::File::open(path)\n        .map(|f| zip::ZipArchive::new(f).is_ok())\n        .unwrap_or(false)\n}\n// assert!(zip_is_valid(\"export.zip\"), \"corrupt or truncated zip\");","typeGuard":null,"tryCatchPattern":"match run(opts).await {\n    Err(e) if e.to_string().starts_with(\"não foi possível abrir o zip\") => {\n        // surface the embedded zip error; prompt user to re-download the export\n    }\n    other => other?,\n}","preventionTips":["Verify export zip integrity (size, `unzip -t`) after downloading","Watch for browsers saving HTML error pages with .zip names — check with `file`","Re-download if the transfer was interrupted"],"tags":["reddit","gdpr-export","zip","corrupt-archive"],"backgroundTag":"file-open-failed","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}