Skip to content

Video files with long names fail to generate a preview #669

@gguillemas

Description

@gguillemas

Description

Video files with names longer than approximately 120 characters fail to generate previews. The preview endpoint returns a 500 error code. As far as I can see, the actual reason for the error is not present in any logs. File names of this length are common when serving videos downloaded from Youtube with tools like yt-dlp, which preserve the original title by default.

Expected behaviour

Previews are generated for all compatible video files regardless of the length of their name.

What is happening instead?

The preview is not generated and a 500 error code is returned by the preview endpoint. No errors are logged.

name@server:/tmp$ docker run -it \
  -v ./video.mp4:/srv/80-character-filename-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.mp4 \
  -v ./video.mp4:/srv/100-character-filename-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.mp4 \
  -v ./video.mp4:/srv/120-character-filename-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.mp4 \
  -v ./video.mp4:/srv/140-character-filename-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.mp4 \
  -p 8080:80 gtstef/filebrowser
2025/05/23 08:42:29 Initializing FileBrowser Quantum (v0.7.4-beta)
2025/05/23 08:42:29 Using Config file        : config.yaml
2025/05/23 08:42:29 Auth Methods             : [password]
2025/05/23 08:42:29 Creating new database    : database.db
2025/05/23 08:42:29 Sources                  : [srv: /srv]
2025/05/23 08:42:29 Running at               : http://localhost/
2025/05/23 08:42:30 initializing index: [srv]
2025/05/23 08:42:30 Index assessment         : [srv] complexity=simple directories=0 files=4
2025/05/23 08:42:33 GET     | 200 | 192.168.1.150:55813 |              | 0ms          | "/files/"
2025/05/23 08:42:33 GET     | 401 | 192.168.1.150:55814 |              | 0ms          | "/api/users?id=self"
2025/05/23 08:42:35 POST    | 200 | 192.168.1.150:55814 |              | 49ms         | "/api/auth/login"
2025/05/23 08:42:35 GET     | 200 | 192.168.1.150:55814 | admin        | 0ms          | "/api/users?id=self"
2025/05/23 08:42:35 GET     | 200 | 192.168.1.150:55814 | admin        | 0ms          | "/api/resources?path=%2F&source=srv"
2025/05/23 08:42:35 GET     | 200 | 192.168.1.150:55814 | admin        | 0ms          | "/api/jobs/status/sources"
2025/05/23 08:42:35 GET     | 200 | 192.168.1.150:55817 | admin        | 231ms        | "/api/preview?path=%2F80-character-filename-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.mp4&size=large&key=1747989749453&source=srv&inline=true"
2025/05/23 08:42:35 GET     | 200 | 192.168.1.150:55814 | admin        | 233ms        | "/api/preview?path=%2F100-character-filename-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.mp4&size=large&key=1747989749453&source=srv&inline=true"
2025/05/23 08:42:38 GET     | 500 | 192.168.1.150:55817 | admin        | 137ms        | "/api/preview?path=%2F120-character-filename-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.mp4&size=large&key=1747989749453&source=srv&inline=true"
2025/05/23 08:42:39 GET     | 500 | 192.168.1.150:55814 | admin        | 124ms        | "/api/preview?path=%2F140-character-filename-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.mp4&size=large&key=1747989749453&source=srv&inline=true"

Additional context

This issue triggers when running Filebrowser Quantum with its default configuration and with any compatible video file that I have tested.

How to reproduce?

The bug can be reproduced with this example, which only requires a working video file named video.mp4 in the working directory.

docker run -it \
  -v ./video.mp4:/srv/80-character-filename-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.mp4 \
  -v ./video.mp4:/srv/100-character-filename-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.mp4 \
  -v ./video.mp4:/srv/120-character-filename-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.mp4 \
  -v ./video.mp4:/srv/140-character-filename-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.mp4 \
  -p 8080:80 gtstef/filebrowser

Once the server is running, visit the interface on localhost, log in with the default credentials admin / admin and verify that previews for 80 and 100 character filenames have been generated whereas those for 120 and 140 character filenames have not.

Files

No specific files. Any compatible video file should trigger the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions