savonet / liquidsoap

Liquidsoap is a statically typed scripting general-purpose language with dedicated operators and backend for all thing media, streaming, file generation, automation, HTTP backend and more.
http://liquidsoap.info
GNU General Public License v2.0
1.36k stars 121 forks source link

Cover Manager: current_cover_file could be removed #4005

Closed nightridefm closed 1 day ago

nightridefm commented 1 week ago

https://github.com/savonet/liquidsoap/blob/33a62b4858c0d1a9b442fe7aae13f7a0b43c89d0/src/libs/extra/metadata.liq#L28-L42

If there is a name collision with the incoming filename vs last_cover_file(), the current cover file will be removed and cause source errors

vitoyucepi commented 1 week ago

Hi @nightridefm, Could you share the logs for this case? As far as I remember the filename can be either default or the result file.temp.

nightridefm commented 1 week ago

@vitoyucepi it can, but if for whatever reason the previous file.temp name is the same as the next filename, it will be removed at least last_cover != default should become last_cover != default and last_cover != filename

I am actually writing my own version that uses file.exists() as well, just in case. I also added a fallback() with the default cover, because the file could exist, but metadata could be corrupt and cause source failures when reading inside image()

Sample of logs spamming my server, burning CPU and causing catchup errors

2024/07/05 04:23:52 [request:3] Nonexistent file or ill-formed URI "/tmp/cover-manager85f0fe/cover_ada73c.jpeg"!
2024/07/05 04:23:52 [request:3] Nonexistent file or ill-formed URI "/tmp/cover-manager85f0fe/cover_ada73c.jpeg"!
2024/07/05 04:23:52 [request:3] Nonexistent file or ill-formed URI "/tmp/cover-manager85f0fe/cover_ada73c.jpeg"!
2024/07/05 04:23:52 [request:3] Nonexistent file or ill-formed URI "/tmp/cover-manager85f0fe/cover_ada73c.jpeg"!
2024/07/05 04:23:52 [request:3] Nonexistent file or ill-formed URI "/tmp/cover-manager85f0fe/cover_ada73c.jpeg"!
2024/07/05 04:23:52 [request:3] Nonexistent file or ill-formed URI "/tmp/cover-manager85f0fe/cover_ada73c.jpeg"!
2024/07/05 04:23:52 [request:3] Nonexistent file or ill-formed URI "/tmp/cover-manager85f0fe/cover_ada73c.jpeg"!
2024/07/05 04:23:52 [request:3] Nonexistent file or ill-formed URI "/tmp/cover-manager85f0fe/cover_ada73c.jpeg"!
2024/07/05 04:23:52 [request:3] Nonexistent file or ill-formed URI "/tmp/cover-manager85f0fe/cover_ada73c.jpeg"!
2024/07/05 04:23:52 [request:3] Nonexistent file or ill-formed URI "/tmp/cover-manager85f0fe/cover_ada73c.jpeg"!
2024/07/05 04:23:52 [request:3] Nonexistent file or ill-formed URI "/tmp/cover-manager85f0fe/cover_ada73c.jpeg"!
2024/07/05 04:23:52 [request:3] Nonexistent file or ill-formed URI "/tmp/cover-manager85f0fe/cover_ada73c.jpeg"!
2024/07/05 04:23:52 [request:3] Nonexistent file or ill-formed URI "/tmp/cover-manager85f0fe/cover_ada73c.jpeg"!
2024/07/05 04:23:52 [request:3] Nonexistent file or ill-formed URI "/tmp/cover-manager85f0fe/cover_ada73c.jpeg"!
vitoyucepi commented 1 week ago

I'm looking for logs with the label cover and levels 3 or 4. Specifically, I need consecutive logs for https://github.com/savonet/liquidsoap/blob/33a62b4858c0d1a9b442fe7aae13f7a0b43c89d0/src/libs/extra/metadata.liq#L92-L97

nightridefm commented 1 week ago

I've got mine at level 3, but I think you actually want this at log level info. https://github.com/savonet/liquidsoap/blob/33a62b4858c0d1a9b442fe7aae13f7a0b43c89d0/src/libs/extra/metadata.liq#L36-L39

I would have to revert my fixes and wait ~24hrs for this issue to occur again

toots commented 1 day ago

Should be fixed now, thanks for reporting!