-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
When I'am exec pod use tail -200f xxx.log.The following error is often reported
Exception in thread Thread-426:
Traceback (most recent call last):
File "/data/pyenv/versions/3.7.0/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/data/SeaOPS/Base/api/views_file/kubernetes.py", line 591, in run
requests[fileno] = self.chan.read_stdout()
File "/data/pyenv/versions/3.7.0/lib/python3.7/site-packages/kubernetes/stream/ws_client.py", line 122, in read_stdout
return self.read_channel(STDOUT_CHANNEL, timeout=timeout)
File "/data/pyenv/versions/3.7.0/lib/python3.7/site-packages/kubernetes/stream/ws_client.py", line 86, in read_channel
ret = self.peek_channel(channel, timeout)
File "/data/pyenv/versions/3.7.0/lib/python3.7/site-packages/kubernetes/stream/ws_client.py", line 78, in peek_channel
self.update(timeout=timeout)
File "/data/pyenv/versions/3.7.0/lib/python3.7/site-packages/kubernetes/stream/ws_client.py", line 182, in update
data = data.decode("utf-8")
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 4095-4096: unexpected end of data
The utf-8 decode error is currently seen on the source side
Here's some of my code
..........
while self.chan.is_open():
events = self.epoll.poll()
# print("events")
if not self.chan.is_open():
logger.info('container stream connect is closed')
self.websocket.send(bytes("container stream connect is closed", 'utf-8'))
self.websocket.close()
for fileno, event in events:
# print("adsfadsaf:", fileno, event)
if event & select.EPOLLIN:
requests[fileno] = self.chan.read_stdout()
# try:
# requests[fileno] = self.chan.read_stdout()
# except Exception as ee:
# logger.info(str(ee))
self.websocket.send(bytes(requests[fileno], 'utf-8'))
elif event & select.EPOLLHUP:
# print('------------EPOLLHUP-----------')
# 注销对此socket连接的关注
self.epoll.unregister(fileno)
# 关闭socket连
self.websocket.close()
............
Can anyone help me see why that is?Is it a Bug or something else?