Skip to content

Commit 5e16389

Browse files
authored
Fix: NoneType Error on DPCloudServer (#237)
1 parent 0b28ec3 commit 5e16389

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

dpdispatcher/dp_cloud_server.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,14 @@ def check_status(self, job):
124124
check_return = None
125125
# print("api",self.api_version,self.input_data.get('job_group_id'),job.job_id)
126126
check_return = self.api.get_tasks(job_id,group_id)
127-
try:
127+
assert (check_return is not None), f"Failed to retrieve tasks information. To resubmit this job, please " \
128+
f"try again, if this problem still exists please delete the submission " \
129+
f"file and try again.\nYou can check submission.submission_hash in the " \
130+
f"previous log or type `grep -rl \"{job_id}:job_group_id:{group_id}\" " \
131+
f"~/.dpdispatcher/dp_cloud_server/` to find corresponding file. " \
132+
f"You can try with command:\n " \
133+
f'rm $(grep -rl "{job_id}:job_group_id:{group_id}" ~/.dpdispatcher/dp_cloud_server/)'
134+
try:
128135
dp_job_status = check_return["status"]
129136
except IndexError as e:
130137
dlog.error(f"cannot find job information in bohrium for job {job.job_id}. check_return:{check_return}; retry one more time after 60 seconds")

0 commit comments

Comments
 (0)