FAI-CIVL / FAI-Airscore

AirScore - online paragliding / hanggliding GAP-based scoring software.
https://airscore.cc/
GNU General Public License v3.0
13 stars 17 forks source link

unable to score a task when scores exist but are not on server #163

Closed kuaka closed 3 years ago

kuaka commented 3 years ago

Trying to score a task that has already been scored but result files are missing results in error: airscore_prod | File "/app/airscore/user/views.py", line 1106, in _score_task airscore_prod | comp.create_results(session['compid'], data['status'], name_suffix='Overview') airscore_prod | File "/app/airscore/core/comp.py", line 376, in create_results airscore_prod | task = Task.create_from_json(task_id=t.task_id, filename=t.file) airscore_prod | File "/app/airscore/core/task.py", line 1068, in create_from_json airscore_prod | with open(path.join(RESULTDIR, filename), encoding='utf-8') as json_data: airscore_prod | FileNotFoundError: [Errno 2] No such file or directory: '/app/airscore/data/results/lega20_2_T2_20200721_134518.json'

the process created a new file for task 1 (96 airscore_fai) but hangs as it is trying to find other task (t2) result file. then even if there is a new T1 file this is not present when refreshing the page. I believe previously, one could re-score a task even if previous results were no longer available.

biuti commented 3 years ago

I think this is related to a 'Overview' comp_result file that is automatically created each new task result creation, I'm not sure about its use, but I guess the problem existed before. It is created if auto publish is checked, but then it is not used. I'll adapt functions of comp result creation to be able to auto publish as well, and will add a fail protection to avoid error in task scoring.

biuti commented 3 years ago

Should be fixed with https://github.com/FAI-CIVL/FAI-Airscore/commit/57974b79fcc012e573244ce07569f2d1da47fbef.

kuaka commented 3 years ago

I have tested. I can now score which is great. However I scored task 1 (of 2) and published. the results page showed "not yet scored" for both tasks. After scoring task 2 and publishing, both results were available. Not sure if this is related to this issue.

kuaka commented 3 years ago

closing as #178 fix applies.