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

UnicodeDecodeError: 'utf-8' codec can't decode #427

Open
Franklalalala opened this issue Jan 15, 2024 · 3 comments
Open

UnicodeDecodeError: 'utf-8' codec can't decode #427

Franklalalala opened this issue Jan 15, 2024 · 3 comments
Labels

Comments

@Franklalalala
Copy link
Contributor

When the job is finished, dpdispatcher will check the log file. (See code)
And this will encounter a UnicodeDecodeError:

  File "/opt/mamba/lib/python3.10/site-packages/dpdispatcher/submission.py", line 260, in run_submission
    self.update_submission_state()
  File "/opt/mamba/lib/python3.10/site-packages/dpdispatcher/submission.py", line 345, in update_submission_state
    job.get_job_state()
  File "/opt/mamba/lib/python3.10/site-packages/dpdispatcher/submission.py", line 831, in get_job_state
    job_state = self.machine.check_status(self)
  File "/opt/mamba/lib/python3.10/site-packages/dpdispatcher/machines/dp_cloud_server.py", line 211, in check_status
    job_log = self.api.get_log(job_id)
  File "/opt/mamba/lib/python3.10/site-packages/dpdispatcher/utils/dpcloudserver/client.py", line 281, in get_log
    return resp.content.decode("utf-8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x96 in position 0: invalid start byte

This error seems random. For example, I have 10 jobs, 6 jobs could be successfully downloaded. The rest of jobs could not be automatically downloaded for this error.

@Franklalalala
Copy link
Contributor Author

I can comment out line 211,212,213,217,218 in dp_cloud_server.py to avoid this error. But is there a better way to fix this? Or which log file should I check to avoid this error?

@njzjz
Copy link
Member

njzjz commented Jan 16, 2024

It seems that the upstream API gives an incorrect response. The code here should be correct.

@njzjz njzjz added the upstream label Jan 16, 2024
@njzjz
Copy link
Member

njzjz commented Jan 16, 2024

cc @xiaoyeqiannian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants