Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 升级到 v0.46.031-beta 无法启动 “failed to decode geosite file” #4033

Closed
6 of 7 tasks
gemnioo opened this issue Sep 20, 2024 · 19 comments
Closed
6 of 7 tasks
Labels
bug Something isn't working

Comments

@gemnioo
Copy link

gemnioo commented Sep 20, 2024

Verify Steps

  • Tracker 我已经在 Issue Tracker 中找过我要提出的问题
  • Branch 我知道 OpenClash 的 Dev 分支切换开关位于插件设置-版本更新中,或者我会手动下载并安装 Dev 分支的 OpenClash
  • Latest 我已经使用最新 Dev 版本测试过,问题依旧存在
  • Relevant 我知道 OpenClash 与 内核(Core)、控制面板(Dashboard)、在线订阅转换(Subconverter)等项目之间无直接关系,仅相互调用
  • Definite 这确实是 OpenClash 出现的问题
  • Contributors 我有能力协助 OpenClash 开发并解决此问题
  • Meaningless 我提交的是无意义的催促更新或修复请求

OpenClash Version

v0.46.031-beta

Bug on Environment

Lean, Other

OpenWrt Version

OpenWrt R24.9.9

Bug on Platform

Linux-arm64

Describe the Bug

如下报错 日志, 显示无法启动 openclash

failed to decode geosite file

can't remove invalid GeoSite.dat

To Reproduce

执行 sudo rm /etc/openclash/GeoSite.dat 重新更新后依旧报错

更新地址改选为 GitHub 加速

https://ghp.p3terx.com/https://raw.githubusercontent.com/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat

OpenClash Log

2024-09-20 21:56:00 level=error msg="rules[55] [GEOSITE,adobe,REJECT] error: can't remove invalid GeoSite.dat: remove /etc/openclash/GeoSite.dat: permission denied"
2024-09-20 21:56:00 level=error msg="can't initial GeoSite: can't remove invalid GeoSite.dat: remove /etc/openclash/GeoSite.dat: permission denied"
2024-09-20 21:56:00 level=warning msg="GeoSite.dat invalid, remove and download: failed to decode geodata file: GeoSite.dat, base error: proto: cannot parse invalid wire-format data"
2024-09-20 21:56:00 level=warning msg="failed to decode geosite file: GeoSite.dat, fallback to the original ReadFile method"
2024-09-20 21:56:00 level=info msg="Load GeoSite rule: cn"
2024-09-20 21:56:00 level=info msg="Geosite Matcher implementation: succinct"
2024-09-20 21:56:00 level=info msg="Geodata Loader mode: memconservative"
2024-09-20 21:56:00 level=info msg="Start initial configuration in progress"


### OpenClash Config

_No response_

### Expected Behavior

无 

### Additional Context

_No response_
@yxcqr
Copy link

yxcqr commented Sep 21, 2024

我也是,更新到这个版本,突然无法访问国内网站,
外网一切正常,正准备换回上一个版本!

@gemnioo
Copy link
Author

gemnioo commented Sep 21, 2024

更新 v0.46.032-beta 问题依旧, 再次尝试在备用机相同配置使用 v0.46.031-beta 相同的原因报错

搜索 mihomo 群组后没有找到原因 核对 ls /etc/openclash 内 GeoSite.dat GeoIP.dat 文件名称大小写正确

failed to decode geosite file 是否需要 opkg remove luci-app-openclash 后重新安装 ?

@gemnioo
Copy link
Author

gemnioo commented Sep 21, 2024

对比正常能够启动的日志 确认是 geosite.dat 文件无法读取导致的

