Kamilcuk / nomad-tools

Set of tools and utilities to ease interacting with HashiCorp Nomad scheduling solution.
https://github.com/Kamilcuk/nomad-tools
GNU General Public License v3.0
25 stars 3 forks source link

Crash during run #5

Closed jamespanic closed 7 months ago

jamespanic commented 7 months ago

Version 0.2.2

$ nomad-watch --log-format="{mark}>{task + '>' if task else ''}{message}" start job.nomad
nomad-watch>845> INFO + nomad job run -detach -verbose job.nomad
nomad-watch>853> INFO Job registration successful
nomad-watch>853> INFO Evaluation ID: 8cd65244-a22a-1e05-a8e5-9b546662c81b
nomad-watch>1072> INFO Watching job web-download-panic-com/main@default until it is started
eval>Allocation 558855af-d565-2b33-2d28-51e746bd46e9 started on nomadb3
A>web-download-panic-com-main>Received Task received by client
A>web-download-panic-com-main>Task Setup Building Task Directory
A>web-download-panic-com-main>Driver Downloading image
A>web-download-panic-com-main>Started Task started by client
deploy>web Canaries=0/0 Placed=2 Desired=2 Healthy=2 Unhealthy=0 Deployment completed successfully
eval>Allocation 25a92af5-f079-aba0-0616-6e80685ffc00 started on nomadb4
A>web-download-panic-com-main>Received Task received by client
A>web-download-panic-com-main>Task Setup Building Task Directory
A>web-download-panic-com-main>Driver Downloading image
A>web-download-panic-com-main>Started Task started by client
eval>Allocation 55c66bf3-8cc5-5fac-16c2-f091336858cd started on nomadb4
A>web-download-panic-com-main>Killing Sent interrupt. Waiting 5s before force killing
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/nomad_tools/exit_on_thread_exception.py", line 17, in patched_run
    original_run(*args, **kw)
  File "/usr/local/lib/python3.11/dist-packages/nomad_tools/nomad_watch.py", line 547, in run
    self.__run_in()
  File "/usr/local/lib/python3.11/dist-packages/nomad_tools/nomad_watch.py", line 536, in __run_in
    lines = base64.b64decode(line64.encode()).decode().splitlines()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 7718: invalid start byte
Kamilcuk commented 7 months ago

I'll tape it with decode(error="replace"), which will replace 0xc0 by �. Do you think would anyone ever want raw bytes in this output there? I think no.

jamespanic commented 7 months ago

Yeah I agree with that.

Kamilcuk commented 7 months ago

fixed in 0.2.3