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

follow_logs may raise UnicodeDecodeError #136

Closed
fabricebrito opened this issue Sep 12, 2022 · 1 comment
Closed

follow_logs may raise UnicodeDecodeError #136

fabricebrito opened this issue Sep 12, 2022 · 1 comment

Comments

@fabricebrito
Copy link
Contributor

follow_logs may raise an UnicodeDecodeError when the pod logs something not utf-8:

�[1;30mDEBUG�[0m �[32mrestore [ram: 32000, cores: 6] to available [ram: 0.0, cores: 0.0]�[0m
�[1;30mDEBUG�[0m �[32m[workflow ] job step file:///workflow-input/..2022_09_12_13_27_45.427694849/workflow.cwl#main/node_stage_out not ready�[0m
�[1;30mDEBUG�[0m �[32m[workflow on_stage] job step file:///workflow-input/..2022_09_12_13_27_45.427694849/workflow.cwl#dlr-insar-browse/node_stac not ready�[0m
�[1;30mDEBUG�[0m �[32mwait_for_completion with 0 futures�[0m
�[1;30mERROR�[0m �[31mFound a queued exception, canceling outstanding futures�[0m
�[1;30mERROR�[0m �[31mWaiting for canceled futures to finish�[0m
�[1;30mERROR�[0m �[31mGot workflow error�[0m
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/calrissian/executor.py", line 256, in raise_if_exception_queued
    raise exceptions[0]
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/calrissian/job.py", line 652, in run
    completion_result = self.wait_for_kubernetes_pod()
  File "/usr/local/lib/python3.7/site-packages/calrissian/job.py", line 392, in wait_for_kubernetes_pod
    return self.client.wait_for_completion()
  File "/usr/local/lib/python3.7/site-packages/tenacity/__init__.py", line 292, in wrapped_f
    return self.call(f, *args, **kw)
  File "/usr/local/lib/python3.7/site-packages/tenacity/__init__.py", line 358, in call
    do = self.iter(retry_state=retry_state)
  File "/usr/local/lib/python3.7/site-packages/tenacity/__init__.py", line 319, in iter
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 428, in result
    return self.__get_result()
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.7/site-packages/tenacity/__init__.py", line 361, in call
    result = fn(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/calrissian/k8s.py", line 156, in wait_for_completion
    self.follow_logs() # This will not return until pod completes
  File "/usr/local/lib/python3.7/site-packages/tenacity/__init__.py", line 292, in wrapped_f
    return self.call(f, *args, **kw)
  File "/usr/local/lib/python3.7/site-packages/tenacity/__init__.py", line 358, in call
    do = self.iter(retry_state=retry_state)
  File "/usr/local/lib/python3.7/site-packages/tenacity/__init__.py", line 319, in iter
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 428, in result
    return self.__get_result()
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.7/site-packages/tenacity/__init__.py", line 361, in call
    result = fn(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/calrissian/k8s.py", line 140, in follow_logs
    line = line.decode('utf-8').rstrip()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 64: invalid start byte
�[1;30mERROR�[0m �[31mWorkflow error:
'utf-8' codec can't decode byte 0xb0 in position 64: invalid start byte�[0m
@emmanuelmathot
Copy link
Collaborator

fixed in #137

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

2 participants