2024-09-21 17:26:04 level=info msg="Initial configuration complete, total time: 3251ms"
2024-09-21 17:26:04 level=info msg="Finished initial GeoSite rule cn => dns.fake-ip-filter, records: 90172"
2024-09-21 17:26:04 level=info msg="Finished initial GeoIP rule cn => DIRECT, records: 18377"
2024-09-21 17:26:04 level=info msg="Finished initial GeoIP rule private => DIRECT, records: 18"
2024-09-21 17:26:04 level=info msg="Load GeoIP rule: private"
2024-09-21 17:26:04 level=info msg="Finished initial GeoIP rule cloudflare => 📌 手动选择, records: 897"
2024-09-21 17:26:04 level=info msg="Load GeoIP rule: cloudflare"
2024-09-21 17:26:04 level=info msg="Load GeoIP rule: cn"
2024-09-21 17:26:04 level=info msg="Finished initial GeoSite rule category-games@cn => DIRECT, records: 151"
2024-09-21 17:26:04 level=info msg="Load GeoSite rule: category-games@cn"
2024-09-21 17:26:04 level=info msg="Finished initial GeoSite rule steam@cn => DIRECT, records: 13"
2024-09-21 17:26:04 level=info msg="Load GeoSite rule: steam@cn"
2024-09-21 17:26:04 level=info msg="Finished initial GeoSite rule microsoft@cn => DIRECT, records: 144"
2024-09-21 17:26:04 level=info msg="Load GeoSite rule: microsoft@cn"
2024-09-21 17:26:04 level=info msg="Finished initial GeoSite rule adobe => REJECT, records: 263"
2024-09-21 17:26:04 level=info msg="Load GeoSite rule: adobe"
2024-09-21 17:26:01 level=info msg="Load GeoSite rule: cn"
2024-09-21 17:26:01 level=info msg="Geosite Matcher implementation: succinct"
2024-09-21 17:26:01 level=info msg="Geodata Loader mode: memconservative"
2024-09-21 17:26:01 level=info msg="Start initial configuration in progress"

@gemnioo
Copy link
Author

gemnioo commented Sep 21, 2024

okpg remove 重新安装 v0.46.032-beta 后, 依旧报错无法启动

2024-09-21 23:21:49 level=warning msg="failed to decode geosite file: GeoSite.dat, fallback to the original ReadFile method"
2024-09-21 23:21:49 level=info msg="Load GeoSite rule: cn"

@gemnioo
Copy link
Author

gemnioo commented Sep 22, 2024

备份能成功启动机器的 tar.gz 文件. 重置后上传就能启动!对比确认过两边 /etc/openclash/config 内配置

想不明白为什么. 并且昨晚是 okpg remove 重置安装的并物理断电重启的, 理应不该会有残留

#插件在卸载后会自动备份配置文件到 /tmp 目录下,除非路由器重启,在下次安装时将还原您的配置文件

@gemnioo gemnioo changed the title [Bug] 升级到 v0.46.031-beta 无法启动 GeoSite.dat decode & remove [Bug] 升级到 v0.46.031-beta 无法启动 “failed to decode geosite file” Sep 22, 2024
@CybertronCracker
Copy link

这题我会,实际大家需要去覆写设置-DNS设置-Fake-IP-Filter,勾选开启。这个问题迎刃而解,我应该是在022版本的时候遇到过。

@gemnioo
Copy link
Author

gemnioo commented Sep 22, 2024

这题我会,实际大家需要去覆写设置-DNS设置-Fake-IP-Filter,勾选开启。这个问题迎刃而解,我应该是在022版本的时候遇到过。

