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

Eclipse 故障排除

  • Tier: Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
  • Status: Beta
This page contains information related to upcoming products, features, and functionality. It is important to note that the information presented is for informational purposes only. Please do not rely on this information for purchasing or planning purposes. The development, release, and timing of any products, features, or functionality may be subject to change or delay and remain at the sole discretion of GitLab Inc.

如果本页面的步骤无法解决您的问题,请检查 Eclipse 插件项目中的开放问题列表。如果某个问题与您的问题匹配,请更新该问题。如果没有匹配的问题,请使用支持所需信息创建新问题

检查错误日志

  1. 在您的 IDE 菜单栏中,选择 Window
  2. 展开 Show View,然后选择 Error Log
  3. 搜索引用 gitlab-eclipse-plugin 插件的错误。

定位工作区日志文件

工作区日志文件名为 .log,位于目录 <your-eclipse-workspace>/.metadata 中。

启用 GitLab Language Server 调试日志

要启用 GitLab Language Server 调试日志:

  1. 在您的 IDE 中,选择 Eclipse > Settings
  2. 在左侧边栏中,选择 GitLab
  3. Language Server Log Level 中,输入 debug
  4. 选择 Apply and Close

调试日志可在 language_server.log 文件中查看。要查看此文件,可以:

  • 转到目录 /Users/<user>/eclipse/<eclipse-version>/Eclipse.app/Contents/MacOS/.gitlab_plugin,将 <user><eclipse-version> 替换为适当的值。
  • 打开错误日志。搜索日志 Language server logs saved to: <file>.,其中 <file>language_server.log 文件的绝对路径。

支持所需信息

创建支持请求时,请提供以下信息:

  1. 您当前的 GitLab for Eclipse 插件版本。

    1. 打开 About Eclipse IDE 对话框。
      • 在 Windows 上,在您的 IDE 中,选择 Help > About Eclipse IDE
      • 在 MacOS 上,在您的 IDE 中,选择 Eclipse > About Eclipse IDE
    2. 在对话框中,选择 Installation details
    3. 找到 GitLab for Eclipse 并复制 Version 值。
  2. 您的 Eclipse 版本。

    1. 打开 About Eclipse IDE 对话框。
      • 在 Windows 上,在您的 IDE 中,选择 Help > About Eclipse IDE
      • 在 MacOS 上,在您的 IDE 中,选择 Eclipse > About Eclipse IDE
  3. 您的操作系统。

  4. 您是否在使用 GitLab.com、GitLab Self-Managed 或 GitLab Dedicated 实例?

  5. 您是否在使用代理?

  6. 您是否在使用自签名证书?

  7. 工作区日志

  8. Language Server 调试日志

  9. 如适用,提供问题的视频或截图。

  10. 如适用,提供重现问题的步骤。

  11. 如适用,提供尝试过的解决步骤。

证书错误

如果您的机器通过代理连接到 GitLab 实例,您可能会在 Eclipse 中遇到 SSL 证书错误。GitLab Duo 尝试检测系统存储中的证书; 但是,Language Server 无法做到这一点。如果您看到来自 Language Server 的 证书错误,请尝试启用传递证书颁发机构(CA)证书的选项:

执行以下操作:

  1. 在您的 IDE 右下角,选择 GitLab 图标。
  2. 在对话框中,选择 Show Settings。这将打开 Tools > GitLab DuoSettings 对话框。
  3. 选择 GitLab Language Server 以展开该部分。
  4. 选择 HTTP Agent Options 以展开它。
  5. 要么:
    • 选择 Pass CA certificate from Duo to the Language Server 选项。
    • Certificate authority (CA) 中,指定包含 CA 证书的 .pem 文件的路径。
  6. 重启您的 IDE。

忽略证书错误

如果 GitLab Duo 仍然无法连接,您可能需要 忽略证书错误。启用调试模式后,您可能会在 GitLab Language Server 日志中看到错误:

2024-10-31T10:32:54:165 [error]: fetch: request to https://gitlab.com/api/v4/personal_access_tokens/self failed with:
request to https://gitlab.com/api/v4/personal_access_tokens/self failed, reason: unable to get local issuer certificate
FetchError: request to https://gitlab.com/api/v4/personal_access_tokens/self failed, reason: unable to get local issuer certificate

根据设计,此设置代表安全风险: 这些错误会提醒您潜在的安全漏洞。只有在您绝对确定代理导致问题时,才应启用此 设置。

先决条件:

  • 您已使用系统浏览器验证证书链有效, 或者已与您的机器管理员确认此错误可以安全忽略。

执行以下操作:

  1. 参阅 Eclipse 关于 SSL 证书的文档。
  2. 转到您的 IDE 顶部菜单栏并选择 Settings
  3. 在左侧边栏中,选择 Tools > GitLab Duo
  4. 确认您的默认浏览器信任您正在使用的 URL to GitLab instance
  5. 启用 Ignore certificate errors 选项。
  6. 选择 Verify setup
  7. 选择 OKSave