問題截圖
報(bào)錯(cuò)詳情
如上圖析珊,在安裝gRPC-Core時(shí),下載grpc是沒有問題的,但grpc的幾個(gè)依賴庫submodules下載總是失敗杉武,報(bào)錯(cuò)如下:
error: RPC failed; curl 56 LibreSSL SSL_read: error:02FFF036:system library:func(4095):Connection reset by peer, errno 54
error: 4808 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/envoyproxy/data-plane-api.git' into submodule path '/private/var/folders/m_/vzhhfvfd01794lfsgm8rwlj80000gp/T/d20220829-41509-lvh2ed/third_party/envoy-api' failed
解決方法
使用ssh方式,得以解決辙售,命令行輸入:
git config --global url.git@github.com:.insteadOf https://github.com/
此命令的作用是將所有g(shù)it clone的url中包含https://github.com/的都替換為git@github.com:轻抱,以ssh的方式去執(zhí)行g(shù)it clone,例如:
git clone https://github.com/envoyproxy/data-plane-api.git
執(zhí)行了上邊的命令后旦部,將轉(zhuǎn)為
git clone git@github.com:envoyproxy/data-plane-api.git
問題分析
應(yīng)該是因?yàn)榫W(wǎng)絡(luò)問題祈搜,使用https的方式總是無法完成下載,故采用ssh方式得以解決士八。
其他解決方式
這些方式我都嘗試了容燕,但并未適用于我的問題,但也記錄下婚度。
- 修改gitconfig蘸秘,增大緩存
git config --global http.postBuffer 524288000
git config --global https.postBuffer 524288000
- 修改host,增加以下ip域名
140.82.113.3 github.com
146.75.77.194 github.global.ssl.fastly.net
185.199.108.153 assets-cdn.github.com
185.199.109.153 assets-cdn.github.com
185.199.110.153 assets-cdn.github.com
185.199.111.153 assets-cdn.github.com
- 修改gitconfig陕见,取消http代理
git config --global --unset http.proxy
git config --global --unset https.proxy