{"record":{"id":"9a411a2d158f7987","repo":"tonhowtf/omniget","slug":"configure","errorCode":null,"errorMessage":"configure: {}","messagePattern":"configure: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/instagram/publish.rs","lineNumber":444,"sourceCode":"                if req.share_to_feed || req.kind == \"video\" {\n                    \"1\"\n                } else {\n                    \"0\"\n                }\n                .into(),\n            ));\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;","sourceCodeStart":426,"sourceCodeEnd":462,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/instagram/publish.rs#L426-L462","documentation":"After uploading a video, publish_web polls Instagram's configure endpoint; when the response status is not 'ok' it stores 'configure: <json body>' as the last error. This means Instagram rejected or has not finished processing the video configure call.","triggerScenarios":"Video configure response with status != 'ok' across retries — e.g. media still transcoding, 202-style pending responses that don't match the retry guard, or an outright rejection.","commonSituations":"Long videos still processing server-side, Instagram API instability, or videos violating constraints (duration, codec) causing a hard configure rejection.","solutions":["Inspect the JSON body after 'configure: ' for the real Instagram error code/message","Increase retry attempts / backoff window for slow transcodes","Re-encode the video to Instagram-friendly settings (H.264/AAC MP4, correct duration/aspect)","If the body shows a hard rejection, fix the media rather than retrying"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// ensure media is within Instagram constraints before upload\nassert!(duration_secs >= 3.0 && duration_secs <= 90.0);\nassert!(matches!(codec, \"h264\"));","typeGuard":null,"tryCatchPattern":"match configure_result { Ok(json) if status(&json) != \"ok\" => { let body = json.to_string(); if is_pending(&body) { backoff_and_retry() } else { return Err(anyhow!(\"hard rejection: {body}\")) } }, ... }","preventionTips":["Encode videos to Instagram-recommended settings","Allow generous retry windows for large videos","Parse the configure JSON for the specific error code before deciding to retry"],"tags":["instagram","video","configure","retry"],"backgroundTag":"unexpected-api-response-shape","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"}