{"record":{"id":"646310b44f7a8791","repo":"jackwener/OpenCLI","slug":"30s","errorCode":null,"errorMessage":"内容安全检测超时（30s），请稍后重试","messagePattern":"内容安全检测超时（30s），请稍后重试","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"warning","filePath":"clis/douyin/publish.js","lineNumber":244,"sourceCode":"                    continue;\n                }\n                pollUnavailableCount = 0;\n                const pollRes = poll.value;\n                if (pollRes.status === 0 || (pollRes.has_done === true && pollRes.detect_result?.reason_code === 0 && (pollRes.detect_list?.length ?? 0) === 0)) {\n                    safetyPassed = true;\n                    break;\n                }\n                if (pollRes.status === 1) {\n                    throw new CommandExecutionError('内容安全检测不通过，请修改后重试', '使用 --no_safety_check 跳过');\n                }\n                await sleep(2000);\n            }\n            if (!safetyPassed) {\n                if (!preCheck.ok && pollUnavailableCount >= 3) {\n                    process.stderr.write('  内容安全预检持续无响应，跳过本地预检，交由 create_v2 后的平台审核。\\n');\n                }\n                else {\n                    throw new CommandExecutionError('内容安全检测超时（30s），请稍后重试', '如确认要跳过本地预检，可使用 --no_safety_check；提交后仍会走抖音平台审核');\n                }\n            }\n        }\n        // ── Phase 8: create_v2 publish ──────────────────────────────────────\n        const hashtagNames = extractHashtagNames(caption);\n        const hashtags = [];\n        let searchFrom = 0;\n        for (const name of hashtagNames) {\n            const idx = caption.indexOf(`#${name}`, searchFrom);\n            if (idx === -1)\n                continue;\n            hashtags.push({ name, id: 0, start: idx, end: idx + name.length + 1 });\n            searchFrom = idx + name.length + 1;\n        }\n        const publishText = caption ? `${title} ${caption}` : title;\n        const captionOffset = caption ? title.length + 1 : 0;\n        const textExtraArr = parseTextExtra(publishText, hashtags.map((hashtag) => ({\n            ...hashtag,","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/douyin/publish.js#L226-L262","documentation":"If the content-safety poll loop finishes without ever seeing a passing or rejected status (safetyPassed stays false) and the pre-check was reachable (so it isn't skipped as unavailable), the command gives up after ~30 seconds and throws this CommandExecutionError. It's a timeout of the moderation pre-check, not a rejection; a hint suggests --no_safety_check.","triggerScenarios":"Polling loop exhausts its iterations (2s sleep per cycle up to 30s) with the poll endpoint responding but never returning status 0/1 — slow moderation service, pending state, or unexpected status codes.","commonSituations":"Douyin's safety service under heavy load or degraded; very long captions slowing moderation; network latency making each poll cycle take longer than expected; time-sensitive scheduled publishing retries during peak hours in Asia/Tokyo-China evening traffic.","solutions":["Retry the publish later when the safety service is less loaded","Use --no_safety_check to skip the local pre-check and rely on post-submit platform review","Check connectivity/latency to douyin.com from the automation environment","Shorten the caption/title to reduce moderation processing time"],"exampleFix":"// before\nawait douyin.publish({ caption: caption, schedule: '2026-01-01 20:00' });\n// after\nawait douyin.publish({ caption: caption, schedule: '2026-01-01 20:00', no_safety_check: true });","handlingStrategy":"retry","validationCode":"// Pre-check connectivity/latency before a scheduled publish\nconst t0 = Date.now();\nawait fetch('https://www.douyin.com', { method: 'HEAD' });\nif (Date.now() - t0 > 5000) console.warn('Douyin is slow; safety pre-check may time out');","typeGuard":null,"tryCatchPattern":"try {\n  await douyin.publish({ title, caption });\n} catch (e) {\n  if (e instanceof CommandExecutionError && /内容安全检测超时/.test(e.message)) {\n    await sleep(30000); // back off, then retry\n    await douyin.publish({ title, caption });\n  } else throw e;\n}","preventionTips":["Retry transient moderation timeouts with exponential backoff","Schedule publishes off-peak when Douyin's safety service is less loaded","Use --no_safety_check when pre-check latency is chronic and platform review is acceptable","Shorten captions to reduce moderation processing time"],"tags":["timeout","safety-check","network"],"backgroundTag":"request-timeout","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}