Revision 59f0b3bb472e118ce905bf07c5567bcedeaca5e6 authored by Saurabh Yadav on 11 January 2022, 12:49:01 UTC, committed by GitHub on 11 January 2022, 12:49:01 UTC
Issue Summary: File downloaded from cloud storage is not flushed. In case of lot of files, for some files, changes don't reflect in the actual physical file. Actual file is later accessed by filename, which leads to read error.

Issue Error logs:

```
2022-01-05 09:54:14,992 DEBG 'runserver' stderr output:
[Wed Jan 05 09:54:14.992125 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868] [2022-01-05 09:54:14,991] ERROR cvat.server.task_12: cannot get requested data type: chunk, number: 0, quality: Quality.COMPRESSED
[Wed Jan 05 09:54:14.992147 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868] Traceback (most recent call last):
[Wed Jan 05 09:54:14.992152 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868]   File "/home/django/cvat/apps/engine/cache.py", line 96, in prepare_chunk_buff
[Wed Jan 05 09:54:14.992156 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868]     if checksum and not md5_hash(source_path) == checksum:
[Wed Jan 05 09:54:14.992159 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868]   File "/home/django/cvat/apps/engine/utils.py", line 100, in md5_hash
[Wed Jan 05 09:54:14.992163 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868]     frame = Image.open(frame, 'r')
[Wed Jan 05 09:54:14.992166 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868]   File "/opt/venv/lib/python3.8/site-packages/PIL/Image.py", line 3023, in open
[Wed Jan 05 09:54:14.992186 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868]     raise UnidentifiedImageError(
[Wed Jan 05 09:54:14.992189 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868] PIL.UnidentifiedImageError: cannot identify image file '/tmp/cvat_041w7vsimages#0089c635-ae5f-49d7-baa5-a4d75f0412ca.png'
[Wed Jan 05 09:54:14.992192 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868]
[Wed Jan 05 09:54:14.992196 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868] During handling of the above exception, another exception occurred:
[Wed Jan 05 09:54:14.992199 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868]

2022-01-05 09:54:14,992 DEBG 'runserver' stderr output:
[Wed Jan 05 09:54:14.992202 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868] Traceback (most recent call last):
[Wed Jan 05 09:54:14.992205 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868]   File "/home/django/cvat/apps/engine/views.py", line 689, in data
[Wed Jan 05 09:54:14.992208 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868]     buff, mime_type = frame_provider.get_chunk(data_id, data_quality)
[Wed Jan 05 09:54:14.992211 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868]   File "/home/django/cvat/apps/engine/frame_provider.py", line 167, in get_chunk
[Wed Jan 05 09:54:14.992215 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868]     return self._loaders[quality].get_chunk_path(chunk_number, quality, self._db_data)
[Wed Jan 05 09:54:14.992218 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868]   File "/home/django/cvat/apps/engine/cache.py", line 32, in get_buff_mime
[Wed Jan 05 09:54:14.992221 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868]     chunk, tag = self.prepare_chunk_buff(db_data, quality, chunk_number)
[Wed Jan 05 09:54:14.992224 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868]   File "/home/django/cvat/apps/engine/cache.py", line 113, in prepare_chunk_buff
[Wed Jan 05 09:54:14.992227 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868]     raise Exception(msg)
[Wed Jan 05 09:54:14.992231 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868] Exception: cannot identify image file '/tmp/cvat_041w7vsimages#0089c635-ae5f-49d7-baa5-a4d75f0412ca.png'
[Wed Jan 05 09:54:14.992414 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868] ERROR - 2022-01-05 09:54:14,991 - views - cannot get requested data type: chunk, number: 0, quality: Quality.COMPRESSED
[Wed Jan 05 09:54:14.992425 2022] [wsgi:error] [pid 330:tid 139683931096832] [remote 172.20.0.2:56868] Traceback (most recent call last):
```
1 parent cd1f89e
Raw File
.coveragerc
[run]
branch = true
# relative_files = true # does not work?

source =
    cvat/apps/
    utils/cli/
    utils/dataset_manifest

omit =
    cvat/settings/*
    */tests/*
    */test_*
    */_test_*
    */migrations/*

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
    # Have to re-enable the standard pragma
    pragma: no cover

    # Don't complain about missing debug-only code:
    def __repr__
    if\s+[\w\.()]+\.isEnabledFor\(log\.DEBUG\):

    # Don't complain if tests don't hit defensive assertion code:
    raise AssertionError
    raise NotImplementedError

    # Don't complain if non-runnable code isn't run:
    if 0:
    if __name__ == .__main__.:

# don't fail on the code that can be found
ignore_errors = true

skip_empty = true
back to top