{"record":{"id":"e011675e680bc496","repo":"tonhowtf/omniget","slug":"e","errorCode":null,"errorMessage":"e","messagePattern":"e","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/instagram/publish.rs","lineNumber":450,"sourceCode":"            ));\n            // O Instagram pode ainda estar transcodificando: tenta algumas vezes.\n            let mut last = None;\n            for attempt in 0..6 {\n                match client\n                    .post_form(\"/api/v1/media/configure_to_clips/?video=1\", &form)\n                    .await\n                {\n                    Ok(json) if s(&json, \"status\") == \"ok\" => {\n                        report(\"done\", 3, 3);\n                        return Ok(result_of(&json));\n                    }\n                    Ok(json) => last = Some(anyhow!(\"configure: {}\", json)),\n                    Err(IgError::Other(e))\n                        if e.contains(\"Transcode\")\n                            || e.contains(\"not ready\")\n                            || e.contains(\"202\") =>\n                    {\n                        last = Some(anyhow!(e));\n                    }\n                    Err(e) => return Err(m(e)),\n                }\n                tokio::time::sleep(std::time::Duration::from_secs(4 + attempt * 3)).await;\n            }\n            Err(last.unwrap_or_else(|| anyhow!(\"o Instagram nao confirmou o video\")))\n        }\n        \"carousel\" => {\n            if req.files.len() < 2 || req.files.len() > 20 {\n                return Err(anyhow!(\"um carrossel tem de 2 a 20 arquivos\"));\n            }\n            let total = req.files.len() as u64 + 1;\n            let sidecar_id = upload_id();\n            let mut children: Vec<Value> = Vec::new();\n            for (i, f) in req.files.iter().enumerate() {\n                report(\"upload\", i as u64, total);\n                let path = Path::new(f);\n                let uid = format!(\"{}{}\", upload_id(), i);","sourceCodeStart":432,"sourceCodeEnd":468,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/instagram/publish.rs#L432-L468","documentation":"Inside the configure retry loop, errors matching IgError::Other containing 'Transcode', 'not ready', or '202' are treated as retryable and stored as the last error (anyhow!(e)); if all retries are exhausted this message is returned. It surfaces the raw transcode/pending message from Instagram.","triggerScenarios":"Instagram repeatedly reports the video as transcoding/not-ready (or HTTP 202) for every retry attempt in publish_web's video path.","commonSituations":"Very large or long videos taking longer than the retry window to process, or Instagram-side processing delays.","solutions":["Increase the number of retries or the sleep duration (4 + attempt*3 seconds)","Re-encode the video to smaller dimensions/bitrate so transcoding completes faster","Verify with the stored message whether processing eventually succeeds on a manual reconfigure"],"exampleFix":"// before\nlast = Some(anyhow!(e));\n// after (bounded but longer window)\ntokio::time::sleep(std::time::Duration::from_secs(4 + attempt * 5)).await; // and allow more attempts","handlingStrategy":"retry","validationCode":"// prefer shorter, standard-encoded videos that transcode quickly\nassert!(file_size_mb <= 100 && duration_secs <= 60);","typeGuard":null,"tryCatchPattern":"loop with attempt cap: if error contains \"Transcode\"/\"not ready\"/\"202\", sleep with exponential backoff up to N attempts, then surface the last transcode message","preventionTips":["Compress videos before upload to shorten transcoding","Set a bounded but generous retry budget","Monitor Instagram processing latency and adjust backoff"],"tags":["instagram","video","transcode","retry"],"backgroundTag":"request-timeout","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}