MetaCubeX / mihomo

A simple Python Pydantic model for Honkai: Star Rail parsed data from the Mihomo API.
https://wiki.metacubex.one
MIT License
14.23k stars 2.43k forks source link

用作git的http代理,克隆大仓库时,报RPC failed错误 #363

Open ipcjs opened 1 year ago

ipcjs commented 1 year ago

相同的Shadowsocks+V2Ray插件的服务端的情况下,客户端用Clash和SS,分别将git的http代理设为他们,Clash报错,SS不报错

电脑:M1 mac mini git版本:2.37.1 (Apple Git-137.1)

使用Clash Meta v1.14.1克隆大仓库,报RPC failed错误

git克隆日志(尝试了三次,全部报错):

$ export https_proxy=http://127.0.0.1:7890
$ git clone https://github.com/FFmpeg/FFmpeg.git FFmpeg-clash2 -v 
Cloning into 'FFmpeg-clash2'...
POST git-upload-pack (193 bytes)
POST git-upload-pack (gzip 20420 to 10258 bytes)
remote: Enumerating objects: 684104, done.
remote: Counting objects: 100% (97/97), done.
remote: Compressing objects: 100% (88/88), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
error: 4362 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
$ git clone https://github.com/FFmpeg/FFmpeg.git FFmpeg-clash2 -v
Cloning into 'FFmpeg-clash2'...
POST git-upload-pack (193 bytes)
POST git-upload-pack (gzip 20420 to 10258 bytes)
remote: Enumerating objects: 684104, done.
remote: Counting objects: 100% (97/97), done.
remote: Compressing objects: 100% (88/88), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
error: 8168 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
$ git clone https://github.com/FFmpeg/FFmpeg.git FFmpeg-clash2 -v
Cloning into 'FFmpeg-clash2'...
POST git-upload-pack (193 bytes)
POST git-upload-pack (gzip 20420 to 10258 bytes)
remote: Enumerating objects: 684104, done.
remote: Counting objects: 100% (97/97), done.
remote: Compressing objects: 100% (88/88), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
error: 1821 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output

clash日志:

