-
-
Notifications
You must be signed in to change notification settings - Fork 428
Description
Describe the bug
After a long media processing operation (e.g. processing an .mp4 file for ~ 10 minutes), when the process is done and photoview attempts to perform an INSERT with the result, it will throw this error:
photoview | [mysql] 2022/01/11 09:12:54 connection.go:173: bad connection
photoview | 2022/01/11 09:12:54 ERROR: Failed to begin database transaction: failed to process photo (/photos/2017/04/30/gopro/GOPR0588.MP4): failed to insert video thumbnail image into database (GOPR0588.MP4): driver: bad connection
To Reproduce
Start a new scan with a long media processing operation, after several minutes, when the media processing is complete, photoview will attempt to perform an INSERT and will show the bad connection error.
Expected behavior
Connection shouldn't go bad or should be handled and restored.
Your environment:
- Are you using Docker? Yes
- Database: MariaDB 10.5.13
- Browser: Chrome
- Version: 2.3.9
- Hardware: Raspberry Pi 3
- OS: Raspbian ARM64
Additional context
I found a possible fix here, which has been cherry picked from other projects as well:
Not sure if it is applicable since I know very little about Go. I think it might be related to the speed of the media processing, on my Raspberry Pi there are several videos which takes a while to process and that might cause an unhandled timeout in the database connection (just trying to guess).
Thank you!