Please Help! Could not delete file because it is scheduled in the future

Hello all i was wondering if anyone can share some light on this. I am trying to delete some tracks from my library.
Every-time get this error : “Could not delete file because it is scheduled in the future.”
I currently have no schedules running as , I have deleted all playlists and smartblocks and still getting this error…how can i delete file with out this?

This sounds like a bug, did you delete your playlists and smartblocks before you tried to delete the track ?

We need to figure out how to replicate this bug so that we can fix it.

If you can figure out what steps you went through in terms of uploading the track, scheduling it (via playlist or smartblock) and then deleting/cancelling the scheduled items so that there is no schedule and we can try to resolve it.

Did you have any repeating events in your calendar, is it possible that there are future events that you didn’t see on the calendar that are repeating ?

Anyways, there is probably no “easy” way to delete the track via the UI but it would be fairly simple to do so via the database (but if you are not familiar with SQL then it is tricky to get in there and write the query). If we can determine how this bug happens in the first place then we can recreate it and determine at what point in the code the bug is.

Here is the bug, I just re-opened it -

I had a 24 clock of rotating music that pretty mush never ended. When I tried to delete a file that I no longer wanted playing , I 0t gave me the “scheduled in the future message” So I canceled the current show and all shows in the future ( The UI of the calendar shows I have nothing scheduled) I then wend ahead and deleted all playlists and smart-blocks associated with that music and I am still getting the scheduled in the future error.
Is there a way I can completely wipe out my calendar? As it stand the only things a can see on my calender are the shows that ran in the past. Could that be affecting things?

Ok, this is helpful, I suspect the bug is with repeating shows and cancelling them. I will try to reproduce it. Basically what probably happened is you had these tracks scheduled and then when you cancelled the show the code didn’t go in and mark that they were no longer scheduled.

So the calendar isn’t likely the issue at this point so much as a flag in the database that marks tracks as “scheduled”. I could help write a SQL query to mark all tracks as non-scheduled so you can delete them but you’d need to get into the command line and connect to the database.

So whenever you cancel a show this function updatePastFilesIsScheduled() in airtime_mvc/application/models is supposed to go in and check all files that are scheduled in the future and then mark is_scheduled as false for those files which aren’t scheduled.

So it appears there might be a bug in that function that leaves some tracks lingering.
Can you try creating a new show and deleting it and see if that has any impact. That should run the function again. If it doesn’t work let me know and we can go down the SQL query route.

stand by will try now

just created a show…uploaded some music…i then deleted the instance and all to follow which deleted all future shows but left what was currently on. ) meaning today’s show. I had to cancel that show separately. I then preceded to delete files successfully. So doing that worked. It completly reved the show and relieved the files of being “locked in”. However why cant the shows on my calendar from previous days be deleted.

Cool. It seems like the function works then but perhaps there is a way that shows are removed or deleted that doesn’t trigger the function. Anyways it seems like creating a show and cancelling it is an easy workaround.

Deleting the past calendar isn’t a feature we have included because most stations want to preserve the history of tracks that they have played and exposing that in the UI could result in someone deleting it unintentionally. So I don’t think it is something we want to add to the UI. It can be done via SQL relatively easily if this is something that you really want to do.

Removing a show from the schedule will also run this function but like you pointed out we don’t currently have a way of removing past shows.

So if we keep having people run into this and we aren’t able to find the exact scenario that triggers this then it might make sense. To manually expose a button in the Settings that runs this function and clears up tracks for deletion.

Awesome. Thank you so much for your help…Last question…so I have Libretime running on a Raspberry Pi…and it works great but can you explain why this happens when I access libretime out side of the raspberry Pi. (see attched) when accessing on local machine the widgets work.

Yes this is because I’m assuming your raspberry pi doesn’t have an internet addressable domain name. And the widgets on the radio page rely upon the URL to load. So it might be pointing to say localhost - which works for the raspberry pi but any other computer will think it’s pointing to itself. It could also just be using whatever domain name raspberry pi used as the host.

There are a few ways of fixing it but I don’t think they have been super well documented. It is probably easy to do w/o SSL via setting up a CORLS forwarder, and you can use SSL and lets encrypt with a proxy - this issue shows that people have done it but are also still running into issues, so we need someone to take this issue on and write the documentation for how to resolve it and/or submit any code fixes.

actually I have assign the pi a static ip address. Also I point the ip address to a url that i set up and to top it off i did install let encrypt. so not sure why it still wouldn;t work

hmm, I’m thinking you might need to look and see what domain you are using and add that to whatever other /etc/host - I’m figuring that this is just a LAN IP, and so therefore you would need to have a host name match on whatever other computers. If you are hosting this with an external world addressable IP and the domain name resolves to it from any computer then it should work. Otherwise since you said it was a raspberry pi I’m assuming it is at home and therefore behind a router, but yeah you will need to do some kind of port forwarding etc to get it addressable anywhere over your router. has some good instructions for how to setup their dockerbase lets encrypt port forwarding -

But this easy style documentation doesn’t yet exist for our project and we don’t have a easy docker based install for LibreTime officially part of our project, but there are a few implementations of libretime on docker that seem to work for people.

Basically the issue is probably that whatever domain name your libretime server thinks that it is running at isn’t addressable and pointing to your raspberry pi when you access it from another computer.

I cannot say thank you again for the direction. Will loop back once i got it done to keep you updated!!!