Help us learn about your current experience with the documentation. Take the survey.

GitLab Duo 故障排除

在使用 GitLab Duo 时,您可能会遇到问题。

请先 运行健康检查 以确定您的实例是否满足使用 GitLab Duo 的要求。

有关 GitLab Duo 故障排除的更多信息,请参阅:

如果健康检查无法解决您的问题,请查看以下故障排除步骤。

GitLab Duo 功能在自托管实例上无法使用

除了 确保已启用 GitLab Duo 功能 外,您还可以执行以下操作:

  1. 以管理员身份,为 GitLab Duo 运行健康检查。

    在 GitLab 17.5 及更高版本中,您可以使用 UI 运行健康检查并下载详细报告,以帮助识别和排查问题。

    在 GitLab 17.4 中,您可以运行健康检查 Rake 任务来生成详细报告,以帮助识别和排查问题。

    sudo gitlab-rails 'cloud_connector:health_check(root,report.json)'

    在 GitLab 17.3 及更早版本中,您可以下载并运行 health_check 脚本来生成详细报告,以帮助识别和排查问题。

    1. 下载健康检查脚本:

      wget https://gitlab.com/gitlab-org/gitlab/-/snippets/3734617/raw/main/health_check.rb
    2. 使用 Rails Runner 运行脚本:

      gitlab-rails runner [full_path/to/health_check.rb] --debug --username [username] --output-file [report.txt]
      用法: gitlab-rails runner full_path/to/health_check.rb
             --debug                启用调试模式
             --output-file FILE     将报告写入 FILE
             --username USERNAME    提供用户名以测试席位分配
             --skip [CHECK]         跳过特定检查(选项:access_data, token, license, host, features, end_to_end)
  2. 验证 GitLab 实例能否访问 必需的 GitLab.com 端点。 您可以使用 curl 等命令行工具来验证连接性。

    curl --verbose "https://cloud.gitlab.com"
    
    curl --verbose "https://customers.gitlab.com"

    如果为 GitLab 实例配置了 HTTP/S 代理,请在 curl 命令中包含 proxy 参数。

    # curl 的 https 代理
    curl --verbose --proxy "http://USERNAME:[email protected]:8080" "https://cloud.gitlab.com"
    curl --verbose --proxy "http://USERNAME:[email protected]:8080" "https://customers.gitlab.com"
  3. 可选。如果您在 GitLab 应用程序和公共互联网之间使用了 代理服务器, 请 禁用 DNS 重新绑定保护

  4. 手动同步订阅数据

GitLab Duo 功能对用户不可用

除了 启用 GitLab Duo 功能 外,您还可以执行以下操作: