LibrePhotos/librephotos

Backend throws exception for some videos, "file not found"

HMKnapp opened this issue ยท 1 comments

๐Ÿ› Bug Report

  • ๐Ÿ“ I've Included a ZIP file containing my librephotos log files
  • โŒ I have looked for similar issues (including closed ones)
  • ๐ŸŽฌ (If applicable) I've provided pictures or links to videos that clearly demonstrate the issue

๐Ÿ“ Description of issue:

Backend crashes after video upload is complete.

proxy           | 192.168.0.190 - - [18/May/2024:22:47:25 +0000] "POST /api/upload/ HTTP/1.1" 200 109 "-" "UhuruPhotos/0.0.220 Dalvik/2.1.0 (Linux; U; Android 10; Nokia 7 plus Build/QKQ1.190828.002)"
backend         | Internal Server Error: /api/upload/complete/
backend         | Traceback (most recent call last):
backend         |   File "/code/api/models/file.py", line 73, in is_video
backend         |     filename = mime.from_file(path)
backend         |   File "/usr/local/lib/python3.10/dist-packages/magic/__init__.py", line 112, in from_file
backend         |     with _real_open(filename):
backend         | FileNotFoundError: [Errno 2] No such file or directory: ''
backend         | 
backend         | During handling of the above exception, another exception occurred:
backend         | 
backend         | Traceback (most recent call last):
backend         |   File "/usr/local/lib/python3.10/dist-packages/django/core/handlers/exception.py", line 55, in inner
backend         |     response = get_response(request)
backend         |   File "/usr/local/lib/python3.10/dist-packages/django/core/handlers/base.py", line 197, in _get_response
backend         |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
backend         |   File "/usr/local/lib/python3.10/dist-packages/django/views/generic/base.py", line 104, in view
backend         |     return self.dispatch(request, *args, **kwargs)
backend         |   File "/usr/local/lib/python3.10/dist-packages/django/utils/decorators.py", line 46, in _wrapper
backend         |     return bound_method(*args, **kwargs)
backend         |   File "/usr/local/lib/python3.10/dist-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
backend         |     return view_func(*args, **kwargs)
backend         |   File "/usr/local/lib/python3.10/dist-packages/django/views/generic/base.py", line 143, in dispatch
backend         |     return handler(request, *args, **kwargs)
backend         |   File "/usr/local/lib/python3.10/dist-packages/chunked_upload/views.py", line 100, in post
backend         |     return self._post(request, *args, **kwargs)
backend         |   File "/usr/local/lib/python3.10/dist-packages/chunked_upload/views.py", line 288, in _post
backend         |     self.on_completion(chunked_upload.get_uploaded_file(), request)
backend         |   File "/code/api/views/upload.py", line 144, in on_completion
backend         |     create_new_image(user, photo_path)
backend         |   File "/code/api/directory_watcher.py", line 82, in create_new_image
backend         |     if not is_valid_media(path):
backend         |   File "/code/api/models/file.py", line 133, in is_valid_media
backend         |     if is_video(path) or is_raw(path) or is_metadata(path):
backend         |   File "/code/api/models/file.py", line 77, in is_video
backend         |     raise False
backend         | TypeError: exceptions must derive from BaseException
proxy           | 192.168.0.190 - - [18/May/2024:22:47:26 +0000] "POST /api/upload/complete/ HTTP/1.1" 500 145 "-" "UhuruPhotos/0.0.220 Dalvik/2.1.0 (Linux; U; Android 10; Nokia 7 plus Build/QKQ1.190828.002)"

The video in question exists on the server. The same exception happens with other videos from the same phone as well.
(This could be an issue with Uhuru Photos, not necessarily with librephotos apart from the unhandled exception.)

๐Ÿ” How can we reproduce it:

I can send you the video if you like.

Please provide additional information:

  • ๐Ÿ’ป Operating system: librephotos-gpu Docker image
  • โš™ Architecture (x86 or ARM): x86_64
  • ๐Ÿ”ข Librephotos version: 2024w05
  • ๐Ÿ“ธ Librephotos installation method (Docker, Kubernetes, .deb, etc.): Docker
  • ๐Ÿ‹ If Docker or Kubernets, provide docker-compose image tag: librephotos-gpu:latest
  • ๐Ÿ“ How is you picture library mounted (Local file system (Type), NFS, SMB, etc.): local
  • โ˜ If you are virtualizing librephotos, Virtualization platform (Proxmox, Xen, HyperV, etc.):

Hi things I need

  1. API logs before the error
  2. Video clip of the error