$ clash.meta -v                           
Clash Meta v1.14.1 darwin arm64 with go1.19.5 Wed Jan 11 17:36:06 UTC 2023
$ clash.meta
INFO[0000] Start initial configuration in progress      
INFO[0000] Geodata Loader mode: memconservative         
INFO[0000] Initial configuration complete, total time: 0ms 
INFO[0000] Sniffer is closed                            
INFO[0000] DNS server listening at: [::]:1053           
INFO[0000] Start initial compatible provider default    
INFO[0000] Start initial compatible provider auto       
INFO[0000] Use IPv6                                     
INFO[0000] Mixed(http+socks) proxy listening at: [::]:7890 
INFO[0000] RESTful API listening at: 127.0.0.1:9090     
DEBU[0029] [Rule] use default rules                     
DEBU[0029] creating a new http client                   
DEBU[0029] [https://dns.alidns.com:443/dns-query] using HTTP/2 for this upstream: HTTP3 support is not enabled 
DEBU[0029] [DNS] github.com --> 20.205.243.166          
DEBU[0030] Start New Health Checking {cb6f8667-1907-493f-82e5-9ce922cb3cd1} 
DEBU[0030] Health Checking cdn-v2ray-tg2 {cb6f8667-1907-493f-82e5-9ce922cb3cd1} 
INFO[0030] [TCP] 127.0.0.1:57262 --> github.com:443 match Match using auto[cdn-v2ray-tg2] 
DEBU[0030] Health Checked cdn-v2ray-tg2 : true 911 ms {cb6f8667-1907-493f-82e5-9ce922cb3cd1} 
DEBU[0030] Finish A Health Checking {cb6f8667-1907-493f-82e5-9ce922cb3cd1} 
DEBU[0045] [Rule] use default rules                     
DEBU[0045] [DNS] github.com --> 20.205.243.166          
INFO[0046] [TCP] 127.0.0.1:57268 --> github.com:443 match Match using auto[cdn-v2ray-tg2] 
DEBU[0064] [Rule] use default rules                     
DEBU[0064] [DNS] github.com --> 20.205.243.166          
INFO[0065] [TCP] 127.0.0.1:57273 --> github.com:443 match Match using auto[cdn-v2ray-tg2] 

clash配置文件(脱敏后):

mixed-port: 7890
allow-lan: true
bind-address: '*'
mode: rule
log-level: debug
ipv6: true
external-controller: 127.0.0.1:9090
hosts:
  'clash.ui': 127.0.0.1
profile:
  store-selected: false
  store-fake-ip: true
dns:
  enable: true
  listen: 0.0.0.0:1053
  ipv6: true
  default-nameserver:
    - 114.114.114.114
  enhanced-mode: fake-ip
  fake-ip-range: 198.18.0.1/16
  nameserver:
    - 114.114.114.114
    - https://dns.alidns.com/dns-query
proxies:
  - name: "cdn-v2ray-tg2"
    type: ss
    server: xxx
    port: xxx
    cipher: xxx
    password: "xxx"
    plugin: v2ray-plugin
    plugin-opts:
      mode: websocket
      tls: true
      host: xxx
      path: "xxx"
proxy-groups:
  - name: "auto"
    type: url-test
    proxies:
      - cdn-v2ray-tg2
    url: 'http://www.gstatic.com/generate_204'
    interval: 300
rules:
  - DOMAIN-SUFFIX,local,DIRECT
  - IP-CIDR,127.0.0.0/8,DIRECT
  - IP-CIDR,172.16.0.0/12,DIRECT
  - IP-CIDR,192.168.0.0/16,DIRECT
  - IP-CIDR,10.0.0.0/8,DIRECT
  - IP-CIDR,0.0.0.0/32,DIRECT
  - GEOIP,CN,DIRECT
  - MATCH,auto

使用ShadowsocksX-NG 1.9.4(ss-local v3.2.5, v2ray-plugin v1.2.0),正常克隆

$ export https_proxy=http://127.0.0.1:1080
$ git clone https://github.com/FFmpeg/FFmpeg.git FFmpeg-ss -v 
Cloning into 'FFmpeg-ss'...
POST git-upload-pack (193 bytes)
POST git-upload-pack (gzip 20420 to 10258 bytes)
remote: Enumerating objects: 684104, done.
remote: Counting objects: 100% (97/97), done.
remote: Compressing objects: 100% (88/88), done.
remote: Total 684104 (delta 10), reused 91 (delta 8), pack-reused 684007
Receiving objects: 100% (684104/684104), 335.66 MiB | 777.00 KiB/s, done.
Resolving deltas: 100% (537107/537107), done.
tgNotHouse commented 1 year ago

可以发点clash的log,这样清楚点。

ipcjs commented 1 year ago

增加了日志和config文件,不过日志里面并没有报错🤔️

tgNotHouse commented 1 year ago

low-level: debug

信息更详尽点

不过这个问题,你应该重复git clone几次就解决了吧

ipcjs commented 1 year ago

换成debug的日志了

重试不行,git clone不支持断点续传,只要仓库足够大,基本上100%会断

我曾经把git clone包在死循环里面执行,第二天来看,还是没clone下来( 后来换成使用socks5代理,才下下来的,socks5似乎比http稳定🤔️

Skyxim commented 1 year ago

看 git 日志 ,还没开始就断了,你确定节点可用,在 meta 中 我使用一个比较垃圾的节点能完成下载 proxychains 使用的 http 代理。要么节点稳定有问题,要么就是 ss 的 v2ray-plugin 有问题 image

ipcjs commented 1 year ago

节点是不稳定,但用clash克隆的成功率明显比ss要低非常多。

ipcjs commented 1 year ago

@Skyxim 开始了,clash上都有日志,但git日志看不到在哪里中断的😓️