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

UnboundLocalError: local variable 'conn' referenced before assignment #647

Closed
carsten-langer opened this Issue Oct 20, 2015 · 17 comments

Comments

Projects
None yet
8 participants
@carsten-langer

carsten-langer commented Oct 20, 2015

With latest version 66e96d0 pulled from github today, I receive the error below.
I use: ./s3cmd --config=s3cfg_clanger multipart s3://cdl-test --debug when the error occurs.
If I use ./s3cmd --config=s3cfg_clanger multipart s3://cdl-test --debug --no-check-hostname, it works ok.
I use it against our own internal server, from which I know that the SSL certificate validation will fail.
Thus I suspect that without the --no-check-hostname the conn = ConnMan.get(... in line 1067 of S3.py would fail, the try block jumps to line 1086 and then in line 1090 tries to access conn which is not initialized yet.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
An unexpected error has occurred.
Please try reproducing the error using
the latest s3cmd code from the git master
branch found at:
https://github.com/s3tools/s3cmd
and have a look at the known issues list:
https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions
If the error persists, please report the
following lines (removing any private
info as necessary) to:
s3tools-bugs@lists.sourceforge.net

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

DEBUG: Unicodising './s3cmd' using UTF-8
DEBUG: Unicodising '--config=s3cfg_clanger' using UTF-8
DEBUG: Unicodising 'multipart' using UTF-8
DEBUG: Unicodising 's3://cdl-test' using UTF-8
DEBUG: Unicodising '--debug' using UTF-8
Invoked as: ./s3cmd --config=s3cfg_clanger multipart s3://cdl-test --debug
Problem: UnboundLocalError: local variable 'conn' referenced before assignment
S3cmd: 1.6.0+
python: 2.7.9 (default, Apr 2 2015, 15:33:21)
[GCC 4.9.2]
environment LANG=None

Traceback (most recent call last):
File "./s3cmd", line 2813, in
rc = main()
File "./s3cmd", line 2721, in main
rc = cmd_func(args)
File "./s3cmd", line 1826, in cmd_multipart
response = s3.get_multipart(uri)
File "/root/s3cmd/S3/S3.py", line 915, in get_multipart
response = self.send_request(request)
File "/root/s3cmd/S3/S3.py", line 1090, in send_request
conn.counter = ConnMan.conn_max_counter
UnboundLocalError: local variable 'conn' referenced before assignment

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
An unexpected error has occurred.
Please try reproducing the error using
the latest s3cmd code from the git master
branch found at:
https://github.com/s3tools/s3cmd
and have a look at the known issues list:
https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions
If the error persists, please report the
above lines (removing any private
info as necessary) to:
s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

@mrooney

This comment has been minimized.

Show comment
Hide comment
@mrooney

mrooney Oct 22, 2015

Just ran into this today as well with a proxy + HTTPS. For the record, the actual exception when trying to create the connection, at least in that case, was:

Traceback (most recent call last):
  File "/usr/local/Cellar/s3cmd/1.6.0/libexec/bin/s3cmd", line 2805, in <module>
    rc = main()
  File "/usr/local/Cellar/s3cmd/1.6.0/libexec/bin/s3cmd", line 2713, in main
    rc = cmd_func(args)
  File "/usr/local/Cellar/s3cmd/1.6.0/libexec/bin/s3cmd", line 124, in cmd_ls
    subcmd_all_buckets_list(s3)
  File "/usr/local/Cellar/s3cmd/1.6.0/libexec/bin/s3cmd", line 129, in subcmd_all_buckets_list
    response = s3.list_all_buckets()
  File "/usr/local/Cellar/s3cmd/1.6.0/libexec/lib/python2.7/site-packages/S3/S3.py", line 286, in list_all_buckets
    response = self.send_request(request)
  File "/usr/local/Cellar/s3cmd/1.6.0/libexec/lib/python2.7/site-packages/S3/S3.py", line 1060, in send_request
    conn = ConnMan.get(self.get_hostname(resource['bucket']))
  File "/usr/local/Cellar/s3cmd/1.6.0/libexec/lib/python2.7/site-packages/S3/ConnMan.py", line 181, in get
    conn.match_hostname()
  File "/usr/local/Cellar/s3cmd/1.6.0/libexec/lib/python2.7/site-packages/S3/ConnMan.py", line 111, in match_hostname
    self.match_hostname_aws(cert, e)
  File "/usr/local/Cellar/s3cmd/1.6.0/libexec/lib/python2.7/site-packages/S3/ConnMan.py", line 100, in match_hostname_aws
    raise e
CertificateError: hostname 'proxy-developer.example.com' doesn't match 's3.amazonaws.com'

mrooney commented Oct 22, 2015

Just ran into this today as well with a proxy + HTTPS. For the record, the actual exception when trying to create the connection, at least in that case, was:

Traceback (most recent call last):
  File "/usr/local/Cellar/s3cmd/1.6.0/libexec/bin/s3cmd", line 2805, in <module>
    rc = main()
  File "/usr/local/Cellar/s3cmd/1.6.0/libexec/bin/s3cmd", line 2713, in main
    rc = cmd_func(args)
  File "/usr/local/Cellar/s3cmd/1.6.0/libexec/bin/s3cmd", line 124, in cmd_ls
    subcmd_all_buckets_list(s3)
  File "/usr/local/Cellar/s3cmd/1.6.0/libexec/bin/s3cmd", line 129, in subcmd_all_buckets_list
    response = s3.list_all_buckets()
  File "/usr/local/Cellar/s3cmd/1.6.0/libexec/lib/python2.7/site-packages/S3/S3.py", line 286, in list_all_buckets
    response = self.send_request(request)
  File "/usr/local/Cellar/s3cmd/1.6.0/libexec/lib/python2.7/site-packages/S3/S3.py", line 1060, in send_request
    conn = ConnMan.get(self.get_hostname(resource['bucket']))
  File "/usr/local/Cellar/s3cmd/1.6.0/libexec/lib/python2.7/site-packages/S3/ConnMan.py", line 181, in get
    conn.match_hostname()
  File "/usr/local/Cellar/s3cmd/1.6.0/libexec/lib/python2.7/site-packages/S3/ConnMan.py", line 111, in match_hostname
    self.match_hostname_aws(cert, e)
  File "/usr/local/Cellar/s3cmd/1.6.0/libexec/lib/python2.7/site-packages/S3/ConnMan.py", line 100, in match_hostname_aws
    raise e
CertificateError: hostname 'proxy-developer.example.com' doesn't match 's3.amazonaws.com'
@mdomsch

This comment has been minimized.

Show comment
Hide comment
@mdomsch

mdomsch Oct 22, 2015

Member

#652 has a fix for this.

Member

mdomsch commented Oct 22, 2015

#652 has a fix for this.

@fviard

This comment has been minimized.

Show comment
Hide comment
@fviard

fviard Oct 22, 2015

Contributor

@mrooney Thank you very much for the detailed report you did in your email. That was the missing bits to help solve the issue. Can you give a try to the patch of mdomsch, so we can merge it if it works?

Contributor

fviard commented Oct 22, 2015

@mrooney Thank you very much for the detailed report you did in your email. That was the missing bits to help solve the issue. Can you give a try to the patch of mdomsch, so we can merge it if it works?

@fviard

This comment has been minimized.

Show comment
Hide comment
@fviard

fviard Oct 26, 2015

Contributor

Fix is now in master.

Contributor

fviard commented Oct 26, 2015

Fix is now in master.

@fviard fviard closed this Oct 26, 2015

@carsten-langer

This comment has been minimized.

Show comment
Hide comment
@carsten-langer

carsten-langer Oct 27, 2015

As OP of the bug I can confirm the fix works for me. Thank you for how fast this was fixed!

carsten-langer commented Oct 27, 2015

As OP of the bug I can confirm the fix works for me. Thank you for how fast this was fixed!

@atodorov

This comment has been minimized.

Show comment
Hide comment
@atodorov

atodorov Nov 24, 2015

Contributor

With s3cmd-1.6.0-1.el7.noarch on a RHEL 7.2 system I get the original error:

$ s3cmd sync -c ./data/s3.cfg -v -m text/css -P /tmp/svplanet/english/html/*.css s3://planet.sofiavalley.com/
INFO: Compiling list of local files...
INFO: Compiling list of local files...
INFO: Running stat() and reading/calculating MD5 values on 2 files, this may take some time...
INFO: Retrieving list of remote files for s3://planet.sofiavalley.com/responsive.css ...

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    An unexpected error has occurred.
  Please try reproducing the error using
  the latest s3cmd code from the git master
  branch found at:
    https://github.com/s3tools/s3cmd
  and have a look at the known issues list:
    https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions
  If the error persists, please report the
  following lines (removing any private
  info as necessary) to:
   s3tools-bugs@lists.sourceforge.net

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Invoked as: /usr/bin/s3cmd sync -c ./data/s3.cfg -v -m text/css -P /tmp/svplanet/english/html/responsive.css /tmp/svplanet/english/html/style.css s3://planet.sofiavalley.com/
Problem: UnboundLocalError: local variable 'conn' referenced before assignment
S3cmd:   1.6.0
python:   2.7.5 (default, Oct 11 2015, 17:47:16) 
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]
environment LANG=bg_BG.utf8

Traceback (most recent call last):
  File "/usr/bin/s3cmd", line 2805, in <module>
    rc = main()
  File "/usr/bin/s3cmd", line 2713, in main
    rc = cmd_func(args)
  File "/usr/bin/s3cmd", line 1666, in cmd_sync
    return cmd_sync_local2remote(args)
  File "/usr/bin/s3cmd", line 1644, in cmd_sync_local2remote
    ret = _single_process(args[:-1], local_list)
  File "/usr/bin/s3cmd", line 1422, in _single_process
    return _child(destination_base, source_args, local_list)
  File "/usr/bin/s3cmd", line 1521, in _child
    remote_list, dst_exclude_list = fetch_remote_list(destbase_with_source_list, recursive = True, require_attribs = True)
  File "/usr/lib/python2.7/site-packages/S3/FileLists.py", line 444, in fetch_remote_list
    objectlist = _get_filelist_remote(uri, recursive = True)
  File "/usr/lib/python2.7/site-packages/S3/FileLists.py", line 384, in _get_filelist_remote
    recursive = recursive, uri_params = uri_params)
  File "/usr/lib/python2.7/site-packages/S3/S3.py", line 293, in bucket_list
    for dirs, objects in self.bucket_list_streaming(bucket, prefix, recursive, uri_params):
  File "/usr/lib/python2.7/site-packages/S3/S3.py", line 320, in bucket_list_streaming
    response = self.bucket_list_noparse(bucket, prefix, recursive, uri_params)
  File "/usr/lib/python2.7/site-packages/S3/S3.py", line 339, in bucket_list_noparse
    response = self.send_request(request)
  File "/usr/lib/python2.7/site-packages/S3/S3.py", line 1084, in send_request
    conn.counter = ConnMan.conn_max_counter
UnboundLocalError: local variable 'conn' referenced before assignment

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    An unexpected error has occurred.
  Please try reproducing the error using
  the latest s3cmd code from the git master
  branch found at:
    https://github.com/s3tools/s3cmd
  and have a look at the known issues list:
    https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions
  If the error persists, please report the
  above lines (removing any private
  info as necessary) to:
   s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

with a git checkout I get the CertificateError mentioned above by @mrooney

$ /tmp/s3cmd/s3cmd sync -c ./data/s3.cfg -v -m text/css -P /tmp/svplanet/english/html/*.css s3://planet.sofiavalley.com/
INFO: Compiling list of local files...
INFO: Compiling list of local files...
INFO: Running stat() and reading/calculating MD5 values on 2 files, this may take some time...
INFO: Retrieving list of remote files for s3://planet.sofiavalley.com/responsive.css ...

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    An unexpected error has occurred.
  Please try reproducing the error using
  the latest s3cmd code from the git master
  branch found at:
    https://github.com/s3tools/s3cmd
  and have a look at the known issues list:
    https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions
  If the error persists, please report the
  following lines (removing any private
  info as necessary) to:
   s3tools-bugs@lists.sourceforge.net


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Invoked as: /tmp/s3cmd/s3cmd sync -c ./data/s3.cfg -v -m text/css -P /tmp/svplanet/english/html/responsive.css /tmp/svplanet/english/html/style.css s3://planet.sofiavalley.com/
Problem: CertificateError: hostname 'planet.sofiavalley.com.s3.amazonaws.com' doesn't match either of '*.s3.amazonaws.com', 's3.amazonaws.com'
S3cmd:   1.6.0+
python:   2.7.5 (default, Oct 11 2015, 17:47:16) 
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]
environment LANG=bg_BG.utf8

Traceback (most recent call last):
  File "/tmp/s3cmd/s3cmd", line 2912, in <module>
    rc = main()
  File "/tmp/s3cmd/s3cmd", line 2834, in main
    rc = cmd_func(args)
  File "/tmp/s3cmd/s3cmd", line 1785, in cmd_sync
    return cmd_sync_local2remote(args)
  File "/tmp/s3cmd/s3cmd", line 1759, in cmd_sync_local2remote
    ret = _single_process(args[:-1])
  File "/tmp/s3cmd/s3cmd", line 1518, in _single_process
    return _child(destination_base, source_args)
  File "/tmp/s3cmd/s3cmd", line 1621, in _child
    remote_list, dst_exclude_list, remote_total_size = fetch_remote_list(destbase_with_source_list, recursive = True, require_attribs = True)
  File "/tmp/s3cmd/S3/FileLists.py", line 455, in fetch_remote_list
    objectlist, tmp_total_size = _get_filelist_remote(uri, recursive = True)
  File "/tmp/s3cmd/S3/FileLists.py", line 392, in _get_filelist_remote
    recursive = recursive, uri_params = uri_params)
  File "/tmp/s3cmd/S3/S3.py", line 292, in bucket_list
    for dirs, objects in self.bucket_list_streaming(bucket, prefix, recursive, uri_params):
  File "/tmp/s3cmd/S3/S3.py", line 319, in bucket_list_streaming
    response = self.bucket_list_noparse(bucket, prefix, recursive, uri_params)
  File "/tmp/s3cmd/S3/S3.py", line 338, in bucket_list_noparse
    response = self.send_request(request)
  File "/tmp/s3cmd/S3/S3.py", line 1073, in send_request
    conn = ConnMan.get(self.get_hostname(resource['bucket']))
  File "/tmp/s3cmd/S3/ConnMan.py", line 180, in get
    conn.c.connect()
  File "/usr/lib64/python2.7/httplib.py", line 1201, in connect
    ssl.match_hostname(self.sock.getpeercert(), server_hostname)
  File "/usr/lib64/python2.7/ssl.py", line 269, in match_hostname
    % (hostname, ', '.join(map(repr, dnsnames))))
CertificateError: hostname 'planet.sofiavalley.com.s3.amazonaws.com' doesn't match either of '*.s3.amazonaws.com', 's3.amazonaws.com'

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    An unexpected error has occurred.
  Please try reproducing the error using
  the latest s3cmd code from the git master
  branch found at:
    https://github.com/s3tools/s3cmd
  and have a look at the known issues list:
    https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions
  If the error persists, please report the
  above lines (removing any private
  info as necessary) to:
   s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I'm not using a proxy or anything like that. Btw it looks like I've started having this error on Friday Nov 20th. That's when I've upgraded to RHEL 7.2 and some of the dependencies might be causing this.

Contributor

atodorov commented Nov 24, 2015

With s3cmd-1.6.0-1.el7.noarch on a RHEL 7.2 system I get the original error:

$ s3cmd sync -c ./data/s3.cfg -v -m text/css -P /tmp/svplanet/english/html/*.css s3://planet.sofiavalley.com/
INFO: Compiling list of local files...
INFO: Compiling list of local files...
INFO: Running stat() and reading/calculating MD5 values on 2 files, this may take some time...
INFO: Retrieving list of remote files for s3://planet.sofiavalley.com/responsive.css ...

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    An unexpected error has occurred.
  Please try reproducing the error using
  the latest s3cmd code from the git master
  branch found at:
    https://github.com/s3tools/s3cmd
  and have a look at the known issues list:
    https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions
  If the error persists, please report the
  following lines (removing any private
  info as necessary) to:
   s3tools-bugs@lists.sourceforge.net

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Invoked as: /usr/bin/s3cmd sync -c ./data/s3.cfg -v -m text/css -P /tmp/svplanet/english/html/responsive.css /tmp/svplanet/english/html/style.css s3://planet.sofiavalley.com/
Problem: UnboundLocalError: local variable 'conn' referenced before assignment
S3cmd:   1.6.0
python:   2.7.5 (default, Oct 11 2015, 17:47:16) 
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]
environment LANG=bg_BG.utf8

Traceback (most recent call last):
  File "/usr/bin/s3cmd", line 2805, in <module>
    rc = main()
  File "/usr/bin/s3cmd", line 2713, in main
    rc = cmd_func(args)
  File "/usr/bin/s3cmd", line 1666, in cmd_sync
    return cmd_sync_local2remote(args)
  File "/usr/bin/s3cmd", line 1644, in cmd_sync_local2remote
    ret = _single_process(args[:-1], local_list)
  File "/usr/bin/s3cmd", line 1422, in _single_process
    return _child(destination_base, source_args, local_list)
  File "/usr/bin/s3cmd", line 1521, in _child
    remote_list, dst_exclude_list = fetch_remote_list(destbase_with_source_list, recursive = True, require_attribs = True)
  File "/usr/lib/python2.7/site-packages/S3/FileLists.py", line 444, in fetch_remote_list
    objectlist = _get_filelist_remote(uri, recursive = True)
  File "/usr/lib/python2.7/site-packages/S3/FileLists.py", line 384, in _get_filelist_remote
    recursive = recursive, uri_params = uri_params)
  File "/usr/lib/python2.7/site-packages/S3/S3.py", line 293, in bucket_list
    for dirs, objects in self.bucket_list_streaming(bucket, prefix, recursive, uri_params):
  File "/usr/lib/python2.7/site-packages/S3/S3.py", line 320, in bucket_list_streaming
    response = self.bucket_list_noparse(bucket, prefix, recursive, uri_params)
  File "/usr/lib/python2.7/site-packages/S3/S3.py", line 339, in bucket_list_noparse
    response = self.send_request(request)
  File "/usr/lib/python2.7/site-packages/S3/S3.py", line 1084, in send_request
    conn.counter = ConnMan.conn_max_counter
UnboundLocalError: local variable 'conn' referenced before assignment

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    An unexpected error has occurred.
  Please try reproducing the error using
  the latest s3cmd code from the git master
  branch found at:
    https://github.com/s3tools/s3cmd
  and have a look at the known issues list:
    https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions
  If the error persists, please report the
  above lines (removing any private
  info as necessary) to:
   s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

with a git checkout I get the CertificateError mentioned above by @mrooney

$ /tmp/s3cmd/s3cmd sync -c ./data/s3.cfg -v -m text/css -P /tmp/svplanet/english/html/*.css s3://planet.sofiavalley.com/
INFO: Compiling list of local files...
INFO: Compiling list of local files...
INFO: Running stat() and reading/calculating MD5 values on 2 files, this may take some time...
INFO: Retrieving list of remote files for s3://planet.sofiavalley.com/responsive.css ...

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    An unexpected error has occurred.
  Please try reproducing the error using
  the latest s3cmd code from the git master
  branch found at:
    https://github.com/s3tools/s3cmd
  and have a look at the known issues list:
    https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions
  If the error persists, please report the
  following lines (removing any private
  info as necessary) to:
   s3tools-bugs@lists.sourceforge.net


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Invoked as: /tmp/s3cmd/s3cmd sync -c ./data/s3.cfg -v -m text/css -P /tmp/svplanet/english/html/responsive.css /tmp/svplanet/english/html/style.css s3://planet.sofiavalley.com/
Problem: CertificateError: hostname 'planet.sofiavalley.com.s3.amazonaws.com' doesn't match either of '*.s3.amazonaws.com', 's3.amazonaws.com'
S3cmd:   1.6.0+
python:   2.7.5 (default, Oct 11 2015, 17:47:16) 
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]
environment LANG=bg_BG.utf8

Traceback (most recent call last):
  File "/tmp/s3cmd/s3cmd", line 2912, in <module>
    rc = main()
  File "/tmp/s3cmd/s3cmd", line 2834, in main
    rc = cmd_func(args)
  File "/tmp/s3cmd/s3cmd", line 1785, in cmd_sync
    return cmd_sync_local2remote(args)
  File "/tmp/s3cmd/s3cmd", line 1759, in cmd_sync_local2remote
    ret = _single_process(args[:-1])
  File "/tmp/s3cmd/s3cmd", line 1518, in _single_process
    return _child(destination_base, source_args)
  File "/tmp/s3cmd/s3cmd", line 1621, in _child
    remote_list, dst_exclude_list, remote_total_size = fetch_remote_list(destbase_with_source_list, recursive = True, require_attribs = True)
  File "/tmp/s3cmd/S3/FileLists.py", line 455, in fetch_remote_list
    objectlist, tmp_total_size = _get_filelist_remote(uri, recursive = True)
  File "/tmp/s3cmd/S3/FileLists.py", line 392, in _get_filelist_remote
    recursive = recursive, uri_params = uri_params)
  File "/tmp/s3cmd/S3/S3.py", line 292, in bucket_list
    for dirs, objects in self.bucket_list_streaming(bucket, prefix, recursive, uri_params):
  File "/tmp/s3cmd/S3/S3.py", line 319, in bucket_list_streaming
    response = self.bucket_list_noparse(bucket, prefix, recursive, uri_params)
  File "/tmp/s3cmd/S3/S3.py", line 338, in bucket_list_noparse
    response = self.send_request(request)
  File "/tmp/s3cmd/S3/S3.py", line 1073, in send_request
    conn = ConnMan.get(self.get_hostname(resource['bucket']))
  File "/tmp/s3cmd/S3/ConnMan.py", line 180, in get
    conn.c.connect()
  File "/usr/lib64/python2.7/httplib.py", line 1201, in connect
    ssl.match_hostname(self.sock.getpeercert(), server_hostname)
  File "/usr/lib64/python2.7/ssl.py", line 269, in match_hostname
    % (hostname, ', '.join(map(repr, dnsnames))))
CertificateError: hostname 'planet.sofiavalley.com.s3.amazonaws.com' doesn't match either of '*.s3.amazonaws.com', 's3.amazonaws.com'

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    An unexpected error has occurred.
  Please try reproducing the error using
  the latest s3cmd code from the git master
  branch found at:
    https://github.com/s3tools/s3cmd
  and have a look at the known issues list:
    https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions
  If the error persists, please report the
  above lines (removing any private
  info as necessary) to:
   s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I'm not using a proxy or anything like that. Btw it looks like I've started having this error on Friday Nov 20th. That's when I've upgraded to RHEL 7.2 and some of the dependencies might be causing this.

@atodorov

This comment has been minimized.

Show comment
Hide comment
@atodorov

atodorov Nov 24, 2015

Contributor

Please see http://bugs.python.org/issue25722 for the issue causing the SSL failures and their response. It looks like this is working as per RFC which means that s3cmd should special case this. Let me know if you want another issue open.

Contributor

atodorov commented Nov 24, 2015

Please see http://bugs.python.org/issue25722 for the issue causing the SSL failures and their response. It looks like this is working as per RFC which means that s3cmd should special case this. Let me know if you want another issue open.

@jamiejackson

This comment has been minimized.

Show comment
Hide comment
@jamiejackson

jamiejackson Dec 7, 2015

Could someone explain how I'd get past these problems on RHEL 7.2, at the moment? (I'm dead in the water since my server seems to have been upgraded to 7.2.) Trying to follow the breadcrumbs here, but I'm not seeing the whole picture.

(For instance, is there some fork/branch combo I can check out and use instead of the packaged one? Or is a package fix imminent?)

jamiejackson commented Dec 7, 2015

Could someone explain how I'd get past these problems on RHEL 7.2, at the moment? (I'm dead in the water since my server seems to have been upgraded to 7.2.) Trying to follow the breadcrumbs here, but I'm not seeing the whole picture.

(For instance, is there some fork/branch combo I can check out and use instead of the packaged one? Or is a package fix imminent?)

@mdomsch

This comment has been minimized.

Show comment
Hide comment
@mdomsch

mdomsch Dec 7, 2015

Member

Please try with this branch:

https://github.com/s3tools/s3cmd/tree/atodorov-ssl_wildcard_fix

On Mon, Dec 7, 2015 at 3:31 PM, Jamie Jackson notifications@github.com
wrote:

Could someone explain how I'd get past these problems on RHEL 7.2, at the
moment? (I'm dead in the water since my server seems to have been upgraded
to 7.2.) Trying to follow the breadcrumbs here, but I'm not seeing the
whole picture.

(For instance, is there some fork/branch combo I can check out and use
instead of the packaged one? Or is a package fix imminent?)


Reply to this email directly or view it on GitHub
#647 (comment).

Member

mdomsch commented Dec 7, 2015

Please try with this branch:

https://github.com/s3tools/s3cmd/tree/atodorov-ssl_wildcard_fix

On Mon, Dec 7, 2015 at 3:31 PM, Jamie Jackson notifications@github.com
wrote:

Could someone explain how I'd get past these problems on RHEL 7.2, at the
moment? (I'm dead in the water since my server seems to have been upgraded
to 7.2.) Trying to follow the breadcrumbs here, but I'm not seeing the
whole picture.

(For instance, is there some fork/branch combo I can check out and use
instead of the packaged one? Or is a package fix imminent?)


Reply to this email directly or view it on GitHub
#647 (comment).

@mdomsch

This comment has been minimized.

Show comment
Hide comment
@mdomsch

mdomsch Dec 7, 2015

Member

please report success/failure with the above branch. I don't have a RHEL
7.2 system (I have CentOS 7.2 which isn't new enough).

On Mon, Dec 7, 2015 at 4:14 PM, Matt Domsch matt@domsch.com wrote:

Please try with this branch:

https://github.com/s3tools/s3cmd/tree/atodorov-ssl_wildcard_fix

On Mon, Dec 7, 2015 at 3:31 PM, Jamie Jackson notifications@github.com
wrote:

Could someone explain how I'd get past these problems on RHEL 7.2, at the
moment? (I'm dead in the water since my server seems to have been upgraded
to 7.2.) Trying to follow the breadcrumbs here, but I'm not seeing the
whole picture.

(For instance, is there some fork/branch combo I can check out and use
instead of the packaged one? Or is a package fix imminent?)


Reply to this email directly or view it on GitHub
#647 (comment).

Member

mdomsch commented Dec 7, 2015

please report success/failure with the above branch. I don't have a RHEL
7.2 system (I have CentOS 7.2 which isn't new enough).

On Mon, Dec 7, 2015 at 4:14 PM, Matt Domsch matt@domsch.com wrote:

Please try with this branch:

https://github.com/s3tools/s3cmd/tree/atodorov-ssl_wildcard_fix

On Mon, Dec 7, 2015 at 3:31 PM, Jamie Jackson notifications@github.com
wrote:

Could someone explain how I'd get past these problems on RHEL 7.2, at the
moment? (I'm dead in the water since my server seems to have been upgraded
to 7.2.) Trying to follow the breadcrumbs here, but I'm not seeing the
whole picture.

(For instance, is there some fork/branch combo I can check out and use
instead of the packaged one? Or is a package fix imminent?)


Reply to this email directly or view it on GitHub
#647 (comment).

@mdomsch

This comment has been minimized.

Show comment
Hide comment
@mdomsch

mdomsch Dec 8, 2015

Member

I pushed the fix to github.com/s3tools/s3cmd master branch last night. #673

On Mon, Dec 7, 2015 at 4:14 PM, Matt Domsch matt@domsch.com wrote:

please report success/failure with the above branch. I don't have a RHEL
7.2 system (I have CentOS 7.2 which isn't new enough).

On Mon, Dec 7, 2015 at 4:14 PM, Matt Domsch matt@domsch.com wrote:

Please try with this branch:

https://github.com/s3tools/s3cmd/tree/atodorov-ssl_wildcard_fix

On Mon, Dec 7, 2015 at 3:31 PM, Jamie Jackson notifications@github.com
wrote:

Could someone explain how I'd get past these problems on RHEL 7.2, at
the moment? (I'm dead in the water since my server seems to have been
upgraded to 7.2.) Trying to follow the breadcrumbs here, but I'm not seeing
the whole picture.

(For instance, is there some fork/branch combo I can check out and use
instead of the packaged one? Or is a package fix imminent?)


Reply to this email directly or view it on GitHub
#647 (comment).

Member

mdomsch commented Dec 8, 2015

I pushed the fix to github.com/s3tools/s3cmd master branch last night. #673

On Mon, Dec 7, 2015 at 4:14 PM, Matt Domsch matt@domsch.com wrote:

please report success/failure with the above branch. I don't have a RHEL
7.2 system (I have CentOS 7.2 which isn't new enough).

On Mon, Dec 7, 2015 at 4:14 PM, Matt Domsch matt@domsch.com wrote:

Please try with this branch:

https://github.com/s3tools/s3cmd/tree/atodorov-ssl_wildcard_fix

On Mon, Dec 7, 2015 at 3:31 PM, Jamie Jackson notifications@github.com
wrote:

Could someone explain how I'd get past these problems on RHEL 7.2, at
the moment? (I'm dead in the water since my server seems to have been
upgraded to 7.2.) Trying to follow the breadcrumbs here, but I'm not seeing
the whole picture.

(For instance, is there some fork/branch combo I can check out and use
instead of the packaged one? Or is a package fix imminent?)


Reply to this email directly or view it on GitHub
#647 (comment).

@jamiejackson

This comment has been minimized.

Show comment
Hide comment
@jamiejackson

jamiejackson Dec 8, 2015

@mdomsch Using master, I no longer get the error (the title of this issue), and the sync completes sucessfully. Thanks for the reply.

I won't hold you to it, of course, but for planning purposes, how long would you guess it would take for this to hit RHEL repos (days, weeks, months)?

jamiejackson commented Dec 8, 2015

@mdomsch Using master, I no longer get the error (the title of this issue), and the sync completes sucessfully. Thanks for the reply.

I won't hold you to it, of course, but for planning purposes, how long would you guess it would take for this to hit RHEL repos (days, weeks, months)?

@mdomsch

This comment has been minimized.

Show comment
Hide comment
@mdomsch

mdomsch Dec 8, 2015

Member

@fviard and I were discussing, and there are a few more things we'd like in
1.6.1. We hope to have a release early next week, and I'll push to EPEL
testing immediately at that time. It needs at least 2 weeks in EPEL
testing, or +3 karma, to get pushed to the main EPEL repo, so after the
holiday break in practice.

Thanks,
Matt

On Tue, Dec 8, 2015 at 11:48 AM, Jamie Jackson notifications@github.com
wrote:

@mdomsch https://github.com/mdomsch Using master, I no longer get the
error (the title of this issue), and the sync completes sucessfully. Thanks
for the reply.

I won't hold you to it, of course, but for planning purposes, how long
would you guess it would take for this to hit RHEL repos (days, weeks,
months)?


Reply to this email directly or view it on GitHub
#647 (comment).

Member

mdomsch commented Dec 8, 2015

@fviard and I were discussing, and there are a few more things we'd like in
1.6.1. We hope to have a release early next week, and I'll push to EPEL
testing immediately at that time. It needs at least 2 weeks in EPEL
testing, or +3 karma, to get pushed to the main EPEL repo, so after the
holiday break in practice.

Thanks,
Matt

On Tue, Dec 8, 2015 at 11:48 AM, Jamie Jackson notifications@github.com
wrote:

@mdomsch https://github.com/mdomsch Using master, I no longer get the
error (the title of this issue), and the sync completes sucessfully. Thanks
for the reply.

I won't hold you to it, of course, but for planning purposes, how long
would you guess it would take for this to hit RHEL repos (days, weeks,
months)?


Reply to this email directly or view it on GitHub
#647 (comment).

@jamiejackson

This comment has been minimized.

Show comment
Hide comment
@jamiejackson

jamiejackson Dec 8, 2015

That's helpful, @mdomsch, thanks.

jamiejackson commented Dec 8, 2015

That's helpful, @mdomsch, thanks.

@lekkerduidelijk

This comment has been minimized.

Show comment
Hide comment
@lekkerduidelijk

lekkerduidelijk Jan 19, 2016

I can confirm these fixes in master work for CentOS 7.2.1511 (Core). The above issue emerged two weeks ago on my cloud server, perhaps also due to server upgrades.
Looking forward to 1.6.1 as well.

lekkerduidelijk commented Jan 19, 2016

I can confirm these fixes in master work for CentOS 7.2.1511 (Core). The above issue emerged two weeks ago on my cloud server, perhaps also due to server upgrades.
Looking forward to 1.6.1 as well.

@mdomsch

This comment has been minimized.

Show comment
Hide comment
@mdomsch

mdomsch Jan 20, 2016

Member

http://koji.fedoraproject.org/koji/taskinfo?taskID=12622836 has the build
for el7 v1.6.1.

On Tue, Jan 19, 2016 at 1:27 AM, Rutger Laurman notifications@github.com
wrote:

I can confirm these fixes in master work for CentOS 7.2.1511 (Core). The
above issue emerged two weeks ago on my cloud server, perhaps also due to
server upgrades.
Looking forward to 1.6.1 as well.


Reply to this email directly or view it on GitHub
#647 (comment).

Member

mdomsch commented Jan 20, 2016

http://koji.fedoraproject.org/koji/taskinfo?taskID=12622836 has the build
for el7 v1.6.1.

On Tue, Jan 19, 2016 at 1:27 AM, Rutger Laurman notifications@github.com
wrote:

I can confirm these fixes in master work for CentOS 7.2.1511 (Core). The
above issue emerged two weeks ago on my cloud server, perhaps also due to
server upgrades.
Looking forward to 1.6.1 as well.


Reply to this email directly or view it on GitHub
#647 (comment).

@andygock

This comment has been minimized.

Show comment
Hide comment
@andygock

andygock Mar 4, 2016

I'm getting the same problem as atodorov above with the UnboundLocalError: local variable 'conn' referenced before assignment

  • CentOS Linux release 7.2.1511 (Core)
  • Python 2.7.5

On machines running CentOS 6.x and Python 2.6.6 - no problems.

All using the same .s3cfg.

I also tried using both atodorov-ssl_wildcard_fix and master branch at the time of writing, but still with the same problem.

Any help would be appreciated. Thanks.

andygock commented Mar 4, 2016

I'm getting the same problem as atodorov above with the UnboundLocalError: local variable 'conn' referenced before assignment

  • CentOS Linux release 7.2.1511 (Core)
  • Python 2.7.5

On machines running CentOS 6.x and Python 2.6.6 - no problems.

All using the same .s3cfg.

I also tried using both atodorov-ssl_wildcard_fix and master branch at the time of writing, but still with the same problem.

Any help would be appreciated. Thanks.

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