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

ERROR autoremovetorrents.exception.remotefailure.RemoteFailure: portTested: http error 400: Bad Request #135

Closed
lee911214 opened this issue May 31, 2022 · 12 comments
Labels
bug Something isn't working

Comments

@lee911214
Copy link

大佬 本地win下面运行tr后 显示400 看日志登进去了 但是后面就报错 不知道怎么回事 日志如下

Tue, 31 May 2022 09:24:02 main.py[line:51] INFO Auto Remove Torrents 1.5.3
Tue, 31 May 2022 09:24:02 main.py[line:53] INFO Loading configurations...
Tue, 31 May 2022 09:24:02 main.py[line:56] INFO Found 1 task(s) in the file.
Tue, 31 May 2022 09:24:02 task.py[line:138] INFO Running task 'tr'...
Tue, 31 May 2022 09:24:02 task.py[line:85] INFO Logging in...
Tue, 31 May 2022 09:24:02 task.py[line:87] INFO Login successfully. The client is Transmission 3.00 (bb6b5a062e).
Tue, 31 May 2022 09:24:02 task.py[line:88] INFO WebUI API version: 16
Tue, 31 May 2022 09:24:02 main.py[line:64] ERROR autoremovetorrents.exception.remotefailure.RemoteFailure: portTested: http error 400: Bad Request
Tue, 31 May 2022 09:24:02 main.py[line:65] ERROR Task tr fails.

@lee911214
Copy link
Author

配置如下

tr:
client: transmission
host: http://192.168.3.22:9091
username: *
password: *
strategies:
delete_by_restspace:
free_space:
min: 10 # size in GiB
path: G:\ # This Path MUST EXIST
action: remove-old-seeds
#不发车
stalled:
status:
- StalledDownload
remove: create_time > 86400
delete_data: true

@jerrymakesjelly
Copy link
Owner

#101 问题相同。在这里,实际上 autoremove-torrents 已经成功请求了 transmission,这个 HTTP 400 是 transmission 本身在查询端口开放状态时出现的问题,并不是 autoremove-torrents 在请求 transmission 时的问题,建议向 transmission 反馈。

然后,楼主是不是在 IPv6 的环境下做种?我去找了一下 transmission 的 issue,发现有人反馈 transmission 在 IPv6 环境下进行端口查询会出现 400 错误,不知道是否与你的问题相关 transmission/transmission#3102

@lee911214
Copy link
Author

lee911214 commented Jun 15, 2022

我这带宽既有v4,也有v6~ 这个v6怎么关? 如果是因为v6的话 那也不对啊 hz服务器也有v6 但是不会出现400啊

@jerrymakesjelly
Copy link
Owner

jerrymakesjelly commented Jun 16, 2022

原理上,Transmission 通过请求 https://portcheck.transmissionbt.com/{port} 这个URL来确定端口的开放情况,见 https://github.com/transmission/transmission/blob/d20b77a9aba731d3281983c4318d1fb050fd19b4/libtransmission/rpcimpl.cc#L1388

static char const* portTest(
    tr_session* session,
    tr_variant* /*args_in*/,
    tr_variant* /*args_out*/,
    struct tr_rpc_idle_data* idle_data)
{
    auto const port = session->peerPort();
    auto const url = fmt::format(FMT_STRING("https://portcheck.transmissionbt.com/{:d}"), port.host());
    session->web->fetch({ url, onPortTested, idle_data });
    return nullptr;
}

然后,portcheck.transmissionbt.com 这个域名同时具有 A 记录(IPv4)与 AAAA 记录(IPv6)。若使用 IPv6 访问,确实会出现 HTTP 400,这个可以用 wget 去验证,算是 transmission 的 bug

[root@vultrguest ~]# wget -6 https://portcheck.transmissionbt.com/9091
--2022-06-16 05:56:23--  https://portcheck.transmissionbt.com/9091
Resolving portcheck.transmissionbt.com (portcheck.transmissionbt.com)... 2001:41d0:c:5ac:5::1
Connecting to portcheck.transmissionbt.com (portcheck.transmissionbt.com)|2001:41d0:c:5ac:5::1|:443... connected.
HTTP request sent, awaiting response... 400 Bad Request
2022-06-16 05:56:24 ERROR 400: Bad Request.

hz服务器也有v6 但是不会出现400啊

这个我不确定,一般来说软件在访问 URL portcheck.transmissionbt.com 时会优先选择 IPv6,但如果选了 IPv4,其实也是合理的

@lee911214
Copy link
Author

lee911214 commented Jun 17, 2022

反馈一波,这个应该是大佬说的v6访问,可以改电脑的hosts文件 改为你的ip地址+portcheck.transmissionbt.com

@jerrymakesjelly
Copy link
Owner

嗯嗯,不过既然这个端口查询有bug而且其实对删种无关紧要,下一个版本我会考虑把它去掉

@jerrymakesjelly jerrymakesjelly added bug Something isn't working and removed wontfix This will not be worked on labels Jun 17, 2022
@lee911214
Copy link
Author

嗯嗯,不过既然这个端口查询有bug而且其实对删种无关紧要,下一个版本我会考虑把它去掉

好的,大佬你的意思下个版本取消对这个portcheck.transmissionbt.com端口访问是吗?

@jerrymakesjelly
Copy link
Owner

jerrymakesjelly commented Jun 17, 2022

Outgoing Port Status 删了,目前没有删种条件会参考这个。删了这个就不会触发 Transmission 对 portcheck.transmissionbt.com 的访问。

@lee911214
Copy link
Author

lee911214 commented Jun 17, 2022

Outgoing Port Status 删了,目前没有删种条件会参考这个。删了这个就不会触发 Transmission 对 portcheck.transmissionbt.com 的访问。

好来,辛苦大佬。想问下大佬下个版本啥时候发布? 已经迫不及待了,不然我的家宽只能把v6关了才能避免tr这bug 或者大佬告知我怎么把这个删了也行

jerrymakesjelly added a commit that referenced this issue Jun 18, 2022
We have confirmed a bug, which is, the Outgoing Port Status checker will fail and report 'portTested: http error 400: Bad
Request' when we are using Transmission and check the outgoing port status in IPv6 Network.

This bug will make the task failed, however, there are no removing
conditions relying on this status. Therefore we remove it.

Closes #101, #135.

This bug is in Transmission, which can be referred to transmission/transmission#3102, not in our software.
jerrymakesjelly added a commit that referenced this issue Jun 18, 2022
We have confirmed a bug, which is, the Outgoing Port Status checker will
fail and report 'portTested: http error 400: Bad Request' when we are
using Transmission and check the outgoing port status in IPv6 Network.

This bug will make the task failed, however, there are no removing
conditions relying on this port status. Therefore we remove it.

Closes #101, #135.

This bug is in Transmission, which can be referred to
transmission/transmission#3102, not in our software.
@jerrymakesjelly
Copy link
Owner

想问下大佬下个版本啥时候发布?

已经去除 Outgoing Port Status 并且推送至 dev 分支了,可以尝试安装使用 dev 分支的 autoremove-torrents。

pip3 uninstall autoremove-torrents # 卸载旧版本
git clone https://github.com/jerrymakesjelly/autoremove-torrents.git
cd autoremove-torrents
git checkout dev
python3 setup.py install --user # 安装

预计这几天会将 dev 分支打包发布新版本。

@lee911214
Copy link
Author

想问下大佬下个版本啥时候发布?

已经去除 Outgoing Port Status 并且推送至 dev 分支了,可以尝试安装使用 dev 分支的 autoremove-torrents。

pip3 uninstall autoremove-torrents # 卸载旧版本
git clone https://github.com/jerrymakesjelly/autoremove-torrents.git
cd autoremove-torrents
git checkout dev
python3 setup.py install --user # 安装

预计这几天会将 dev 分支打包发布新版本。

感谢大佬 已经用上了 果然去除了tr的bug 这下好多了,完美运行

@jerrymakesjelly
Copy link
Owner

1.5.4 版本已发布,所以关闭此 issue

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

2 participants