Open marcellamaki opened 8 months ago
The ValueError suggests the code is trying to read data from a file that hasn't been completely downloaded yet. This likely throws off the checksum verification step (_verify_checksum) later in the process.
@rtibbles is spot on – the error seems related to how cleanup interacts with content downloads. Ideally, the FileDownload class (kolibri.utils.file_transfer.py) should handle this scenario gracefully, perhaps by waiting for the download to finish before attempting to read or verify the file.
Could I have a bit more context on this issue?
The error here is happening in our code that handles chunked file downloading - it also allows streaming of these files while the download is in progress. What has happened here is that a chunk is trying to be read, but doesn't appear to exist, which is meant to be safeguarded against by the locks that are used.
Oh alright, thank you
I'll keep on looking at it.
Spotted by @bjester in 0.16 syncing session 14-Feb-2024
may have been the cause of subsequent logging:
@rtibbles thinks that it may be related to cleanup happening during content download. Maybe file transfer would handle this, rather than just raising the error? Seems like something has gone wrong with locks that are intended to prevent this!