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

ConnectionResetError exception leads to another exception: TypeError: decoding to str: need a bytes-like object, NoneType found #1174

Closed
cure opened this issue Feb 5, 2021 · 2 comments

Comments

@cure
Copy link

cure commented Feb 5, 2021

2021-02-05T01:25:34.495514092Z
2021-02-05T01:25:34.495514092Z !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2021-02-05T01:25:34.495514092Z An unexpected error has occurred.
2021-02-05T01:25:34.495514092Z Please try reproducing the error using
2021-02-05T01:25:34.495514092Z the latest s3cmd code from the git master
2021-02-05T01:25:34.495514092Z branch found at:
2021-02-05T01:25:34.495514092Z https://github.com/s3tools/s3cmd
2021-02-05T01:25:34.495514092Z and have a look at the known issues list:
2021-02-05T01:25:34.495514092Z https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions
2021-02-05T01:25:34.495514092Z If the error persists, please report the
2021-02-05T01:25:34.495514092Z following lines (removing any private
2021-02-05T01:25:34.495514092Z info as necessary) to:
2021-02-05T01:25:34.495514092Z [email protected]
2021-02-05T01:25:34.495514092Z
2021-02-05T01:25:34.495514092Z
2021-02-05T01:25:34.495514092Z !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2021-02-05T01:25:34.495514092Z
2021-02-05T01:25:34.495514092Z Invoked as: /usr/share/python3/dist/python3-arvados-cwl-runner/bin/s3cmd get --requester-pays --access_key=STRIPPED --secret_key=STRIPPED s3://STRIPPED -
2021-02-05T01:25:34.495514092Z Problem: <class 'ConnectionResetError: [Errno 104] Connection reset by peer
2021-02-05T01:25:34.495514092Z S3cmd: 2.1.0
2021-02-05T01:25:34.495514092Z python: 3.7.3 (default, Jul 25 2020, 13:03:44)
2021-02-05T01:25:34.495514092Z [GCC 8.3.0]
2021-02-05T01:25:34.505515818Z Traceback (most recent call last):
2021-02-05T01:25:34.505515818Z File "/usr/share/python3/dist/python3-arvados-cwl-runner/bin/s3cmd", line 3121, in
2021-02-05T01:25:34.505515818Z rc = main()
2021-02-05T01:25:34.505515818Z File "/usr/share/python3/dist/python3-arvados-cwl-runner/bin/s3cmd", line 3030, in main
2021-02-05T01:25:34.505515818Z rc = cmd_func(args)
2021-02-05T01:25:34.505515818Z File "/usr/share/python3/dist/python3-arvados-cwl-runner/bin/s3cmd", line 604, in cmd_object_get
2021-02-05T01:25:34.505515818Z response = s3.object_get(uri, dst_stream, destination, start_position = start_position, extra_label = seq_label)
2021-02-05T01:25:34.505515818Z File "/usr/share/python3/dist/python3-arvados-cwl-runner/lib/python3.7/site-packages/S3/S3.py", line 726, in object_get
2021-02-05T01:25:34.505515818Z response = self.recv_file(request, stream, labels, start_position)
2021-02-05T01:25:34.505515818Z File "/usr/share/python3/dist/python3-arvados-cwl-runner/lib/python3.7/site-packages/S3/S3.py", line 1690, in recv_file
2021-02-05T01:25:34.505515818Z request, stream, labels, start_position)
2021-02-05T01:25:34.505515818Z File "/usr/share/python3/dist/python3-arvados-cwl-runner/lib/python3.7/site-packages/S3/S3.py", line 1198, in _http_400_handler
2021-02-05T01:25:34.505515818Z return fn(*args, **kwargs)
2021-02-05T01:25:34.505515818Z File "/usr/share/python3/dist/python3-arvados-cwl-runner/lib/python3.7/site-packages/S3/S3.py", line 1733, in recv_file
2021-02-05T01:25:34.505515818Z data = http_response.read(this_chunk)
2021-02-05T01:25:34.505515818Z File "/usr/lib/python3.7/http/client.py", line 457, in read
2021-02-05T01:25:34.505515818Z n = self.readinto(b)
2021-02-05T01:25:34.505515818Z File "/usr/lib/python3.7/http/client.py", line 501, in readinto
2021-02-05T01:25:34.505515818Z n = self.fp.readinto(b)
2021-02-05T01:25:34.505515818Z File "/usr/lib/python3.7/socket.py", line 589, in readinto
2021-02-05T01:25:34.505515818Z return self._sock.recv_into(b)
2021-02-05T01:25:34.505515818Z File "/usr/lib/python3.7/ssl.py", line 1052, in recv_into
2021-02-05T01:25:34.505515818Z return self.read(nbytes, buffer)
2021-02-05T01:25:34.505515818Z File "/usr/lib/python3.7/ssl.py", line 911, in read
2021-02-05T01:25:34.505515818Z return self._sslobj.read(len, buffer)
2021-02-05T01:25:34.505515818Z ConnectionResetError: [Errno 104] Connection reset by peer
2021-02-05T01:25:34.505515818Z
2021-02-05T01:25:34.505515818Z During handling of the above exception, another exception occurred:
2021-02-05T01:25:34.505515818Z
2021-02-05T01:25:34.505515818Z Traceback (most recent call last):
2021-02-05T01:25:34.505515818Z File "/usr/share/python3/dist/python3-arvados-cwl-runner/bin/s3cmd", line 3171, in
2021-02-05T01:25:34.505515818Z report_exception(e)
2021-02-05T01:25:34.505515818Z File "/usr/share/python3/dist/python3-arvados-cwl-runner/bin/s3cmd", line 3076, in report_exception
2021-02-05T01:25:34.505515818Z sys.stderr.write(u"environment LANG=%s\n" % unicodise_s(os.getenv("LANG"), 'ascii'))
2021-02-05T01:25:34.505515818Z File "/usr/share/python3/dist/python3-arvados-cwl-runner/lib/python3.7/site-packages/S3/Utils.py", line 321, in unicodise_s
2021-02-05T01:25:34.505515818Z return unicodise(string, encoding, errors, True)
2021-02-05T01:25:34.505515818Z File "/usr/share/python3/dist/python3-arvados-cwl-runner/lib/python3.7/site-packages/S3/Utils.py", line 312, in unicodise
2021-02-05T01:25:34.505515818Z return unicode(string, encoding, errors)
2021-02-05T01:25:34.505515818Z TypeError: decoding to str: need a bytes-like object, NoneType found

