{"meta":{"title":"SARIF 文件无效","intro":"Code scanning 只能处理语法有效的 SARIF 文件。 无效文件被拒绝。","product":"安全性和代码质量","breadcrumbs":[{"href":"/zh/code-security","title":"安全性和代码质量"},{"href":"/zh/code-security/reference","title":"Reference"},{"href":"/zh/code-security/reference/code-scanning","title":"代码扫描"},{"href":"/zh/code-security/reference/code-scanning/sarif-files","title":"SARIF 文件"},{"href":"/zh/code-security/reference/code-scanning/sarif-files/troubleshoot-sarif-uploads","title":"解决 SARIF 上传中的问题"},{"href":"/zh/code-security/reference/code-scanning/sarif-files/troubleshoot-sarif-uploads/sarif-invalid","title":"SARIF 文件无效"}],"documentType":"article"},"body":"# SARIF 文件无效\n\nCode scanning 只能处理语法有效的 SARIF 文件。 无效文件被拒绝。\n\n## 关于此错误\n\n```text\nInvalid SARIF\nSARIF file invalid\nSARIF ZIP upload is invalid\n400: Bad Request if the sarif field is invalid\n```\n\n如果 code scanning 无法分析 SARIF 文件，则会报告其中一个错误。\n\n使用 CodeQL 分析时，不太可能看到此错误。\n\n## 确认错误原因\n\n可以通过查看上传分析的工作流运行的日志，并通过检查验证程序中的 SARIF 文件来调查错误的根本原因。 有关详细信息，请参阅“[使用工作流运行日志](/zh/actions/how-tos/monitor-workflows/use-workflow-run-logs)”和访问 [Microsoft SARIF 验证程序](https://sarifweb.azurewebsites.net/)。\n\n## 修复问题\n\n识别 SARIF 文件的无效部分后，也许能够手动解决较小的问题，但可能需要咨询该工具的维护人员。 有关验证和支持的格式 code scanning的信息，请参阅 [对代码扫描的 SARIF 支持](/zh/code-security/reference/code-scanning/sarif-files/sarif-support)。"}