New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autoloading playlists failing randomly #2670
Comments
I'm that person with same problem. I assumed the problem was after downgrade RAM from 2Gb to 1Gb on server. I plan to enable debug level logs to see what's happens |
Can't find any special in logs ( |
I'm trying out a couple of dockerized installs and the issue happened again today. libretime-logs-autoload-error-2023-09-18T09_50_00.log |
Regarding the cache_ahead_hours parameter ("How many hours ahead Playout should cache scheduled media files"), does it mean that the show will get auto filled with the tracks one hour before? I mean, will I be able to see the tracks loaded in the show? Or it justs "caches" them and when the show begins they will show up? |
So they are added to the show an hour ahead. I'm not sure where that specific parameter fits in (sorry it's been a while since I touched the codebase). But essentially the autoloading playlists is a hack where an hour before the show is set to air it schedules the tracks. Unless something has changed the autoloading playlists happens via PHP and so while the specific tracks being added maybe in the pypo log if there is an error it would probably be in the zendphp.log file. |
Is there a way to trigger through an api call , manual call the autoloading of the playlist ? I am having the same issue of the autoload failing occasionally and would like to try to debug the issue , but I don't understand the mechanism through with it is scheduled and run, hoping I can take it step by step and backtrack how it is supposed to be working |
There is no manual way to trigger the autoloading playlist that I'm aware of. I also don't think it is added to the API although this would be a good idea for a feature request. |
Maybe we could add console command for regenerate autoloading playlist? |
The red! is due to a bug in the calendar javascript. I don't think it's related to the failing autoplaylist. Again the zendphp.log generally has information related to when autoplaylists are triggered and is probably a good place to find if there are any hints as to why a particular playlist fails to run. See if you can see the logs from successful runs and then see if there is anything there for the missing ones. |
Hi @Robbt , I can´t find zendphp.log! |
/var/log/libretime/zendphp.log |
I don't see anything related to this issue in legacy.log |
me neither... |
I'm trying to monitor the server (using Netdata) to see if there's a high load or similar at the time of the failures. Until now I couln't see anything. |
It happened in 3.2.0 as well... |
I had to reinstall a v3.0.2 for the time being. But I will keep testing in another instances from git directly. |
Just out of curiosity, is anyone having this issue using Ubuntu? I'm using debian 11 in all our instances. |
I'm still wondering if it could be related to system resources... I'm testing in dedicated servers and vps... but couldnt find anything yet... so I guess this is not the issue either... |
As I mentioned in Discourse I can provide access to one of our containers having the issue. I have a couple that we kept for debbuging. |
Hi, I'm testing with git version... I happened again. And this time the autoload stopped working for all shows after that failure. I mean, it usually fails on 1 show and after that it resumes autoloading the next show. But sometimes it fails on 1 show and all the following. Like here, it failed on monday and from then the playout kept empty until today. I add the relevant logs I could find on the day of the first failure. The failing autoload happened at 22:00hs:
legacy.log and worker.log stopped logging a few days earlier. I don´t know if this is normal in v4 ? |
They shouldn't... As far as I remember, the population of the autoplaylist is either triggered by legacy and schedules a job in worker or is done directly by legacy. So the logs from those should help shed some light |
Guys, so this is not happening to most of you right?? is it because you don´t rely so much on autoloading playlists? or because there's something wrong with my instances?? |
The only "different" setup I'm using is external icecast servers. I'm not using the default icecast installed with the standard install. |
My station uses autoloading playlists only and now it's impossibly to use LibreTime with this issue |
Could you folks share us the content of your sudo -u libretime libretime-api dbshell -- -t -c "select * from cc_pref where keystr not in ('logoImage', 'library_datatable', 'library_screen', 'calendar_time_scale', 'live_stream_master_password', 'user_timezone', 'user_locale');"
|
We need the logs from legacy, when the failure occurs. I had a similar behaviour some months ago, not sure if it is related. Here is maybe an idea why it happened on my side: the If you folks can share the content of the cc_pref table, can could maybe already rule out the behaviour I described. |
i had the same happen now on 3 of 4 instances i am running (native, ubuntu), and i noticed something new. apart from the lack of legacy.log updating (looks like something is wrong with log rotation and logs go to the nether realms after that) there were no shows at all in the dashboard view to update. So it's not the autoloading thats failing but the actual show instance creation from the repeated schedule calendar. As soon as i accessed the WebUi and refreshed, the shows bgan to reappear in the right pane planning view and a few minutes later the next hour was populated again. (autoloading works if a show starts in 'under an hour from now', it usually is triggered at the earliest point but thats not a requirement) EDIT: Other stations with this problem had logging still running, BUT nothing conspicuous in the logs at all, in a window +/-2h of it stopping working. |
To continue the investigation, i think i know whats going on. Repeated Show Instances are not scheduled beyond the initial schedule period casuse somehow createAndFillShowInstancesPastPopulatedUntilDate() is not firing. Quote from source: "This can occur when a user is viewing the next day/week/month in the calendar or when pypo is requesting the schedule after the shows_populated_until date and time." Could it be this periodic rescheduling of show instances (and then subsequently filling them with autoload playlists) is not triggered any more but only by visiting the calendar view? Cause that's what made it work for me again. |
Okay, here's the actual bug. Pypo (libretime-playout) is using the v2 api to retrieve a schedule, never calling the legacy functions (v1 api) but accessing the database directly. This means the refills are never triggered when nobody logs into the UI and browses the schedule calendar. Use regular calls (once a day) to |
And this is why moving away from the legacy php code is so difficult... |
@paddatrapper @jooola would a quick fix adding the missing call to the top of the legacy autoloader be accepted? or would you rather add this to the v2 api? |
@caveman99 yes, I think at is an appropriate fix for now. Long term we should fix the v2 api, but considering the lack of time I have available at the moment, I can't say when that would be |
Awesome that you went down this rabbit hole @caveman99 ! The magic happens around the
I'll implement a quick fix, by adding a periodic task in the celery worker that will call the API every 5 minutes. |
### Description This ensures that when the LibreTime interface is not used for a long time, we still have the task manager run essential tasks for the schedule. Related to #2670
Hi, is it possible that the problem is still happening? |
You can check the nginx logs, and the worker logs. |
I confirm the issue is still happening to us on at least 2 instances running latest git. |
Describe the bug
We had random failures with “autoloading playlists” not being loaded, leaving the shows without tracks.
The shows are working fine with the lists being autoloaded correctly but they've failed a couple of time in the last week.
We tried recreating the blocks and lists but the issue happened again.
I've asked in the forum and one other person had the issue as well.
Thanks!!
To reproduce
We couldn't find how to reproduce the issue. The issue happened in 2 LT installs on different machines. One install is fresh and the other is an upgrade from older versions. On the other hand it didn´t happen in 2 other installs, both upgraded.
Expected behavior
Shows being autoloaded from the configured autoload playlists.
Relevant log output or error messages
LibreTime version
3.1.0
Installation method and OS / Environment
Operating system: Debian Bullseye
Method: Installer script
Installation details
No response
Client Environment
Operating system:
Browser:
Screenshots
No response
The text was updated successfully, but these errors were encountered: