You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多
文档控制台
免费开始使用

Ubuntu 22.04更新rpcs3子模块遇curl 92等RPC失败问题求助

解决git submodule更新时RPC失败、early EOF及TLS解码错误

问题描述

在Ubuntu 22.04.5 LTS(git版本2.34.1)下执行git submodule update更新rpcs3子模块时,反复出现以下类型错误:

user@comp:~/rpcs3$ git submodule update
Cloning into '/home/user/rpcs3/3rdparty/llvm/llvm'...
error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)
error: 20 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
fatal: clone of 'https://github.com/llvm/llvm-project.git' into submodule path '/home/user/rpcs3/3rdparty/llvm/llvm' failed
Failed to clone '3rdparty/llvm/llvm'. Retry scheduled
Cloning into '/home/user/rpcs3/3rdparty/wolfssl/wolfssl'...
error: RPC failed; curl 56 GnuTLS recv error (-9): Error decoding the received TLS packet.
error: 5802 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
fatal: clone of 'https://github.com/wolfSSL/wolfssl.git' into submodule path '/home/user/rpcs3/3rdparty/wolfssl/wolfssl' failed
Failed to clone '3rdparty/wolfssl/wolfssl'. Retry scheduled
Cloning into '/home/user/rpcs3/3rdparty/llvm/llvm'...
error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)
error: 2927 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
fatal: clone of 'https://github.com/llvm/llvm-project.git' into submodule path '/home/user/rpcs3/3rdparty/llvm/llvm' failed
Failed to clone '3rdparty/llvm/llvm' a second time, aborting

尝试设置git config --global http.postBuffer 157286400或切换HTTP/1.1(git config --global http.version HTTP/1.1)无效,切换后报错变为:

error: RPC failed; curl 18 transfer closed with outstanding read data remaining

解决方案

1. 优先排查网络稳定性

  • 测试网络连通性:执行ping github.comcurl -L -O https://github.com/llvm/llvm-project/archive/refs/heads/main.zip,确认大文件下载是否会中断
  • 尝试切换网络(如手机热点),排除本地运营商或网络设备的限制

2. 调整git传输相关配置

针对子模块单独配置HTTP/1.1(避免全局影响)

进入rpcs3本地仓库目录,执行:

git config submodule.3rdparty/llvm/llvm.http.version HTTP/1.1
git config submodule.3rdparty/wolfssl/wolfssl.http.version HTTP/1.1

增大接收缓冲区并关闭压缩

# 增大请求接收缓冲区(区别于postBuffer,针对下载)
git config --global http.maxRequestBuffer 100M
# 关闭git传输压缩,减少传输压力
git config --global core.compression 0

增加重试次数和低速超时

# 失败时自动重试5次
git config --global http.retry 5
# 当速度低于1000字节/秒持续60秒时,视为传输失败并重试
git config --global http.lowSpeedLimit 1000
git config --global http.lowSpeedTime 60

3. 手动克隆子模块(绕过自动更新的问题)

如果自动更新持续失败,手动处理每个报错的子模块:

  1. 删除已失败的子模块目录:
rm -rf 3rdparty/llvm/llvm 3rdparty/wolfssl/wolfssl
  1. 查看rpcs3需要的子模块版本(从.gitmodules文件中提取对应commit-id):
cat .gitmodules | grep -A 3 "llvm/llvm"
cat .gitmodules | grep -A 3 "wolfssl/wolfssl"
  1. 手动克隆并切换到指定版本:
# 克隆llvm仓库并切换到对应commit
git clone https://github.com/llvm/llvm-project.git 3rdparty/llvm/llvm
cd 3rdparty/llvm/llvm && git checkout <对应commit-id> && cd ../../..

# 克隆wolfssl仓库并切换到对应commit
git clone https://github.com/wolfSSL/wolfssl.git 3rdparty/wolfssl/wolfssl
cd 3rdparty/wolfssl/wolfssl && git checkout <对应commit-id> && cd ../../..
  1. 最后更新剩余子模块:
git submodule update --recursive --progress

4. 升级git版本

Ubuntu 22.04默认的git 2.34.1存在部分网络传输相关的已知bug,升级到最新稳定版可解决部分问题:

sudo add-apt-repository ppa:git-core/ppa
sudo apt update && sudo apt upgrade git

5. 修复TLS解码错误(针对curl 56报错)

Ubuntu默认curl使用GnuTLS,部分场景下存在兼容性问题,切换为openssl后端:

# 设置git使用openssl作为SSL后端
git config --global http.sslBackend openssl

如果无效,安装openssl版本的curl并配置git使用:

sudo apt install curl-openssl
git config --global http.curlPath /usr/bin/curl-openssl

内容的提问来源于stack exchange,提问作者Crumml

火山引擎 最新活动