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

Cronet 随机回退到 TCP 连接导致被重置 #1

Closed
3 of 4 tasks
iiikunn opened this issue Oct 9, 2023 · 27 comments
Closed
3 of 4 tasks

Cronet 随机回退到 TCP 连接导致被重置 #1

iiikunn opened this issue Oct 9, 2023 · 27 comments
Labels
bug Something isn't working

Comments

@iiikunn
Copy link

iiikunn commented Oct 9, 2023

复现步骤 / Step to reproduce

如上

预期行为 / Expected behaviour

直连ex

实际行为 / Actual Behaviour

出现“奇怪的错误”提示

应用日志 / App logs

No response

备注 / Addition details

No response

EhViewer 版本号 / EhViewer version code

1.8.9.7

EhViewer CI 版本 / EhViewer CI Version

8e8706b

Android 系统版本 / Android version

miui14

设备型号 / Device model

红米12turbo

SoC 型号 / Soc model

7gen2

自查步骤 / Verify steps

  • 如果您有足够的时间和能力,并愿意为此提交 PR ,请勾上此复选框 / Pull request is welcome. Check this if you want to start a pull request
  • 您已搜索过 Issue Tracker,没有找到类似内容 / I have searched on Issue Tracker, No duplicate or related open issue has been found
  • 您确保这个 Issue 只提及一个问题。如果您有多个问题报告,烦请发起多个 Issue / Ensure there is only one bug report in this issue. Please make mutiply issue for mutiply bugs
  • 您确保已使用最新 CI 版本测试,并且该问题在最新 CI 版本中并未解决 / This bug have not solved in latest CI version
@iiikunn iiikunn added the bug Something isn't working label Oct 9, 2023
@UjuiUjuMandan
Copy link
Owner

UjuiUjuMandan commented Oct 10, 2023

我想要帮忙,但是你提供的信息有点少。

  1. 画廊站点切到 e-hentai 能访问吗?
  2. 浏览器能否访问 https://skk.moe
  3. 什么运营商?
  4. MIUI 14 的 Android 版本为何?

@UjuiUjuMandan
Copy link
Owner

我刚才使用了一个没有 exhentai 权限的帐号来测试:画廊站点为 exhentai 时,访问收藏会显示“奇怪的错误”、其他页面会显示“空页面”。

错误在于,此处应该显示“Sad Panda”来提示用户其没有权限,而不是显示如上所述的内容。

我觉得你的帐号是否只是简单地没有 exhentai 权限呢?你在浏览器登陆后能够访问 exhentai 呢?

@iiikunn
Copy link
Author

iiikunn commented Oct 10, 2023

感谢。
1、可以
2、可以
3、联通
4、安卓13
刚刚尝试了一下,使用联通的流量进入成功,但是更换网络后就无法访问了(比如在不关闭流量的情况下连接WIFI,并且刷新页面,就会在短暂转圈后提示奇怪的错误。此时,关闭WIFI,切换回流量也无法访问,重启软件也是。但是随意挂一个区域的梯子,哪怕是香港,可以访问)。
具体触发条件似乎是 进入EHviewer→更换网络→刷新页面,之后就会转圈然后提示奇怪的错误。但是似乎过一段时间就会恢复?如果需要log文件我可以提供。

@iiikunn
Copy link
Author

iiikunn commented Oct 10, 2023

比较奇怪的是,刚刚在反馈过程中,我再次尝试进入里站,成功了。十分钟前我刚刚尝试更换网络操作并出现奇怪的错误,现在却又可以借助流量访问了。中途没有再切换网络。

@iiikunn
Copy link
Author

iiikunn commented Oct 10, 2023

呃,刚刚打字过程中再切回去,又变成了奇怪的错误🧐

@UjuiUjuMandan
Copy link
Owner

@iiikunn 麻烦提供日志,复现一次“奇怪的错误”之后使用 设置-高级-导出日志 。
另外请试试这个版本看报错为何: https://github.com/UjuiUjuMandan/EhViewer/actions/runs/6464693427

@iiikunn
Copy link
Author

iiikunn commented Oct 10, 2023

感谢。
不管是更新前还是更新后,都是根本进不去
然后提示奇怪的错误。
联通直连。
1log是更新前的log
2log是更新后的log

通过百度网盘分享的文件

@UjuiUjuMandan
Copy link
Owner

UjuiUjuMandan commented Oct 10, 2023

1log-2023-10-10-12-41-20-812.zip
2log-2023-10-10-12-44-12-786.zip

10-10 12:43:58.694 18693 29603 D EhEngine: https://exhentai.org/
10-10 12:43:59.127 18693 18693 W System.err: java.io.IOException: java.util.concurrent.ExecutionException: zj0: Exception in CronetUrlRequest: net::ERR_CONNECTION_RESET, ErrorCode=8, InternalErrorCode=-101, Retryable=true

@FooIbar 来看看为啥会这样呢?addQuicHint 里有 exhentai.org ,用了 QUIC 还能被 RESET ?

@UjuiUjuMandan
Copy link
Owner

UjuiUjuMandan commented Oct 10, 2023

@iiikunn 你有电脑吗?对 Chromium 内核的浏览器,在其快捷方式的“目标” 后加入

 --enable-quic --origin-to-force-quic-on="exhentai.org:443, forums.e-hentai.org:443" --host-resolver-rules="MAP forums.e-hentai.org skk.moe, MAP exhentai.org skk.moe" 

然后打开它,访问 https://exhentai.org 。看看能正常看到白屏还是有别的错误。

@lukemin
Copy link

lukemin commented Oct 10, 2023

logcat-2023-10-10-13-33-15-877.txt
我的也是显示奇怪的错误。用的最新版的ci版本

@lukemin
Copy link

lukemin commented Oct 10, 2023

@iiikunn 你有电脑吗?对 Chromium 内核的浏览器,在其快捷方式的“目标” 后加入

 --enable-quic --origin-to-force-quic-on="exhentai.org:443, forums.e-hentai.org:443" --host-resolver-rules="MAP forums.e-hentai.org skk.moe, MAP exhentai.org skk.moe" 

然后打开它,访问 https://exhentai.org 。看看能正常看到白屏还是有别的错误。

结果是 ERR_CONNECTION_TIMED_OUT

@UjuiUjuMandan
Copy link
Owner

结果是 ERR_CONNECTION_TIMED_OUT

那应该是访问 skk.moe 的 IP 时超时罢,把 2 个 skk.moe 更换为比如 dash.cloudflare.com 或者 cdn.sstatic.net 呢?

@lukemin
Copy link

lukemin commented Oct 10, 2023

cdn.sstatic.net

"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --enable-quic --origin-to-force-quic-on="exhentai.org:443, forums.e-hentai.org:443" --host-resolver-rules="MAP forums.e-hentai.org cdn.sstatic.net, MAP exhentai.org cdn.sstatic.net"

"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --enable-quic --origin-to-force-quic-on="exhentai.org:443, forums.e-hentai.org:443" --host-resolver-rules="MAP forums.e-hentai.org dash.cloudflare.com, MAP exhentai.org dash.cloudflare.com"

都试了,一样的结果

@UjuiUjuMandan
Copy link
Owner

都试了,一样的结果

绷...难不成所有 Cloudflare 的 IP 在你地区都被封锁了...还是因为对 Edge 所以这些参数不生效...

@lukemin
Copy link

lukemin commented Oct 10, 2023

没有,我可以直连 Cloudflare.com和skk.moe

@iiikunn
Copy link
Author

iiikunn commented Oct 10, 2023

@iiikunn 你有电脑吗?对 Chromium 内核的浏览器,在其快捷方式的“目标” 后加入

 --enable-quic --origin-to-force-quic-on="exhentai.org:443, forums.e-hentai.org:443" --host-resolver-rules="MAP forums.e-hentai.org skk.moe, MAP exhentai.org skk.moe" 

然后打开它,访问 https://exhentai.org 。看看能正常看到白屏还是有别的错误。

我在上课,稍等,谷歌浏览器可以吗

@iiikunn
Copy link
Author

iiikunn commented Oct 10, 2023

@iiikunn 你有电脑吗?对 Chromium 内核的浏览器,在其快捷方式的“目标” 后加入

 --enable-quic --origin-to-force-quic-on="exhentai.org:443, forums.e-hentai.org:443" --host-resolver-rules="MAP forums.e-hentai.org skk.moe, MAP exhentai.org skk.moe" 

然后打开它,访问 https://exhentai.org 。看看能正常看到白屏还是有别的错误。

尝试过了,无论是否使用VPN,可以加载出白屏。还没登录账号尝试能不能进入

@iiikunn
Copy link
Author

iiikunn commented Oct 10, 2023

@iiikunn 你有电脑吗?对 Chromium 内核的浏览器,在其快捷方式的“目标” 后加入

 --enable-quic --origin-to-force-quic-on="exhentai.org:443, forums.e-hentai.org:443" --host-resolver-rules="MAP forums.e-hentai.org skk.moe, MAP exhentai.org skk.moe" 

