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

卡在秒传检查 #35

Open
androiddisk opened this issue Jun 29, 2020 · 13 comments
Open

卡在秒传检查 #35

androiddisk opened this issue Jun 29, 2020 · 13 comments
Labels
bug Something isn't working

Comments

@androiddisk
Copy link

Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 467, in send
low_conn.endheaders()
File "/usr/lib/python3.8/http/client.py", line 1235, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1006, in send_output
self.send(msg)
File "/usr/lib/python3.8/http/client.py", line 946, in send
self.connect()
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 352, in connect
self.sock = ssl_wrap_socket(
File "/usr/lib/python3/dist-packages/urllib3/util/ssl
.py", line 383, in ssl_wrap_socket
return context.wrap_socket(sock)
File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/usr/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1108)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/root/kooapk/kooapk-kitchen/tools/cloud189/cloud189/cli/downloader.py", line 232, in run
infos = self._disk.upload_dir(self._up_path, self._folder_id, self._force, self._mkdir,
File "/root/kooapk/kooapk-kitchen/tools/cloud189/cloud189/api/core.py", line 724, in upload_dir
up_code = self.upload_file(upload_file[0], upload_file[1], force=force, callback=callback)
File "/root/kooapk/kooapk-kitchen/tools/cloud189/cloud189/api/core.py", line 662, in upload_file
return self._upload_file_by_client(up_info)
File "/root/kooapk/kooapk-kitchen/tools/cloud189/cloud189/api/core.py", line 537, in _upload_file_by_client
code = self._upload_file_data(file_upload_url, upload_file_id, up_info)
File "/root/kooapk/kooapk-kitchen/tools/cloud189/cloud189/api/core.py", line 469, in _upload_file_data
resp = requests.put(url, data=post_data, headers=headers)
File "/usr/lib/python3/dist-packages/requests/api.py", line 131, in put
return request('put', url, data=data, **kwargs)
File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 498, in send
raise ConnectionError(err, request=request)
[0] Status: Finished | Process:秒传检查 | Upload: romok/tmp (1/9) -> 全部文件

@androiddisk
Copy link
Author

系统是 ubuntu 20.4

@androiddisk
Copy link
Author

希望大佬能给予帮助 谢谢

@rachpt
Copy link
Collaborator

rachpt commented Jun 29, 2020

检查 requests 版本

@androiddisk
Copy link
Author

检查 requests 版本

你好 , 我检查了

root@Lenovo:~/kooapk/kooapk-kitchen# pip3 install requests
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.22.0)

请问版本有什么不对么

@rachpt
Copy link
Collaborator

rachpt commented Jun 29, 2020

是不是登录过期了,方便的话,重命名一下 .config 试试重新登陆

@androiddisk
Copy link
Author

是不是登录过期了,方便的话,重命名一下 .config 试试重新登陆

谢谢指点。 不过还是不行 刚刚已经重新登录了

@androiddisk
Copy link
Author

是不是登录过期了,方便的话,重命名一下 .config 试试重新登陆

交互模式和单任务命令行模式都试了 不行

@rachpt
Copy link
Collaborator

rachpt commented Jun 29, 2020

我尝试在正常上传中切断网络会得到类似的异常。
建议

  1. 检查网络连接
  2. 前面抛出 SSLError 异常很奇怪,建议创建新的 python 虚拟环境,试试

rachpt added a commit that referenced this issue Jun 29, 2020
@X1A0CA1
Copy link

X1A0CA1 commented Jul 6, 2020

[0] Status: Running | Process:秒传检查 | Upload: /root/test.mkv -> 全部文件 Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 472, in send
low_conn.send(i)
File "/usr/local/lib/python3.8/http/client.py", line 967, in send
self.sock.sendall(data)
File "/usr/local/lib/python3.8/ssl.py", line 1204, in sendall
v = self.send(byte_view[count:])
File "/usr/local/lib/python3.8/ssl.py", line 1173, in send
return self._sslobj.write(data)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/root/cloud189/cloud189/cli/downloader.py", line 227, in run
info = self._disk.upload_file(self._up_path, self._folder_id, callback=self._show_progress, force=self._force)
File "/root/cloud189/cloud189/api/core.py", line 662, in upload_file
[0] Status: Running | Process:秒传检查 | Upload: /root/test.mkv -> 全部文件 return self._upload_file_by_client(up_info)
File "/root/cloud189/cloud189/api/core.py", line 537, in _upload_file_by_client
code = self._upload_file_data(file_upload_url, upload_file_id, up_info)
File "/root/cloud189/cloud189/api/core.py", line 469, in _upload_file_data
resp = requests.put(url, data=post_data, headers=headers, verify=False, timeout=None)
File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 134, in put
return request('put', url, data=data, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: [Errno 32] Broken pipe

同样的问题,很奇怪,一直卡在秒传检查。
卡在秒传检查的时候我看了下 io 占用以及 cpu 占用,发现这俩纹丝不动,按道理来说应该是会根据文件生成的 md5 判断是否能秒传,但是占用一点都没有,怀疑这块有问题。

系统版本:Deabin 10 buster
内核:Linux 4.19.0-8-amd64 x86_64
服务器位置:法国,巴黎
python版本:Python 3.8.3
pip版本:pip 20.1.1 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
各个轮子的版本:
Package Version


certifi 2020.6.20
chardet 3.0.4
fabulous 0.3.0
idna 2.10
Pillow 7.2.0
pip 20.1.1
pyasn1 0.4.8
pyreadline 2.1
requests 2.24.0
requests-toolbelt 0.9.1
rsa 4.6
setuptools 41.2.0
six 1.15.0
urllib3 1.25.9

@rachpt rachpt added the bug Something isn't working label Jul 6, 2020
@Aruelius
Copy link
Owner

Aruelius commented Jul 6, 2020

@X1A0CA1 很大可能是天翼云检测到 IDC 的 IP,然后无限重定向。我在阿里云的机器上是不能正常使用的,本地倒是可以,别的 IDC 我还没试过。

@X1A0CA1
Copy link

X1A0CA1 commented Jul 6, 2020

@X1A0CA1 很大可能是天翼云检测到 IDC 的 IP,然后无限重定向。我在阿里云的机器上是不能正常使用的,本地倒是可以,别的 IDC 我还没试过。

我在两台服务器上测试了,一台是 Hetzner 的服务器,一台是 online.net的服务器,均可以正常下载,但都卡在秒传检查。
如果是检测到 IDC 的 IP 的话应该是下载都没法下载的。
不管怎么样,我正在尝试在本地尝试上传文件以及尝试在本地通过全局代理到服务器来上传文件。


2020.7.6 22:39 编辑

使用秒传失败的服务器继续进行上传,只不过文件更换为dd创建的一个 100M 的文件。

dd if=/dev/zero of=test.file.xiaocai.test bs=1024k count=100 

并重新在 cloud189 中上传,秒传成功

全部文件 > upload /root/test.file.xiaocai.test
开始上传, 输入 jobs 查看上传进度...
全部文件 > jobs -f

[0] Status: Finished | Process:  秒传!  | Upload: /root/test.file.xiaocai.test -> 全部文件             
[0] finished                                                                                            
全部文件 > 

同日 23:00 编辑

尝试使用 dd 创建一个 1G 大小的文件来上传,但是依然卡在检查。且得到以下结果。
现在我开始怀疑是不是传的文件过大导致了卡检查。

#    /$$$$$$  /$$                           /$$   /$$    /$$$$$$   /$$$$$$ 
#   /$$__  $$| $$                          | $$ /$$$$   /$$__  $$ /$$__  $$
#  | $$  \__/| $$  /$$$$$$  /$$   /$$  /$$$$$$$|_  $$  | $$  \ $$| $$  \ $$
#  | $$      | $$ /$$__  $$| $$  | $$ /$$__  $$  | $$  |  $$$$$$/|  $$$$$$$
#  | $$      | $$| $$  \ $$| $$  | $$| $$  | $$  | $$   >$$__  $$ \____  $$
#  | $$    $$| $$| $$  | $$| $$  | $$| $$  | $$  | $$  | $$  \ $$ /$$  \ $$
#  |  $$$$$$/| $$|  $$$$$$/|  $$$$$$/|  $$$$$$$ /$$$$$$|  $$$$$$/|  $$$$$$/
#   \______/ |__/ \______/  \______/  \_______/|______/ \______/  \______/ 
#                                                                          
--------------------------------------------------------------------------
      Github: https://github.com/Aruelius/cloud189 (Version: 0.0.5)
--------------------------------------------------------------------------
    
全部文件 > u /root/test.xiaocai.1Gfile.test -f

[0] Status: Running  | Process:秒传检查 | Upload: /root/test.xiaocai.1Gfile.test -> 全部文件        Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 472, in send
    low_conn.send(i)
  File "/usr/local/lib/python3.8/http/client.py", line 967, in send
    self.sock.sendall(data)
  File "/usr/local/lib/python3.8/ssl.py", line 1204, in sendall
    v = self.send(byte_view[count:])
  File "/usr/local/lib/python3.8/ssl.py", line 1173, in send
    return self._sslobj.write(data)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/root/cloud189/cloud189/cli/downloader.py", line 227, in run
    info = self._disk.upload_file(self._up_path, self._folder_id, callback=self._show_progress, force=self._force)
  File "/root/cloud189/cloud189/api/core.py", line 662, in upload_file
    return self._upload_file_by_client(up_info)
  File "/root/cloud189/cloud189/api/core.py", line 537, in _upload_file_by_client
    code = self._upload_file_data(file_upload_url, upload_file_id, up_info)
  File "/root/cloud189/cloud189/api/core.py", line 469, in _upload_file_data
    resp = requests.put(url, data=post_data, headers=headers, verify=False, timeout=None)
  File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 134, in put
    return request('put', url, data=data, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 498, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: [Errno 32] Broken pipe
[0] Status: Finished | Process:秒传检查 | Upload: /root/test.xiaocai.1Gfile.test -> 全部文件

23:33

500M 的文件成功上传。

全部文件 > u /root/test.500M.xiaocai.file -f

[0] Status: Finished | Process:  秒传!  | Upload: /root/test.500M.xiaocai.file -> 全部文件          [0] finished                                                                                        
全部文件 > 

900M 的文件成功上传

全部文件 > u /root/900M.test.file -f

[0] Status: Finished | Process:  秒传!  | Upload: /root/900M.test.file -> 全部文件                  [0] finished                                                                                        
全部文件 > 

1026M 的文件 报错

--------------------------------------------------------------------------
      Github: https://github.com/Aruelius/cloud189 (Version: 0.0.5)
--------------------------------------------------------------------------
    
全部文件 > u /root/1026M.file.test -f

[0] Status: Running  | Process:秒传检查 | Upload: /root/1026M.file.test -> 全部文件                 Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 472, in send
    low_conn.send(i)
  File "/usr/local/lib/python3.8/http/client.py", line 967, in send
    self.sock.sendall(data)
  File "/usr/local/lib/python3.8/ssl.py", line 1204, in sendall
    v = self.send(byte_view[count:])
  File "/usr/local/lib/python3.8/ssl.py", line 1173, in send
    return self._sslobj.write(data)
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/root/cloud189/cloud189/cli/downloader.py", line 227, in run
    info = self._disk.upload_file(self._up_path, self._folder_id, callback=self._show_progress, force=self._force)
  File "/root/cloud189/cloud189/api/core.py", line 662, in upload_file
    return self._upload_file_by_client(up_info)
  File "/root/cloud189/cloud189/api/core.py", line 537, in _upload_file_by_client
    code = self._upload_file_data(file_upload_url, upload_file_id, up_info)
  File "/root/cloud189/cloud189/api/core.py", line 469, in _upload_file_data
    resp = requests.put(url, data=post_data, headers=headers, verify=False, timeout=None)
  File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 134, in put
    return request('put', url, data=data, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 498, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: [Errno 110] Connection timed out
[0] Status: Finished | Process:秒传检查 | Upload: /root/1026M.file.test -> 全部文件

初步结论:
天翼云并没有 block 掉 IDC 机房的 IP,只是传输的文件大于 1G(猜测)从而导致卡检查。

@Aruelius
Copy link
Owner

Aruelius commented Nov 4, 2020

可能只是当时网络问题
image

@gonejack
Copy link

我这里是4G以上的电影会报 Use the client interface to upload files

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

5 participants