{"record":{"id":"a629dc7fac60f68b","repo":"a-b-street/abstreet","slug":"compressed-not-there","errorCode":null,"errorMessage":"Compressed {} not there?","messagePattern":"Compressed (.+?) not there\\?","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"updater/src/main.rs","lineNumber":225,"sourceCode":"            rm(&format!(\"{}/{}.gz\", remote_base, path));\n        }\n    }\n\n    // Anything missing or needing updating?\n    let local_entries = std::mem::take(&mut local.entries);\n    for (path, entry) in Timer::new(\"compress files\").parallelize(\n        \"compress files\",\n        local_entries.into_iter().collect(),\n        |(path, mut entry)| {\n            let remote_path = format!(\"{}/{}.gz\", remote_base, path);\n            let changed = remote.entries.get(&path).map(|x| &x.checksum) != Some(&entry.checksum);\n            if changed {\n                compress(&path, &remote_path);\n            }\n            // Always do this -- even if nothing changed, compressed_size_bytes isn't filled out by\n            // generate_manifest.\n            entry.compressed_size_bytes = fs_err::metadata(&remote_path)\n                .unwrap_or_else(|_| panic!(\"Compressed {} not there?\", remote_path))\n                .len();\n            (path, entry)\n        },\n    ) {\n        local.entries.insert(path, entry);\n    }\n\n    abstio::write_json(format!(\"{}/MANIFEST.json\", remote_base), &local);\n    abstio::write_json(\"data/MANIFEST.json\".to_string(), &local);\n\n    must_run_cmd(\n        Command::new(\"aws\")\n            .arg(\"s3\")\n            .arg(\"sync\")\n            .arg(\"--delete\")\n            .arg(format!(\"{}/data\", remote_base))\n            .arg(format!(\"s3://abstreet/{}/data\", version)),\n    );","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/a-b-street/abstreet/blob/0964f29315820c91b171b585eb51e300164e9197/updater/src/main.rs#L207-L243","documentation":"After compressing a changed file to a remote path (.gz), the updater reads the compressed file's metadata to record compressed_size_bytes. If the .gz file doesn't exist at that point, it panics — an internal inconsistency, since compress should have just created it.","triggerScenarios":"During upload, fs_err::metadata on `{remote_base}/{path}.gz` fails right after compress() was invoked for a changed file.","commonSituations":"compress() silently failing (bad permissions, full disk, remote path misconfigured so the .gz lands elsewhere); race with another process cleaning the output directory.","solutions":["Verify compress() succeeded and wrote to the expected remote_path before reading metadata","Check disk space and write permissions for the remote/compressed output location","Log the underlying io error instead of discarding it to locate the real cause"],"exampleFix":"// before\n.unwrap_or_else(|_| panic!(\"Compressed {} not there?\", remote_path))\n// after\n.unwrap_or_else(|e| panic!(\"Compressed {} not there? {}: {}\", remote_path, e, std::backtrace::Backtrace::force_capture()))","handlingStrategy":"validation","validationCode":"if !std::path::Path::new(&remote_path).exists() {\n    panic!(\"compress failed to produce {}\", remote_path);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check compress() return/propagate its errors","Monitor disk space and write permissions in upload environments","Verify remote_base path configuration"],"tags":["rust","panic","compression","file-io"],"backgroundTag":"file-not-found","analyzedSha":"0964f29315820c91b171b585eb51e300164e9197","analyzedAt":"2026-09-13T18:02:03.421Z","contentChangedAt":"2026-09-13T18:02:03.421Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}