IDEA 2024.1(Windows 10)中GitHub Copilot Chat登录失败求助
IDEA 2024.1 Copilot Chat 登录超时(error code:1001)解决办法
问题描述
环境:Windows 10、IDEA 2024.1(旗舰版)
触发场景:点击Copilot Chat的「Sign in with GitHub」后,弹出「retrieving GitHub device code」提示,等待一段时间后登录失败,报错内容:Sign in failed. Reason: Could not log in with device flow on github.com: Request timed out from LSP server, request id: 5, error code: 1001.
已尝试无效操作:
- 将IDEA代理设置为127.0.0.1
- 关闭防火墙
- 重新安装IDEA及Copilot插件
补充:VS Code中GitHub Copilot Chat可正常使用
解决步骤
1. 对齐IDEA与VS Code的代理配置
- 打开IDEA的「File」→「Settings」→「Appearance & Behavior」→「System Settings」→「HTTP Proxy」
- 选择与VS Code一致的代理模式(如自动检测或手动代理),输入相同的代理地址和端口
- 点击「Check connection」,输入
https://github.com验证网络连通性
- 进入「Settings」→「Tools」→「Server Certificates」,勾选「Accept non-trusted certificates automatically」,避免证书验证导致连接中断
2. 单独配置Copilot插件的代理
- 打开「Settings」→「Plugins」→「GitHub Copilot」→「Settings」
- 在「Proxy settings」中选择「Use IDE proxy settings」,若无效则手动填入VS Code中可用的代理参数
- 重启IDEA后重试登录
3. 清除IDEA缓存与日志
- 完全关闭IDEA,删除以下目录的文件:
C:\Users\<你的用户名>\.IntelliJIdea2024.1\system\cachesC:\Users\<你的用户名>\.IntelliJIdea2024.1\system\logs
- 重新启动IDEA,再次尝试登录
4. 延长IDEA网络超时时间
- 打开IDEA的「Help」→「Edit Custom VM Options」
- 在文件末尾添加以下参数,增加网络超时阈值:
-Dhttp.connection.timeout=30000 -Dhttp.socket.timeout=30000 -Dhttps.connection.timeout=30000 -Dhttps.socket.timeout=30000 - 保存文件后重启IDEA
5. 手动完成设备码登录
- 打开GitHub设备登录页面
https://github.com/login/device - 在IDEA中触发登录操作,当出现「retrieving GitHub device code」提示时,打开IDEA日志目录(「Help」→「Show Log in Explorer」),查找包含
user_code的日志行,提取用户码 - 在GitHub设备登录页面输入该用户码,完成验证后返回IDEA,检查登录状态
内容的提问来源于stack exchange,提问作者zhoutian
相关产品推荐
相关产品推荐