然后打开它,访问 https://exhentai.org 。看看能正常看到白屏还是有别的错误。

我使用的是谷歌浏览器

@iiikunn
Copy link
Author

iiikunn commented Oct 11, 2023

请问还需要别的支持吗?

@UjuiUjuMandan
Copy link
Owner

请问还需要别的支持吗?

我复现不了,所以修不了。

@iiikunn
Copy link
Author

iiikunn commented Oct 11, 2023

请问还需要别的支持吗?

我复现不了,所以修不了。

感谢。就这样吧。
另外,或许作者您可以通过上一位维护者寻求支持。听说他的版本依旧可用。

@UjuiUjuMandan
Copy link
Owner

UjuiUjuMandan commented Oct 12, 2023

已经复现此现象,exhentai 和 e-hentai 都会出现。目前原因我猜测是 QUIC 连接失败一次或多次导致 cronet 回退到了 TCP 连接,后者导致连接被 GFW 重置。

必须让 QUIC 连接失败一次才能复现。方法:

  1. 连接到特定的 WLAN ,并关闭蜂窝网络。
  2. 我此处的 WLAN 要求登陆,未登陆时无法访问互联网,对 HTTP 连接会劫持到登录页面,对 HTTPS 也会使用自签证书劫持。在 EhViewer 中刷新会看到 ERR_AUTHORITY_INVALID ,说明已经回退到 TCP 连接。
  3. 恢复网络连接(要么在 WLAN 中登陆要么恢复蜂窝网络),此时 EhViewer 仍会使用 TCP 连接,不再尝试 QUIC ,这导致所有连接都被 GFW 重置。

@UjuiUjuMandan UjuiUjuMandan changed the title 似乎并不能直连访问exhentai cronet 随机回退到 TCP 连接导致被重置 Oct 12, 2023
@UjuiUjuMandan
Copy link
Owner

QUIC 只在第一次连接时被使用,失败就会回退 TCP ,被重置。查了没有禁用回退的方法。

@UjuiUjuMandan UjuiUjuMandan closed this as not planned Won't fix, can't repro, duplicate, stale Oct 12, 2023
@UjuiUjuMandan
Copy link
Owner

UjuiUjuMandan commented Oct 12, 2023

那么为什么会失败呢?肯定是指定的 Cloudflare IP 连通性不够好。目前是硬编码了 skk.moe ,未来可能会让使用者自定要 MAP 到什么 域名/IP 。

现在可以设定 Cloudflare IP 了:0f397da

This was referenced Oct 28, 2023
@UjuiUjuMandan UjuiUjuMandan pinned this issue Nov 15, 2023
@UjuiUjuMandan UjuiUjuMandan changed the title cronet 随机回退到 TCP 连接导致被重置 Cronet 随机回退到 TCP 连接导致被重置 Nov 27, 2023
@Pantyhose-X
Copy link

Pantyhose-X commented Nov 29, 2023

感谢。 1、可以 2、可以 3、联通 4、安卓13 刚刚尝试了一下,使用联通的流量进入成功,但是更换网络后就无法访问了(比如在不关闭流量的情况下连接WIFI,并且刷新页面,就会在短暂转圈后提示奇怪的错误。此时,关闭WIFI,切换回流量也无法访问,重启软件也是。但是随意挂一个区域的梯子,哪怕是香港,可以访问)。 具体触发条件似乎是 进入EHviewer→更换网络→刷新页面,之后就会转圈然后提示奇怪的错误。但是似乎过一段时间就会恢复?如果需要log文件我可以提供。

WiFi更改DNS
SIM卡修改APN設置

我修改hosts 使用台灣谷歌服務器, 直連Google
, f-droid twitch element等 也經常會 ERR_AUTHORITY_INVALID

@UjuiUjuMandan
Copy link
Owner

@Pantyhose-X 你说错误和我提到的没有任何关系。

EhViewer 内置 Hosts 和 DoH 应对 DNS 污染,不需要修改 APN 和 WiFi 设置。

@UjuiUjuMandan
Copy link
Owner

UjuiUjuMandan commented Dec 27, 2023

自定要 MAP 到什么 域名/IP 。

除了在 Cloudflare IP Override 中自选 IP 之外,也可以直接不用 Cronet ,选择 OkHttp ,这会让他回到域前置。

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 1, 2024
@UjuiUjuMandan UjuiUjuMandan unpinned this issue Jan 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants