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

[错误报告]: transmission不能正确访问https地址 #3660

Closed
4 tasks done
xmt328 opened this issue Jan 2, 2025 · 8 comments · Fixed by #3683
Closed
4 tasks done

[错误报告]: transmission不能正确访问https地址 #3660

xmt328 opened this issue Jan 2, 2025 · 8 comments · Fixed by #3683
Labels
bug Something isn't working

Comments

@xmt328
Copy link

xmt328 commented Jan 2, 2025

确认

  • 我的版本是最新版本,我的版本号与 version 相同。
  • 我已经 issue 中搜索过,确认我的问题没有被提出过。
  • 我已经 Telegram频道 中搜索过,确认我的问题没有被提出过。
  • 我已经修改标题,将标题中的 描述 替换为我遇到的问题。

当前程序版本

2.1.7

运行环境

Docker

问题类型

主程序运行问题

问题描述

image
下载器设置的是https地址,但是日志报错显示是以http形式访问的

transmission部署在同一台服务器,dns会解析为内网地址,不知道和这个有没有关系

发生问题时系统日志和配置文件

INFO:    transmission.py - 正在连接 transmission:*.*.*:9091
Error: %s
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/transmission_rpc/client.py", line 241, in _request
    data: ResponseData = json.loads(http_data)
                         ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Request: "{'tag': 0, 'method': <RpcMethod.SessionGet: 'session-get'>, 'arguments': {}}"
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/transmission_rpc/client.py", line 241, in _request
    data: ResponseData = json.loads(http_data)
                         ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
HTTP data: "<html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<center>The plain HTTP request was sent to HTTPS port</center>
<hr><center>nginx/1.22.1</center>
</body>
</html>
"
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/transmission_rpc/client.py", line 241, in _request
    data: ResponseData = json.loads(http_data)
                         ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
ERROR:   transmission.py - transmission 连接出错:failed to parse response as json
@xmt328 xmt328 added the bug Something isn't working label Jan 2, 2025
@XSmarter
Copy link

XSmarter commented Jan 2, 2025

+1

@qsxazcv
Copy link

qsxazcv commented Jan 2, 2025

你确定带s的可以访问?

@cng10001
Copy link

cng10001 commented Jan 2, 2025

直接用http://访问呢

@xmt328
Copy link
Author

xmt328 commented Jan 3, 2025

你确定带s的可以访问?

可以的,直接在容器内能够正常访问
而且根据日志来看,链路是通的,只是因为用了http方式访问才会报"The plain HTTP request was sent to HTTPS port"
image

@xmt328
Copy link
Author

xmt328 commented Jan 3, 2025

直接用http://访问呢

直接访问http端口是可以的
image

@xmt328
Copy link
Author

xmt328 commented Jan 3, 2025

从代码来看是不是没有处理https的情况

trt = transmission_rpc.Client(host=self._host,
port=self._port,
username=self._username,
password=self._password,
timeout=60)

官方文档是支持传入protocol的
image
https://transmission-rpc.readthedocs.io/en/v7.0.11/client.html#

@hccnm
Copy link

hccnm commented Jan 4, 2025

你mp也是用https打开的吗?这个错误提示的很明显了,当前所在的网址是http协议,但是去请求https的请求了

@so1ve
Copy link

so1ve commented Jan 4, 2025

连接transmission是mp后端做的事,前端是不是https有啥关系

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

Successfully merging a pull request may close this issue.

6 participants