其他issue 提到031是大版本更新. 应该是卸载还是会保留配置 恢复默认再导入才不会残留. 而你所说的勾选. 我对比过两者的 /etc/config/openclash 文件內容(大致相似 但排列順序等不同

@CybertronCracker
Copy link

这题我会,实际大家需要去覆写设置-DNS设置-Fake-IP-Filter,勾选开启。这个问题迎刃而解,我应该是在022版本的时候遇到过。

其他issue 提到031是大版本更新. 应该是卸载还是会保留配置 恢复默认再导入才不会残留. 而你所说的勾选. 我对比过两者的 /etc/opencalsh/config enabl_fake_ip "1"

Fake-IP-Filter 和 Fake IP 概念应该是不一样的。
我根据你的标题写的 “failed to decode geosite file” 我也遇到过,重装了几次,不成功,恢复到014大版本。后面查了别人的案例后操作成功,在设置中开启Fake-IP-Filter 调用GeoSite.dat文件,openclash才不报错成功开启。我也是小白,以上经验仅供参考。

@gemnioo
Copy link
Author

gemnioo commented Sep 22, 2024

这题我会,实际大家需要去覆写设置-DNS设置-Fake-IP-Filter,勾选开启。这个问题迎刃而解,我应该是在022版本的时候遇到过。

其他issue 提到031是大版本更新. 应该是卸载还是会保留配置 恢复默认再导入才不会残留. 而你所说的勾选. 我对比过两者的 /etc/opencalsh/config enabl_fake_ip "1"

Fake-IP-Filter 和 Fake IP 概念应该是不一样的。

我根据你的标题写的 “failed to decode geosite file” 我也遇到过,重装了几次,不成功,恢复到014大版本。后面查了别人的案例后操作成功,在设置中开启Fake-IP-Filter 调用GeoSite.dat文件,openclash才不报错成功开启。我也是小白,以上经验仅供参考。

是的, 我两台机器卸载重装op 一步步填写配置都遇到 failed decode geosite file. 但我几台机器都开启了 fake ip filter. 另外我对比过前端相同配置但一台可以启动一台不行的 /etc/config/openclash 确认是卸载重装会保留默认配置(两版大致相同 但顺序等有差异. 所以大版本014升级 放弃原版内核, 应该先恢复默认配置再一步步填写或者导入

@gemnioo
Copy link
Author

gemnioo commented Sep 24, 2024

玄学? 更新了 GeoIP 以及 GeoSite 库就又无法成功启动了 !

2024-09-24 09:56:52 level=error msg="rules[272] [GEOIP,cloudflare,📌 手动选择,no-resolve] error: [GeoIP] failed to decode geodata file: GeoIP.dat, base error: proto: cannot parse invalid wire-format data"
2024-09-24 09:56:52 level=warning msg="Load GeoIP rule: cloudflare"
2024-09-24 09:56:52 level=warning msg="failed to decode geoip file: GeoIP.dat, fallback to the original ReadFile method"
2024-09-24 09:56:52 level=info msg="Load GeoIP rule: cloudflare"
2024-09-24 09:56:51 level=warning msg="GeoIP.dat invalid, remove and download: failed to decode geodata file: GeoIP.dat, base error: proto: cannot parse invalid wire-format data"
2024-09-24 09:56:51 level=warning msg="Load GeoIP rule: cn"
2024-09-24 09:56:51 level=warning msg="failed to decode geoip file: GeoIP.dat, fallback to the original ReadFile method"
2024-09-24 09:56:51 level=info msg="Load GeoIP rule: cn"
2024-09-24 09:56:51 level=info msg="Finished initial GeoSite rule category-games@cn => DIRECT, records: 151"
2024-09-24 09:56:51 level=info msg="Load GeoSite rule: category-games@cn"
2024-09-24 09:56:51 level=info msg="Finished initial GeoSite rule steam@cn => DIRECT, records: 13"
2024-09-24 09:56:51 level=info msg="Load GeoSite rule: steam@cn"
2024-09-24 09:56:51 level=info msg="Finished initial GeoSite rule microsoft@cn => DIRECT, records: 144"
2024-09-24 09:56:51 level=info msg="Load GeoSite rule: microsoft@cn"
2024-09-24 09:56:51 level=info msg="Finished initial GeoSite rule adobe => REJECT, records: 263"
2024-09-24 09:56:51 level=info msg="Load GeoSite rule: adobe"
2024-09-24 09:56:47 level=info msg="Load GeoSite rule: cn"
2024-09-24 09:56:47 level=info msg="Geosite Matcher implementation: succinct"
2024-09-24 09:56:47 level=info msg="Geodata Loader mode: memconservative"
2024-09-24 09:56:47 level=info msg="Start initial configuration in progress"

@gemnioo
Copy link
Author

gemnioo commented Sep 24, 2024

更新 GeoIP 以及 GeoSite后, 会出现 "failed to decode geosite/geoip file", 当前 Meta 内核 alpha-g59a2b24 openclash 版本 alpha-g59a2b24

okpg remove 重新安装 无效. 需要还原默认设置再导入当前配置才能成功启动. pls check this ~

@muscccm
Copy link

muscccm commented Sep 24, 2024

插件设置-GEO数据库订阅
勾选所有三个自动更新
每个自动更新下面出现的三个《检查并更新》全部点一遍。

@gemnioo
Copy link
Author

gemnioo commented Sep 24, 2024

插件设置-GEO数据库订阅 勾选所有三个自动更新 每个自动更新下面出现的三个《检查并更新》全部点一遍。

就因为点了检查并自动更新;原本能正常启动的变得 failed to decode geosite file

@muscccm
Copy link

muscccm commented Sep 24, 2024

插件设置-GEO数据库订阅 勾选所有三个自动更新 每个自动更新下面出现的三个《检查并更新》全部点一遍。

就因为点了检查并自动更新;原本能正常启动的变得 failed to decode geosite file

你全部三个都点了吗?

@gemnioo
Copy link
Author

gemnioo commented Sep 24, 2024

插件设置-GEO数据库订阅 勾选所有三个自动更新 每个自动更新下面出现的三个《检查并更新》全部点一遍。

就因为点了检查并自动更新;原本能正常启动的变得 failed to decode geosite file

你全部三个都点了吗?

唯一点了更新 Geosite, 确实有更新;更新完就无法启动. 看报错信息也是 Geosite decode failed. 这和三个更新都点没关系吧?

@gemnioo
Copy link
Author

gemnioo commented Sep 24, 2024

插件设置-GEO数据库订阅 勾选所有三个自动更新 每个自动更新下面出现的三个《检查并更新》全部点一遍。

就因为点了检查并自动更新;原本能正常启动的变得 failed to decode geosite file

你全部三个都点了吗?

原本无法启动不是因为不存在 Geosite GeoIP 库啊? 恢复默认配置后导入配置会携带 /etc/openclash 内的 Country.mmdb;GeoIP.dat ; GeoSite.dat;china_ip6_route.ipset;china_ip_route.ipset

@gemnioo
Copy link
Author

gemnioo commented Sep 25, 2024

解决方法是 插件设置-GEO数据库订阅 不要使用自定义的 GitHub 加速譬如

geox-url:                           
  geoip: "https://ghp.p3terx.com/https://raw.githubusercontent.com/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat"
  geosite: "https://ghp.p3terx.com/https://raw.githubusercontent.com/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat"
  mmdb: "https://ghp.p3terx.com/https://raw.githubusercontent.com/Loyalsoldier/geoip/release/Country-only-cn-private.mmdb"

换回默认的加速既可

https://testingcf.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat
https://testingcf.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat

测试以上两个加速下载后是相同的文件 但是自定义的会出现 “Geosite decode failed”

对比过两种方式 “提示:由于文件【 /etc/config/openclash 】被修改,暂停快速启动...” ;/etc/config/openclash 内的修改后配置

@gemnioo
Copy link
Author

gemnioo commented Sep 25, 2024

不知道以下两个选项是否会影响 Geosite Geoip 数据的加载?

覆写设置--Meta设置

“Geodata 数据加载方式”(停用)

“启用 GeoIP Dat 版数据库” (使用 Geoip Dat 替换 GEOIP MMDB 数据库, 文件体积较大且无内置, 请提前下载)

同时想请问 mihomo 的 geox-url 配置中 geoip 和 mmdb 都是IP规则. 是否是重复的? 还是前者是为了在 fallback-filter 中使用 后者是 geoip,cn direct. 查看 Loyalsoldier 维护的两个库目测是相同的. 除了文件格式的区别

MetaCubeX/mihomo#1083

mmdb 格式等的讨论

#4067

@gemnioo
Copy link
Author

gemnioo commented Oct 3, 2024

v0.46.038-beta 已经正常. 请不必修改默认的 GitHub 加速 Geosite 以及 GeoIP

@gemnioo gemnioo closed this as completed Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants