MetaCubeX / mihomo

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

[Bug] 更新alpha-8e6eb70内核后首次下载GeoIP.dat和GeoSite.dat会报错,内核无法启动 #1572

Open aslfjk opened 1 day ago

aslfjk commented 1 day ago

Verify steps

Operating System

Windows

System Version

Win11 23H2 22631.4249

Mihomo Version

Mihomo Meta alpha-8e6eb70 linux amd64 with go1.23.2 2024-10-06T08:17:46+00:00 Use tags: with_gvisor

Configuration File

proxy-providers:
  1:
    url: ""
    type: http
    interval: 86400
    health-check: {enable: true,url: "https://www.gstatic.com/generate_204",interval: 300}
    override:
      additional-prefix: "[1]" 

proxies: 
  - name: "直连"
    type: direct
    udp: true

geodata-mode: true
geox-url:
  geoip: "https://mirror.ghproxy.com/https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip-lite.dat"
  geosite: "https://mirror.ghproxy.com/https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat"
  mmdb: "https://mirror.ghproxy.com/https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country-lite.mmdb"
  asn: "https://mirror.ghproxy.com/https://github.com/xishang0128/geoip/releases/download/latest/GeoLite2-ASN.mmdb"

dns:
  enable: true
  ipv6: true
  respect-rules: true
  enhanced-mode: fake-ip
  fake-ip-filter:
    - "*"
    - "+.lan"
    - "+.local"
    - "+.market.xiaomi.com"
  nameserver:
    - https://223.5.5.5/dns-query
  proxy-server-nameserver:
    - https://223.5.5.5/dns-query
  nameserver-policy:
    "geosite:cn,private":
      - https://223.5.5.5/dns-query
    "geosite:geolocation-!cn":
      - "https://dns.cloudflare.com/dns-query"
      - "https://dns.google/dns-query"

proxy-groups:

  - name: 默认
    type: select
    proxies: [自动选择]

  - name: 国内
    type: select
    proxies:  [直连]

  - name: 其他
    type: select
    proxies:  [默认]

  - name: 自动选择
    type: url-test
    include-all: true
    tolerance: 10

rules:
  - GEOIP,CN,国内
  - MATCH,其他

Description

首次启动无法自动下载GeoIP.dat和geosite.dat,当其中任意一个文件缺失时报错

Reproduction Steps

不存在GeoIP.dat和geosite.dat任一文件时重启内核

Logs

# 缺失GeoIP.dat
time="2024-10-07T18:00:52.701423199+08:00" level=info msg="Start initial configuration in progress"
time="2024-10-07T18:00:52.702193651+08:00" level=info msg="Geodata Loader mode: standard"
time="2024-10-07T18:00:52.702202719+08:00" level=info msg="Geosite Matcher implementation: succinct"
time="2024-10-07T18:00:52.702257824+08:00" level=info msg="Load GeoSite rule: cn"
time="2024-10-07T18:00:53.002316233+08:00" level=info msg="Load GeoSite rule: github"
time="2024-10-07T18:00:53.059147392+08:00" level=info msg="Finished initial GeoSite rule github => Github, records: 27"
time="2024-10-07T18:00:53.063467163+08:00" level=info msg="Load GeoSite rule: twitter"
time="2024-10-07T18:00:53.114562529+08:00" level=info msg="Finished initial GeoSite rule twitter => Twitter, records: 23"
time="2024-10-07T18:00:53.118554518+08:00" level=info msg="Load GeoSite rule: youtube"
time="2024-10-07T18:00:53.165267331+08:00" level=info msg="Finished initial GeoSite rule youtube => YouTube, records: 176"
time="2024-10-07T18:00:53.168565449+08:00" level=info msg="Load GeoSite rule: google"
time="2024-10-07T18:00:53.216092856+08:00" level=info msg="Finished initial GeoSite rule google => Google, records: 1135"
time="2024-10-07T18:00:53.220870386+08:00" level=info msg="Load GeoSite rule: telegram"
time="2024-10-07T18:00:53.260692283+08:00" level=info msg="Finished initial GeoSite rule telegram => Telegram, records: 19"
time="2024-10-07T18:00:53.262194436+08:00" level=info msg="Load GeoSite rule: netflix"
time="2024-10-07T18:00:53.307280061+08:00" level=info msg="Finished initial GeoSite rule netflix => NETFLIX, records: 28"
time="2024-10-07T18:00:53.307350984+08:00" level=info msg="Load GeoSite rule: bilibili"
time="2024-10-07T18:00:53.358251192+08:00" level=info msg="Finished initial GeoSite rule bilibili => 哔哩哔哩, records: 50"
time="2024-10-07T18:00:53.358327183+08:00" level=info msg="Load GeoSite rule: bahamut"
time="2024-10-07T18:00:53.413080513+08:00" level=info msg="Finished initial GeoSite rule bahamut => 巴哈姆特, records: 5"
time="2024-10-07T18:00:53.413154696+08:00" level=info msg="Load GeoSite rule: spotify"
time="2024-10-07T18:00:53.467896552+08:00" level=info msg="Finished initial GeoSite rule spotify => Spotify, records: 21"
time="2024-10-07T18:00:53.467991436+08:00" level=info msg="Finished initial GeoSite rule CN => 国内, records: 92350"
time="2024-10-07T18:00:53.468011373+08:00" level=info msg="Load GeoSite rule: geolocation-!cn"
time="2024-10-07T18:00:53.600010431+08:00" level=info msg="Finished initial GeoSite rule geolocation-!cn => 其他, records: 30934"
time="2024-10-07T18:00:53.600103748+08:00" level=info msg="Can't find GeoIP.dat, start download"
panic: should never be called

goroutine 18 [running]:
main.main.func1({0xc0006040f0?, 0x0?}, {0x0?, 0xc0006040f0?}, {0xc00060f380?, 0x40fb05?})
        github.com/metacubex/mihomo/main.go:63 +0x25
net.(*Resolver).dial(0xc0005e8f50?, {0x1614a20?, 0xc002f1ce00?}, {0x1402a57?, 0xc000135dc0?}, {0xc0025fda60?, 0x0?})
        net/lookup.go:684 +0x63
net.(*Resolver).exchange(_, {_, _}, {_, _}, {{{0x6d, 0x69, 0x72, 0x72, 0x6f, ...}, ...}, ...}, ...)
        net/dnsclient_unix.go:184 +0x34a
net.(*Resolver).tryOneName(0x1fe8320, {0x16149b0, 0xc0000a05f0}, 0xc0005e1c20?, {0xc00260f1b8, 0x13}, 0x1c)
        net/dnsclient_unix.go:315 +0x4cb
net.(*Resolver).goLookupIPCNAMEOrder.func3.1(0x6964?)
        net/dnsclient_unix.go:668 +0x85
created by net.(*Resolver).goLookupIPCNAMEOrder.func3 in goroutine 15
        net/dnsclient_unix.go:667 +0x13f

# 缺失GeoSite.dat
time="2024-10-07T18:02:07.977058087+08:00" level=info msg="Start initial configuration in progress"
time="2024-10-07T18:02:07.977825858+08:00" level=info msg="Geodata Loader mode: standard"
time="2024-10-07T18:02:07.977833661+08:00" level=info msg="Geosite Matcher implementation: succinct"
time="2024-10-07T18:02:07.977884367+08:00" level=info msg="Can't find GeoSite.dat, start download"
panic: should never be called

goroutine 18 [running]:
main.main.func1({0xc0004021b0?, 0x0?}, {0x0?, 0xc0004021b0?}, {0xc000137380?, 0x40fb05?})
        github.com/metacubex/mihomo/main.go:63 +0x25
net.(*Resolver).dial(0xc00020e100?, {0x1614a20?, 0xc0000f8ee0?}, {0x1402a57?, 0xc000135dc0?}, {0xc0005df540?, 0x0?})
        net/lookup.go:684 +0x63
net.(*Resolver).exchange(_, {_, _}, {_, _}, {{{0x6d, 0x69, 0x72, 0x72, 0x6f, ...}, ...}, ...}, ...)
        net/dnsclient_unix.go:184 +0x34a
net.(*Resolver).tryOneName(0x1fe8320, {0x16149b0, 0xc0005e9950}, 0xc0001eaf00?, {0xc0003de660, 0x13}, 0x1c)
        net/dnsclient_unix.go:315 +0x4cb
net.(*Resolver).goLookupIPCNAMEOrder.func3.1(0x0?)
        net/dnsclient_unix.go:668 +0x85
created by net.(*Resolver).goLookupIPCNAMEOrder.func3 in goroutine 15
        net/dnsclient_unix.go:667 +0x13f
xishang0128 commented 14 hours ago

I have provided the simplest configuration that can reproduce the error I reported

lochuan commented 9 hours ago

Same error

dycwuxing commented 7 hours ago

同样,mac下核心反复重启

SharerMax commented 4 hours ago

x86-64 openwrt 23.05.5 下有同样的问题

临时解决办法:手动下载GeoSite.dat和GeoIP.dat 到运行目录