开发者社区> 问答> 正文

bucket.putobjectfilenamecontentRead timed out

版本: Python 2.7.12 oss 2.2.3  

连着上传两张图片,两张图片一样,上传目录不一样
第一张显示上传成功,第二张就超时Read timed out

如果两张图不一样 就都可以上传成功

error:

image/png
Tue, 07 Feb 2017 03:25:08 GMT
/mosfile/test/oriphoto/201702/6384202202403373056.png
[2017-02-07 11:25:08,689] DEBUG [requests.packages.urllib3.connectionpool] _new_conn connectionpool.py:207 Starting new HTTP connection (1): mosfile.oss-cn-hangzhou.aliyuncs.com
[2017-02-07 11:25:09,135] DEBUG [requests.packages.urllib3.connectionpool] _make_request connectionpool.py:395 http://mosfile.oss-cn-hangzhou.aliyuncs.com:80 "PUT /test%2Foriphoto%2F201702%2F6384202202403373056.png HTTP/1.1" 200 0
[2017-02-07 11:25:09,136] ERROR [lib.file_store] oss_save_file file_store.py:39 200 58993E175CC26B7E56D621DC
[2017-02-07 11:25:09,143] DEBUG [PIL.PngImagePlugin] call PngImagePlugin.py:135 STREAM 'IHDR' 16 13
[2017-02-07 11:25:09,143] DEBUG [PIL.PngImagePlugin] call PngImagePlugin.py:135 STREAM 'IDAT' 41 20257
[2017-02-07 11:25:09,144] DEBUG [root] __make_signature auth.py:50 string_to_sign=PUT

image/png
Tue, 07 Feb 2017 03:25:09 GMT
/mosfile/test/photo/53/6384202206698340353.png
[2017-02-07 11:25:09,145] DEBUG [requests.packages.urllib3.connectionpool] _new_conn connectionpool.py:207 Starting new HTTP connection (2): mosfile.oss-cn-hangzhou.aliyuncs.com
[2017-02-07 11:26:09,269] ERROR [lib.file_store] oss_save_file file_store.py:41 Traceback (most recent call last):
  File "/home/sjw/web_app/lib/file_store.py", line 37, in oss_save_file
    response = bucket.put_object(file_name, content)
  File "/home/sjw/local/python/lib/python2.7/site-packages/oss2/api.py", line 346, in put_object
    resp = self.__do_object('PUT', key, data=data, headers=headers)
  File "/home/sjw/local/python/lib/python2.7/site-packages/oss2/api.py", line 1028, in __do_object
    return self._do(method, self.bucket_name, key, **kwargs)
  File "/home/sjw/local/python/lib/python2.7/site-packages/oss2/api.py", line 146, in _do
    resp = self.session.do_request(req, timeout=self.timeout)
  File "/home/sjw/local/python/lib/python2.7/site-packages/oss2/http.py", line 44, in do_request
    raise RequestError(e)
RequestError: {'status': -2, 'details': "RequestError: HTTPConnectionPool(host='mosfile.oss-cn-hangzhou.aliyuncs.com', port=80): Read timed out. (read timeout=60)"}




展开
收起
清风徐不来 2017-02-07 13:05:35 7272 0
2 条回答
写回答
取消 提交回答
  • 从描述上看是不是上传同一个文件的时候,fd已经到了最后。再次上传的时候,已经无法再读取文件内容了。

    最好把上传的代码发下。
    第一次上传完毕的时候,把文件关闭下。
    2017-02-09 11:28:38
    赞同 展开评论 打赏
  • Rebucket.putobjectfilenamecontentRead timed out
    能提供一下上传的代码片段吗? 或者可以旺旺联系加 oss_support,更能给出详细解答
    2017-02-07 20:47:16
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载