@robotogre
Copy link

This is also happening to me.

`C:\Users\robotogre\Downloads\s3cmd-2.1.0\s3cmd-2.1.0> python s3cmd setcors cors.xml s3://robotogre-digitalocean

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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:
[email protected]

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

Invoked as: s3cmd setcors cors.xml s3://robotogre-digitalocean
Problem: <class 'AttributeError: module 'base64' has no attribute 'encodestring'
S3cmd: 2.1.0
python: 3.9.1 (tags/v3.9.1:1e5d33e, Dec 7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)]
Traceback (most recent call last):
File "C:\Users\robotogre\Downloads\s3cmd-2.1.0\s3cmd-2.1.0\s3cmd", line 3121, in
rc = main()
File "C:\Users\robotogre\Downloads\s3cmd-2.1.0\s3cmd-2.1.0\s3cmd", line 3030, in main
rc = cmd_func(args)
File "C:\Users\robotogre\Downloads\s3cmd-2.1.0\s3cmd-2.1.0\s3cmd", line 1994, in cmd_setcors
response = s3.set_cors(uri, cors)
File "C:\Users\robotogre\Downloads\s3cmd-2.1.0\s3cmd-2.1.0\S3\S3.py", line 1010, in set_cors
headers['content-md5'] = compute_content_md5(cors)
File "C:\Users\robotogre\Downloads\s3cmd-2.1.0\s3cmd-2.1.0\S3\S3.py", line 1831, in compute_content_md5
base64md5 = base64.encodestring(m.digest())
AttributeError: module 'base64' has no attribute 'encodestring'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\robotogre\Downloads\s3cmd-2.1.0\s3cmd-2.1.0\s3cmd", line 3201, in
report_exception(e)
File "C:\Users\robotogre\Downloads\s3cmd-2.1.0\s3cmd-2.1.0\s3cmd", line 3076, in report_exception
sys.stderr.write(u"environment LANG=%s\n" % unicodise_s(os.getenv("LANG"), 'ascii'))
File "C:\Users\robotogre\Downloads\s3cmd-2.1.0\s3cmd-2.1.0\S3\Utils.py", line 321, in unicodise_s
return unicodise(string, encoding, errors, True)
File "C:\Users\robotogre\Downloads\s3cmd-2.1.0\s3cmd-2.1.0\S3\Utils.py", line 312, in unicodise
return unicode(string, encoding, errors)
TypeError: decoding to str: need a bytes-like object, NoneType found`

@fviard
Copy link
Contributor

fviard commented Sep 27, 2021

@robd003 fyi, your issue is not the same as the one originally reported.
Your problem should be fixed with the version in MASTER and the 2.2.0 to be released.

@fviard fviard closed this as completed Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants