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

s3cmd sync fails with RemoteDisconnected #960

Closed
jimirocks opened this issue Mar 6, 2018 · 13 comments
Closed

s3cmd sync fails with RemoteDisconnected #960

jimirocks opened this issue Mar 6, 2018 · 13 comments
Assignees

Comments

@jimirocks
Copy link

Looks like it's not able to fetch second part of listing the bucket content

DEBUG: Canonical Request:                                                                                                                                                                    
GET                                                                                                                                                                                          
/                                                                                                                                                                                            
marker=Foto%2F2001%2FGemini%2FSoftball%2FDownload%2FHow%20To%20Play%20Softball%285%29.htm&prefix=Foto%2F                                                                                     
host:pirkojm-backup.s3.amazonaws.com                                                                                                                                                         
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855                                                                                                        
x-amz-date:20180306T100045Z                                                                                                                                                                  
                                                                                                                                                                                             
host;x-amz-content-sha256;x-amz-date                                                                                                                                                         
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855                                                                                                                             
----------------------                                                                                                                                                                       
DEBUG: signature-v4 headers: {'x-amz-date': '20180306T100045Z', 'Authorization': 'AWS4-HMAC-SHA256 Credential=****/20180306/eu-west-1/s3/aws4_request,SignedHeaders=host;x-am
z-content-sha256;x-amz-date,Signature=****', 'x-amz-content-sha256': '****'}                                                                                                                                                                                      
DEBUG: Processing request, please wait...                                                                                                                                                    
DEBUG: get_hostname(pirkojm-backup): pirkojm-backup.s3.amazonaws.com                                                                                                                         
DEBUG: ConnMan.get(): re-using connection: https://pirkojm-backup.s3.amazonaws.com#1                                                                                                         
DEBUG: format_uri(): /?marker=Foto%2F2001%2FGemini%2FSoftball%2FDownload%2FHow%20To%20Play%20Softball%285%29.htm&prefix=Foto%2F                                                              
DEBUG: Sending request method_string='GET', uri='/?marker=Foto%2F2001%2FGemini%2FSoftball%2FDownload%2FHow%20To%20Play%20Softball%285%29.htm&prefix=Foto%2F', headers={'x-amz-date': '2018030
6T100045Z', 'Authorization': 'AWS4-HMAC-SHA256 Credential=****/20180306/eu-west-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date,Signature=****', 'x-amz-content-sha256': '****'}, body=(0 bytes)                             
DEBUG: Response:                                                                                                                                                                             
{}     

Here is the trace:

Problem: RemoteDisconnected: Remote end closed connection without response                                                                                                                   
S3cmd:   2.0.1                                                                                                                                                                               
python:   3.6.4 (default, Jan 25 2018, 15:20:29)                                                                                                                                             
[GCC 7.2.1 20180116]                                                                                                                                                                         
environment LANG=cs_CZ.UTF-8

Traceback (most recent call last):
  File "/usr/bin/s3cmd", line 3073, in <module>
    rc = main()
  File "/usr/bin/s3cmd", line 2989, in main
    rc = cmd_func(args)
  File "/usr/bin/s3cmd", line 1873, in cmd_sync
    return cmd_sync_local2remote(args)
  File "/usr/bin/s3cmd", line 1846, in cmd_sync_local2remote
    ret = _single_process(args[:-1])
  File "/usr/bin/s3cmd", line 1605, in _single_process
    return _child(destination_base, source_args)
  File "/usr/bin/s3cmd", line 1709, in _child
    remote_list, dst_exclude_list, remote_total_size = fetch_remote_list(destbase_with_source_list, recursive = True, require_attribs = True)
  File "/usr/lib/python3.6/site-packages/S3/FileLists.py", line 460, in fetch_remote_list
    objectlist, tmp_total_size = _get_filelist_remote(uri, recursive = True)
  File "/usr/lib/python3.6/site-packages/S3/FileLists.py", line 397, in _get_filelist_remote
    recursive = recursive, uri_params = uri_params)
  File "/usr/lib/python3.6/site-packages/S3/S3.py", line 308, in bucket_list
    for truncated, dirs, objects in self.bucket_list_streaming(bucket, prefix, recursive, uri_params, limit):
  File "/usr/lib/python3.6/site-packages/S3/S3.py", line 342, in bucket_list_streaming
    response = self.bucket_list_noparse(bucket, prefix, recursive, uri_params, max_keys)
  File "/usr/lib/python3.6/site-packages/S3/S3.py", line 373, in bucket_list_noparse
    response = self.send_request(request)
  File "/usr/lib/python3.6/site-packages/S3/S3.py", line 1256, in send_request
    http_response = conn.c.getresponse()
  File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
    response.begin()
  File "/usr/lib/python3.6/site-packages/S3/Custom_httplib3x.py", line 53, in httpresponse_patched_begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.6/http/client.py", line 266, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

@fviard fviard self-assigned this Mar 6, 2018
@fviard
Copy link
Contributor

fviard commented Mar 6, 2018

Thank you for the report, basically it is the same issue as:
#314
but a different exception with python3 and that skips retries.
I'm looking at how to fix the root issue

@jimirocks
Copy link
Author

thanks for evaluation, in the meantime is there any workaround?

@fviard
Copy link
Contributor

fviard commented Mar 6, 2018

Using python2.
But i will try to push a workaround very fast. I'm looking into that.

@Brullworfel
Copy link

Hi! When it will be fixed?

@fviard
Copy link
Contributor

fviard commented Jun 3, 2018

Issue should now be fixed.

fviard added a commit that referenced this issue Jun 4, 2018
…ng with not crash

As in python3 errno can be "None" with system raised exceptions, ensure
that this case will not make s3cmd crash just for an error log output.
@jrcarlsen
Copy link

I am seeing a similar error:

DEBUG: get_hostname(backups): backups.s3.amazonaws.com
DEBUG: ConnMan.get(): re-using connection: https://backups.s3.amazonaws.com#81
DEBUG: format_uri(): /company/QE_Friday.7z
ERROR: Download of 'company/QE_Friday.7z' failed (Reason: Unknown OsError 0)
ERROR: Exiting now because of fatal error

Invoked as: /usr/local/bin/s3cmd sync --debug --delete-removed s3://backups/ /opt/fbrestore/mirrors/aws-mirror/
Problem: RemoteDisconnected: Remote end closed connection without response
S3cmd:   2.0.2
python:   3.6.5 (default, Apr  1 2018, 05:46:30)
[GCC 7.3.0]
environment LANG=C.UTF-8

Traceback (most recent call last):
  File "/usr/local/bin/s3cmd", line 3092, in <module>
    rc = main()
  File "/usr/local/bin/s3cmd", line 3001, in main
    rc = cmd_func(args)
  File "/usr/local/bin/s3cmd", line 1887, in cmd_sync
    return cmd_sync_remote2local(args)
  File "/usr/local/bin/s3cmd", line 1476, in cmd_sync_remote2local
    status, seq, size_transferred = _download(update_list, seq, remote_count + update_count, size_transferred, dir_cache)
  File "/usr/local/bin/s3cmd", line 1321, in _download
    response = s3.object_get(uri, dst_stream, dst_file, extra_label = seq_label)
  File "/usr/local/lib/python3.6/dist-packages/S3/S3.py", line 716, in object_get
    response = self.recv_file(request, stream, labels, start_position)
  File "/usr/local/lib/python3.6/dist-packages/S3/S3.py", line 1655, in recv_file
    http_response = conn.c.getresponse()
  File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
    response.begin()
  File "/usr/local/lib/python3.6/dist-packages/S3/Custom_httplib3x.py", line 53, in httpresponse_patched_begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.6/http/client.py", line 266, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

Let me know if I can provide more information that will help here.

@jrcarlsen
Copy link

Adding --skip-existing made the sync complete.

@ajrnz
Copy link

ajrnz commented Nov 16, 2019

Same problem.

Adding --no-check-md5 worked for me.

Could it be that the server connection is timing out while the local server is building MD5 sums?

@hopewise
Copy link

I still have this issue, I tried the above suggestions, but did not work..

@mattcasters
Copy link

I still have this issue, I tried the above suggestions, but did not work..

Same here. Adding --no-check-md5 didn't solve the error. s3cmd version 2.0.2 on Ubuntu 10.04.

@matepaiva
Copy link

having the same problem here with get and with sync.

@alitopaloglu
Copy link

Still having the same issue, did not work with --no-check-md5 and --skip-existing params

INFO: Retrieving list of remote files for s3://blabla/c ...

Strange this is there is only 200 files under category named c but couldn't get the list of files from it.

@pat-s
Copy link

pat-s commented Jul 1, 2021

@alitopaloglu What worked for me was to use v2.1.0 as the release notes indicate a fix related to python3.8 which is most likely also being used on your side?

https://github.com/s3tools/s3cmd/releases

Maybe this could be highlighted somewhere or even the focal version could be bumped somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants