Closed terrytw closed 2 years ago
这个日志不全。只有后半部分。应该前面还有。
markdown不熟悉,把第一行吃掉了... 其实就差了一行 已经补充进去了
定位了。是 adhome 的bug。
adhome fastip 的 bug,mosdns 不好修。建议先别开 fastip 。
adhome fastip 的 bug,mosdns 不好修。建议先别开 fastip 。
收到,多谢
FYI, 这个 bug 跟新版本没关系,估计从 mosdns 一开始就存在了。
这个 bug 的起因也很奇怪。是因为你的 mosdns 收到了一个奇怪的没有任何意义的空白的请求。(只有数据头,没有任何请求信息的请求)。
FYI, 这个 bug 跟新版本没关系,估计从 mosdns 一开始就存在了。
这个 bug 的起因也很奇怪。是因为你的 mosdns 收到了一个奇怪的没有任何意义的空白的请求。(只有数据头,没有任何请求信息的请求)。
我退回2.0试试... 以前是真的没有过
~adhome fastip 的 bug,mosdns 不好修。~
曲线救国 √
我想说可能有什么隐藏的原因触发了这个问题 因为我退回2.0之后,完全没出现任何问题
配置贴一下?
以及用的是 v2 的哪一版?v2.0.0?
同样配置2.0.0 和2.1.2都用过一段时间
################################# 日志设定
log:
level: info
file: ""
plugin:
################################# 可执行插件
- tag: default
type: sequence
args:
exec:
# 屏蔽广告和特定域名
- if:
- match_ad_domain # 匹配已知的屏蔽域名
exec:
- _block_with_nxdomain # 屏蔽
- _end # 结束
- _single_flight # 去重
- if:
- match_foreign_domain # 匹配国外域名
exec:
- forward_remote # 转发至远程服务器
- _end
- forward_local # 转发至本地服务器,获取应答
- if:
- match_cn_domain # 匹配中国域名
- match_cn_ip # 匹配中国IP
exec:
- _end
# 剩余请求(既不是已知的域名,也没有返回中国IP)
- forward_remote # 转发至远程服务器,获取应答(之前的应答会被复写)
- _end
- tag: forward_local
type: sequence
args:
exec:
- primary: # 主要执行序列。
- forward_local_primary
secondary: # 次要执行序列。
- forward_local_secondary
stat_length: 10 # 统计长度。默认 10。
threshold: 5 # fallback 触发阈值。不可大于统计长度。默认 5。
fast_fallback: 200 # 快速 fallback 触发阈值。单位: 毫秒。默认: 0,禁用快速 fallback。
# 参考建议: 设为 `primary` 正常延时的 3-5 倍。
always_standby: false # secondary 始终待命。仅用于快速 fallback。
- tag: forward_remote
type: sequence
args:
exec:
- primary: # 主要执行序列。
- forward_remote_primary
secondary: # 次要执行序列。
- forward_remote_secondary
stat_length: 10 # 统计长度。默认 10。
threshold: 5 # fallback 触发阈值。不可大于统计长度。默认 5。
fast_fallback: 900 # 快速 fallback 触发阈值。单位: 毫秒。默认: 0,禁用快速 fallback。
# 参考建议: 设为 `primary` 正常延时的 3-5 倍。
always_standby: true # secondary 始终待命。仅用于快速 fallback。
- tag: forward_local_primary # 转发至本地服务器
type: forward
args:
upstream:
- addr: https://223.5.5.5/dns-query
ip_addr:
- 223.5.5.5
- addr: https://doh.pub/dns-query
bootstrap:
- "https://223.5.5.5/dns-query"
timeout: 10 # 超时时间,单位: 秒。
insecure_skip_verify: false # 禁用 TLS 身份验证。
fastest_ip: true # 最快 IP 模式。
- tag: forward_local_secondary # 转发至本地备用服务器
type: forward
args:
upstream:
- addr: https://doh.360.cn/dns-query
bootstrap:
- "https://223.5.5.5/dns-query"
timeout: 10 # 超时时间,单位: 秒。
insecure_skip_verify: false # 禁用 TLS 身份验证。
fastest_ip: true # 最快 IP 模式。
- tag: forward_remote_primary # 转发至远程服务器
type: forward
args:
upstream:
- addr: https://1.0.0.1/dns-query
ip_addr:
- 1.0.0.1
trusted: true
- addr: https://8.8.8.8/dns-query
ip_addr:
- 8.8.8.8
trusted: true
timeout: 10 # 超时时间,单位: 秒。
insecure_skip_verify: false # 禁用 TLS 身份验证。
fastest_ip: true # 最快 IP 模式。
- tag: forward_remote_secondary # 转发至远程备用服务器
type: forward
args:
upstream:
- addr: https://private.canadianshield.cira.ca/dns-query
ip_addr:
- 149.112.121.10
trusted: true
timeout: 10 # 超时时间,单位: 秒。
insecure_skip_verify: false # 禁用 TLS 身份验证。
fastest_ip: true # 最快 IP 模式。
############################### 匹配器插件
- tag: match_cn_domain # 匹配请求域名是否是中国域名
type: query_matcher
args:
domain:
- ext:./geosite.dat:cn
- tag: match_foreign_domain # 匹配请求域名是否是国外域名
type: query_matcher
args:
domain:
- ext:./geosite.dat:geolocation-!cn
- tag: match_ad_domain # 匹配请求域名是否是geosite广告域名
type: query_matcher
args:
domain:
- ext:./geosite.dat:category-ads-all
- tag: match_cn_ip # 匹配应答的 IP 是否是中国IP
type: response_matcher
args:
ip:
- ext:./chn.list
################################# 启动服务器
- tag: main_server
type: server
args:
entry: default # 入口路由插件。该服务器收到的请求将会送至这里处理。
max_concurrent_queries: 0
server:
- protocol: udp
addr: 127.0.0.1:*
- protocol: tcp
addr: 127.0.0.1:*
- protocol: udp
addr: "[::1]:*
- protocol: tcp
addr: "[::1]:*"
神奇。这两个版本我用生成的请求测试过了。一发入魂,必蹦。
也许是之前还没有出现奇怪的请求,恰好v3更新后出现,然后你刚刚回退版本也没出现。
正常使用,每隔一段时间就崩溃,5-15分钟不等
5-15分钟不等 看来是随机的。
我瞎猜的: 首先adguard home 遇到空请求会崩是一直存在的
但是2.1.2-3.0.0之间的某个版本开始出现了一个bug,会生成空请求
首先adguard home 遇到空请求会崩是一直存在的
√
但这个空请求应该不是 mosdns 生成,mosdns从来不会改请求最核心的Question部分。更像是收到的。
我这两天测试了2.0.0,2.1.2,2.2.2,3.0.0 就3.0.0会出现这个问题 之前版本用很久也没问题
开了debug模式 崩溃前会出现以下内容 然后log就断了,控制台报错和主楼内容一致 绝对是3.0.0引起的...
2022-01-08T02:59:06.187Z debug handler/plugin_wrapper.go:76 executing plugin {"query": "empty question 0 49 路由器的公网IP", "tag": "default"}
2022-01-08T02:59:06.187Z debug handler/plugin_wrapper.go:76 executing plugin {"query": "empty question 0 50 路由器的公网IP", "tag": "default"}
2022-01-08T02:59:06.187Z debug handler/plugin_wrapper.go:59 matching query context {"query": "empty question 0 49 路由器的公网IP", "tag": "match_ad_domain", "result": false}
2022-01-08T02:59:06.187Z debug handler/plugin_wrapper.go:59 matching query context {"query": "empty question 0 49 路由器的公网IP", "tag": "match_StevenBlack_domain", "result": false}
2022-01-08T02:59:06.187Z debug handler/plugin_wrapper.go:59 matching query context {"query": "empty question 0 50 路由器的公网IP", "tag": "match_ad_domain", "result": false}
2022-01-08T02:59:06.187Z debug handler/plugin_wrapper.go:59 matching query context {"query": "empty question 0 50 路由器的公网IP", "tag": "match_StevenBlack_domain", "result": false}
2022-01-08T02:59:06.187Z debug handler/plugin_wrapper.go:59 matching query context {"query": "empty question 0 50 路由器的公网IP", "tag": "match_anti-AD_domain", "result": false}
2022-01-08T02:59:06.187Z debug handler/plugin_wrapper.go:59 matching query context {"query": "empty question 0 50 路由器的公网IP", "tag": "match_custom_domain", "result": false}
2022-01-08T02:59:06.187Z debug handler/plugin_wrapper.go:76 executing plugin {"query": "empty question 0 50 路由器的公网IP", "tag": "_single_flight"}
2022-01-08T02:59:06.187Z debug handler/plugin_wrapper.go:59 matching query context {"query": "empty question 0 50 路由器的公网IP", "tag": "match_foreign_domain", "result": false}
2022-01-08T02:59:06.187Z debug handler/plugin_wrapper.go:76 executing plugin {"query": "empty question 0 50 路由器的公网IP", "tag": "forward_local"}
2022-01-08T02:59:06.187Z debug handler/plugin_wrapper.go:59 matching query context {"query": "empty question 0 49 路由器的公网IP", "tag": "match_anti-AD_domain", "result": false}
2022-01-08T02:59:06.187Z debug handler/plugin_wrapper.go:59 matching query context {"query": "empty question 0 49 路由器的公网IP", "tag": "match_custom_domain", "result": false}
2022-01-08T02:59:06.187Z debug handler/plugin_wrapper.go:76 executing plugin {"query": "empty question 0 49 路由器的公网IP", "tag": "_single_flight"}
2022-01-08T02:59:06.187Z debug handler/plugin_wrapper.go:76 executing plugin {"query": "empty question 0 50 路由器的公网IP", "tag": "forward_local_primary"}
2022-01-08T02:59:06.388Z debug handler/plugin_wrapper.go:76 executing plugin {"query": "empty question 0 50 路由器的公网IP", "tag": "forward_local_secondary"}
log 能再往前一些吗。我想看看最开始收到的数据是什么样子。
呃,邮箱发给你完整的log吧,可否给个邮箱地址
额,不方便。
这个吧。注意到这行 {"query": "empty question 0 49 路由器的公网IP",
有个 49 么。这是唯一的请求 ID,而且是递增的。你看看最开始 49 出现在什么地方。
好了。√
所有版本都有问题。v2 版没发生是纯属因为运气,概率小。
好的,明白啦
升级了最新版后发现 mosdns不崩溃了 但是empty question 依然存在
而且进一步发现,是android adguard导致的
因为我用mosdns开了一个非标端口的DOH服务器,然后用android adguard去连 发现android adguard连过去就是empty question 而且mosdns日志里对面的IP是我手机的IP 日志如下
Wed Jan 26 08:18:57 2022 daemon.err mosdns[32530]: 2022-01-26T00:18:57.736Z warn forward_local_primary bundled_upstream/bundled_upstream.go:91 upstream failed {"query": "empty question 0 3617 140.207.23.126", "from": "https://223.5.5.5:443/dns-query", "error": "requesting https://223.5.5.5:443/dns-query: Get \"https://223.5.5.5:443/dns-query?dns=AAAAAAAAAAAAAAAA\": stream error: stream ID 3655; INTERNAL_ERROR; received from peer"}
Wed Jan 26 08:19:15 2022 daemon.err mosdns[32530]: 2022-01-26T00:19:15.413Z warn forward_local_primary bundled_upstream/bundled_upstream.go:91 upstream failed {"query": "empty question 0 3619 140.207.23.126", "from": "https://223.5.5.5:443/dns-query", "error": "requesting https://223.5.5.5:443/dns-query: Get \"https://223.5.5.5:443/dns-query?dns=AAAAAAAAAAAAAAAA\": stream error: stream ID 3659; INTERNAL_ERROR; received from peer"}
Wed Jan 26 08:19:20 2022 daemon.err mosdns[32530]: 2022-01-26T00:19:20.722Z warn forward_local_primary bundled_upstream/bundled_upstream.go:91 upstream failed {"query": "empty question 0 3620 140.207.23.126", "from": "https://223.5.5.5:443/dns-query", "error": "requesting https://223.5.5.5:443/dns-query: Get \"https://223.5.5.5:443/dns-query?dns=AAAAAAAAAAAAAAAA\": stream error: stream ID 3661; INTERNAL_ERROR; received from peer"}
Wed Jan 26 08:19:25 2022 daemon.err mosdns[32530]: 2022-01-26T00:19:25.643Z warn forward_local_primary bundled_upstream/bundled_upstream.go:91 upstream failed {"query": "empty question 0 3621 140.207.23.126", "from": "https://223.5.5.5:443/dns-query", "error": "requesting https://223.5.5.5:443/dns-query: Get \"https://223.5.5.5:443/dns-query?dns=AAAAAAAAAAAAAAAA\": stream error: stream ID 3663; INTERNAL_ERROR; received from peer"}
Wed Jan 26 08:19:32 2022 daemon.err mosdns[32530]: 2022-01-26T00:19:32.809Z warn forward_local_primary bundled_upstream/bundled_upstream.go:91 upstream failed {"query": "empty question 0 3622 140.207.23.126", "from": "https://223.5.5.5:443/dns-query", "error": "requesting https://223.5.5.5:443/dns-query: Get \"https://223.5.5.5:443/dns-query?dns=AAAAAAAAAAAAAAAA\": stream error: stream ID 3665; INTERNAL_ERROR; received from peer"}
Wed Jan 26 08:19:34 2022 daemon.err mosdns[32530]: 2022-01-26T00:19:34.821Z warn forward_local_primary bundled_upstream/bundled_upstream.go:91 upstream failed {"query": "empty question 0 3623 140.207.23.126", "from": "https://223.5.5.5:443/dns-query", "error": "requesting https://223.5.5.5:443/dns-query: Get \"https://223.5.5.5:443/dns-query?dns=AAAAAAAAAAAAAAAA\": stream error: stream ID 3667; INTERNAL_ERROR; received from peer"}
Wed Jan 26 08:19:37 2022 daemon.err mosdns[32530]: 2022-01-26T00:19:37.503Z warn forward_local_primary bundled_upstream/bundled_upstream.go:91 upstream failed {"query": "empty question 0 3625 140.207.23.126", "from": "https://223.5.5.5:443/dns-query", "error": "requesting https://223.5.5.5:443/dns-query: Get \"https://223.5.5.5:443/dns-query?dns=AAAAAAAAAAAAAAAA\": stream error: stream ID 3671; INTERNAL_ERROR; received from peer"}
Wed Jan 26 08:19:37 2022 daemon.err mosdns[32530]: 2022-01-26T00:19:37.702Z warn forward_local_primary bundled_upstream/bundled_upstream.go:91 upstream failed {"query": "empty question 0 3626 140.207.23.126", "from": "https://223.5.5.5:443/dns-query", "error": "requesting https://223.5.5.5:443/dns-query: Get \"https://223.5.5.5:443/dns-query?dns=AAAAAAAAAAAAAAAA\": stream error: stream ID 3673; INTERNAL_ERROR; received from peer"}
Wed Jan 26 08:19:39 2022 daemon.err mosdns[32530]: 2022-01-26T00:19:39.812Z warn forward_local_primary bundled_upstream/bundled_upstream.go:91 upstream failed {"query": "empty question 0 3627 140.207.23.126", "from": "https://223.5.5.5:443/dns-query", "error": "requesting https://223.5.5.5:443/dns-query: Get \"https://223.5.5.5:443/dns-query?dns=AAAAAAAAAAAAAAAA\": stream error: stream ID 3675; INTERNAL_ERROR; received from peer"}
Wed Jan 26 08:19:42 2022 daemon.err mosdns[32530]: 2022-01-26T00:19:42.514Z warn forward_local_primary bundled_upstream/bundled_upstream.go:91 upstream failed {"query": "empty question 0 3628 140.207.23.126", "from": "https://223.5.5.5:443/dns-query", "error": "requesting https://223.5.5.5:443/dns-query: Get \"https://223.5.5.5:443/dns-query?dns=AAAAAAAAAAAAAAAA\": stream error: stream ID 3677; INTERNAL_ERROR; received from peer"}
Wed Jan 26 08:19:42 2022 daemon.err mosdns[32530]: 2022-01-26T00:19:42.698Z warn forward_local_primary bundled_upstream/bundled_upstream.go:91 upstream failed {"query": "empty question 0 3629 140.207.23.126", "from": "https://223.5.5.5:443/dns-query", "error": "requesting https://223.5.5.5:443/dns-query: Get \"https://223.5.5.5:443/dns-query?dns=AAAAAAAAAAAAAAAA\": stream error: stream ID 3679; INTERNAL_ERROR; received from peer"}
Wed Jan 26 08:19:44 2022 daemon.err mosdns[32530]: 2022-01-26T00:19:44.830Z warn forward_local_primary bundled_upstream/bundled_upstream.go:91 upstream failed {"query": "empty question 0 3630 140.207.23.126", "from": "https://223.5.5.5:443/dns-query", "error": "requesting https://223.5.5.5:443/dns-query: Get \"https://223.5.5.5:443/dns-query?dns=AAAAAAAAAAAAAAAA\": stream error: stream ID 3681; INTERNAL_ERROR; received from peer"}
Wed Jan 26 08:20:09 2022 daemon.err mosdns[32530]: 2022-01-26T00:20:09.850Z warn forward_local_primary bundled_upstream/bundled_upstream.go:91 upstream failed {"query": "empty question 0 3634 140.207.23.126", "from": "https://223.5.5.5:443/dns-query", "error": "requesting https://223.5.5.5:443/dns-query: Get \"https://223.5.5.5:443/dns-query?dns=AAAAAAAAAAAAAAAA\": stream error: stream ID 3689; INTERNAL_ERROR; received from peer"}
Wed Jan 26 08:20:11 2022 daemon.err mosdns[32530]: 2022-01-26T00:20:11.982Z warn forward_local_primary bundled_upstream/bundled_upstream.go:91 upstream failed {"query": "empty question 0 3641 140.207.23.126", "from": "https://223.5.5.5:443/dns-query", "error": "requesting https://223.5.5.5:443/dns-query: Get \"https://223.5.5.5:443/dns-query?dns=AAAAAAAAAAAAAAAA\": stream error: stream ID 3699; INTERNAL_ERROR; received from peer"}
你自己编译然后更新一下 master 最新的 HEAD。有可能解决问题。
好的,晚上试试
的确解决了...
过年前发个新版本如何...
正常使用,每隔一段时间就崩溃,5-15分钟不等 原设置在2.0.0一切正常
mosdns 的 log 记录:
环境
mosdns 的版本号(
mosdns -v
):3.0.0操作系统和平台:openwrt amd64