Project Information
- Repository:
https://github.com/steemit/steem-python - Project Name: Steem Python
- Publisher: Steemit
Expected behaviour
App Continues to stream posts after this is caught (stopped catching it to get the stack trace) but with try-except, it just freezes upon this error occurring.
Hoping that there is some way to restore the connection, at the same point it left at
Actual behavior
The program hangs after the crash and doesn't continue to collect posts from the blockchain (or other data for that matter)
How to reproduce
I think it may have something to do with my internet, as it is rather slow!
Just stream the blockchain as so:
steem = Steem(nodes=["https://api.steemit.com"],keys=['postingkey'])
blockchain = Blockchain()
stream = map(Post, blockchain.stream(filter_by=["comment"]))
- App version: 1.0.1
- Operating system: Ubuntu 16.04.3 LTS Xenial running inside of WSL
- Python Version: 3.6.5
Stack Trace
ERROR:steembase.http_client:Unexpected exception! Please report at https://github.com/steemit/steem-python/issues -- AttributeError: 'bool' object has no attribute 'close'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 226, in _error_catcher
yield
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 297, in read
data = self._fp.read()
File "/usr/lib/python3.6/http/client.py", line 462, in read
s = self._safe_read(self.length)
File "/usr/lib/python3.6/http/client.py", line 612, in _safe_read
chunk = self.fp.read(min(amt, MAXAMOUNT))
File "/usr/lib/python3.6/socket.py", line 586, in readinto
return self._sock.recv_into(b)
File "/usr/lib/python3.6/ssl.py", line 1009, in recv_into
return self.read(nbytes, buffer)
File "/usr/lib/python3.6/ssl.py", line 871, in read
return self._sslobj.read(len, buffer)
File "/usr/lib/python3.6/ssl.py", line 631, in read
v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 231, in _error_catcher
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='api.steemit.com', port=443): Read timed out.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/mnt/e/Users/Conor Howland.DESKTOP-4GTBGEL/tmp/steemyvotes/camention.py", line 17, in <module>
for post in stream:
File "/usr/local/lib/python3.6/dist-packages/steem/blockchain.py", line 233, in stream
for ops in self.stream_from(*args, **kwargs):
File "/usr/local/lib/python3.6/dist-packages/steem/blockchain.py", line 99, in stream_from
for ops in self.steem.get_ops_in_block(block_num, False):
File "/usr/local/lib/python3.6/dist-packages/steem/steemd.py", line 407, in get_ops_in_block
'get_ops_in_block', block_num, virtual_only, api='database_api')
File "/usr/local/lib/python3.6/dist-packages/steembase/http_client.py", line 303, in call
raise e
File "/usr/local/lib/python3.6/dist-packages/steembase/http_client.py", line 241, in call
response = self.request(body=body)
File "/usr/lib/python3/dist-packages/urllib3/poolmanager.py", line 162, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 572, in urlopen
**response_kw)
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 375, in from_httplib
**response_kw)
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 137, in __init__
self._body = self.read(decode_content=decode_content)
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 311, in read
flush_decoder = True
File "/usr/lib/python3.6/contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 256, in _error_catcher
self._connection.close()
AttributeError: 'bool' object has no attribute 'close'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/mnt/e/Users/Conor Howland.DESKTOP-4GTBGEL/tmp/steemyvotes/camention.py", line 30, in <module>
raise AttributeError("'bool' object has no attribute 'close'")
AttributeError: 'bool' object has no attribute 'close'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Original exception was:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 226, in _error_catcher
yield
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 297, in read
data = self._fp.read()
File "/usr/lib/python3.6/http/client.py", line 462, in read
s = self._safe_read(self.length)
File "/usr/lib/python3.6/http/client.py", line 612, in _safe_read
chunk = self.fp.read(min(amt, MAXAMOUNT))
File "/usr/lib/python3.6/socket.py", line 586, in readinto
return self._sock.recv_into(b)
File "/usr/lib/python3.6/ssl.py", line 1009, in recv_into
return self.read(nbytes, buffer)
File "/usr/lib/python3.6/ssl.py", line 871, in read
return self._sslobj.read(len, buffer)
File "/usr/lib/python3.6/ssl.py", line 631, in read
v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 231, in _error_catcher
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='api.steemit.com', port=443): Read timed out.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/mnt/e/Users/Conor Howland.DESKTOP-4GTBGEL/tmp/steemyvotes/camention.py", line 17, in <module>
for post in stream:
File "/usr/local/lib/python3.6/dist-packages/steem/blockchain.py", line 233, in stream
for ops in self.stream_from(*args, **kwargs):
File "/usr/local/lib/python3.6/dist-packages/steem/blockchain.py", line 99, in stream_from
for ops in self.steem.get_ops_in_block(block_num, False):
File "/usr/local/lib/python3.6/dist-packages/steem/steemd.py", line 407, in get_ops_in_block
'get_ops_in_block', block_num, virtual_only, api='database_api')
File "/usr/local/lib/python3.6/dist-packages/steembase/http_client.py", line 303, in call
raise e
File "/usr/local/lib/python3.6/dist-packages/steembase/http_client.py", line 241, in call
response = self.request(body=body)
File "/usr/lib/python3/dist-packages/urllib3/poolmanager.py", line 162, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 572, in urlopen
**response_kw)
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 375, in from_httplib
**response_kw)
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 137, in __init__
self._body = self.read(decode_content=decode_content)
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 311, in read
flush_decoder = True
File "/usr/lib/python3.6/contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 256, in _error_catcher
self._connection.close()
AttributeError: 'bool' object has no attribute 'close'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/mnt/e/Users/Conor Howland.DESKTOP-4GTBGEL/tmp/steemyvotes/camention.py", line 30, in <module>
raise AttributeError("'bool' object has no attribute 'close'")
AttributeError: 'bool' object has no attribute 'close'
Process finished with exit code 1
Hello @cadawg the issue could nor be replicated in my Ubuntu 16.04.3 LTS as you can see the pic below :
After checking in the logcat you provided , i believe there is actually something wrong with your network as it shows time out.
Anyway thanks for the contribution if the issue still shows ,you could submit it to github .
Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit