-
Notifications
You must be signed in to change notification settings - Fork 22
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
Library Auto Updater in loop #69
Comments
What timers do you have setup as part of the schedule and what is the interval? The log file says it's only creating one scheduled timer for the Music Library. Is that correct? |
I have created a series of screenshots that, hopefully, give you the information you require, and demonstrate the issue. |
I had the same issue (LibreELEC-RPi4.arm-10.0.1.img - Kodi 19.3) Workaround: I downgraded the "Library Auto Update"-Addon to Version 1.2.1 |
Where do I find 1.2.1? |
Reverted to 1.2.1 and problem gone away. Thank you |
Ur welcome ;) |
I'm really at a loss for what could be causing this - especially given that a downgrade seems to fix it. Comparing the actual changes between those two versions there is very little code that is actually different. It's mostly changes to be compatible with Kodi library changes. I've been unable to duplicate on any of my main or test systems. |
I had the same issue with 1.2.3 and disabled it until I could investigate. Tried turning it on a few days ago using the same basic cron schedule and without downgrading, to see if I could get you a debug log, but it's been working without issue. Is it possible it was crashing on a bad file or other error? I have done some filesystem cleanup in the last couple of weeks, and had noticed when I ran manual updates that they'd also crash, sometimes taking Kodi down with them. |
I have included the log from my 1.2.1 run last night. As you can see there are some errors relating to files in the music database and the video database. In the music folders you can see that there is a couple of huge SQL errors. Could either of these be causing the issues with 1.2.3? |
I don't think these would hurt the addon since the errors are related to Kodi itself. They're definitely not helping the scan complete efficiently though. Just based off what is in the log files here is my two cents: It seems that The
The SQL error is a unique constraint being violated. The field |
@robweber Thank you that gives me a lot to consider.
Which also appeared in the previous days log. Am I right in thinking that the "clean" option is not working correctly, or are all my databases corrupt in some way? |
Extra comment following my last post. I ran the "clean" option from the "settings" options in the KODI menu and the errors in my last comment have gone. So I assume I am correct in thinking that the "clean" option is not working correctly in the Library Auto Updater. |
@robweber Ignore my meanderings. The clean option is working as it should. |
I had the same issue, running Libreelec 10.0.1 with Confluence theme on a Pi4. Installed Library Auto Update from the repository. |
I'm really a loss for what could be different between the two versions that causes a problem like that. Doing a compare from 1.2.1 to 1.2.3 all the differences are purely cosmetic (settings updates, language issues, etc). The only code changes were to tweak arguments related to Kodi API changes. Personally I've never been able to recreate it but if I ever do I'll revisit. |
I have 2 different devices, a philips android tv with 19.3 kodi on it and 1.2.3 Library auto update on it and RPi4 with 19.4 kodi (librelec 10) and with 1.2.3 Library auto update. BOTH loop IF i choose manual Library update AND library cleaning is set. If i do not set library cleaning then looping does not occur. I waited for automatic triggering as well and it appeared to loop for a while and then stop with no library cleaning happening although it was set. I hope this helps. Both devices are still in this config and i am happy to provide more information and do some further testing if needed. |
I'll be honest - I still can't duplicate this but I do have a theory as to why it might be happening. The way the manual trigger works is to "trick" the system into thinking it's time to update by resetting the last update time. I'm going to have to trace out the flow but I'm thinking this may result in some weird conditions that cause looping. If that's the case I can re-work the manual trigger to work differently. |
Well, i could let you in so you could see it and try to debug it?
…On Fri, 15 Jul 2022, 23:34 Rob, ***@***.***> wrote:
I'll be honest - I still can't duplicate this but I do have a theory as to
why it might be happening. The way the manual trigger works is to "trick"
the system into thinking it's time to update by resetting the last update
time. I'm going to have to trace out the flow but I'm thinking this may
result in some weird conditions that cause looping. If that's the case I
can re-work the manual trigger to work differently.
—
Reply to this email directly, view it on GitHub
<#69 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALW7HKZABZEWR3CN6MML5MDVUHDO5ANCNFSM5HAXR5XA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Out of curiosity, do the devices that have looping issue "go to sleep" so to speak? I have the latest version of the Library Auto Updater installed on a Ubuntu desktop that is always on and has Kodi always running. I also have it installed on an Nvidia Shield Pro which goes to sleep when not in use. The Ubuntu computer has no problem, but the Nvidia Shield did experience this issue. Could the addon be "banking" library scans? For example if while the shield is sleeping, it misses three scheduled scans, when it wakes up is it processing all the missed scans? |
No. I installed on clean devices and they started looping right out of the box. After that i tried reboots and waiting all night. Did not change the behaviour. |
Same problem here since I updated the Google Chromecast to Android 12. On a 2018 FireTV stick 4K it works fine, same Kodi 19.4 and latest addon version. The Android version/env might have something to do with it. On the Chromecast I tried turning off automatic updates of the Video and Music libraries and just leaving the Clean function enabled so it runs after I manually update my library but it still causes the updates to be stuck in a loop, even when I start a manual update from the video library, not via the addon. It's definitely a problem with the addon, when I disable it the manual update is well behaved, no loop. |
It actually also does it on a brand new Fire TV stick 4K Max, fresh install of Kodi 19.4 |
Latest update 1.2.4 is not respecting cron input. but in fact in the log I see it is starting EVERY second hour: Also why it is trying to scan folders that are deleted? Which table in database is the source of folders to be scanned? 2023-04-13 08:00:30.241 T:9891 warning : Process directory 'nfs://192.168.1.101/volume1/NAS/SERIES/ABC/' does not exist - skipping scan. |
Hi I today had the OP's issue on my fresh install of Kodi v20.2 and Library Auto Updater v1.2.4: When running Library Auto Updater, it would finish an update, perform a clean, then start from scratch and perform another update, immediately. What fixed it for me (for the video library at least) was to:
I now don't get the looping when manually (or automatically) running Library Auto Updater... I've yet to confirm if the following works for music libraries (because an update takes ages and I couldn't yet find documentation confirming if this exists or not):
If the above does work for the music library too, then I'd consider it a sufficient workaround for the issue. Additional:
Cheers B EDITS: to get my code snippets displaying correctly - apologies for all the notifications if you got them! (Always learning) |
Just had this endless loop happen on a fresh install of Kodi 20.2.0 on an Nvidia Shield TV Pro with no sources set up yet: Disabling the Clean Libraries option got it working correctly. |
Maybe this project is in need of a new maintainer. There hasn't been any real code activity in a couple of years. |
I had attempted to fix this a while back and just never completed it. Looking at it again I think I was making this way to difficult in my mind. Below is an attempt at a fix, ultimately I just moved a few things around. The main issue, that I could discover, was the double creation of the Monitor class that triggered the Clean Database code. I think moving this so it only gets created once - with the service - might do the trick. Anyone brave enough give it a try: https://github.com/robweber/xbmclibraryautoupdate/tree/refactor_manual |
I'd feel okay testing it but I don't have that Nvidia Shield on which it was happening. I could try it on my own Nvidia Shield but I don't know how to install it outside of using the repository. |
I don't think this issue is specific to Nvidia Shields. I'm not super concerned it will break anything but confirmation it will fix this issue would be good. |
@robweber Can you make a release please? It can't be any worse than the current release which doesn't work at all. |
Hi, updated to latest Libelec on a Pi 4, just updated to Library Auto Update 1.2.4 and still if I turn on the Clean Option (which is really what I want) it still gets stuck in a loop. Looks like it doesn't even get to cleaning part, just update library and immediately update library again. This carry's on in the background until you uncheck the Clean option and press ok. My loop looks different than the video (primehalo) above |
Pushed a release with the changes to the Kodi repo: xbmc/repo-scripts#2529 |
When will this be available? or can I download a copy and install form zip? |
You can definitely download a ZIP from GitHub. Click the Code button and click download zip. Waiting on Kodi Devs to approve the merge so no idea on availability through the normal Addon updates. Usually takes a week or so from submission depending on how busy they are. |
Installed the zip, and no change, still gets stuck in a loop when clean option is selected, very frustrating. Let me know if there is anything I can try. |
Is installing the working old 1.2.1 version nowadays a bad idea? Would I miss any important function of the newer versions? |
Just want to confirm that anyone seeing the looping behavior using the new version (1.2.5 - currently only available via a ZIP file on GitHub) is trying this with a manual scan? To test this properly I'd install the update and reboot Kodi to clear out any errant processes. In my testing the manual scan option - with cleaning enabled - was the only time I could duplicate the looping behavior. The fix in 1.2.5 was to address that. If the program is looping still during scheduled runs I've never been able to duplicate that. I just did several tests again now and all had the library update concluding and then the clean operation triggering. Everything ran and exited properly. Just want to make sure all the comments here are testing the same things on the same most recent version. |
Have turned off and restarted my Kodi Pi, tried manual and auto and still gets stuck in a loop. |
Can I install an old version that does not have this problem? |
I've heard that 1.2.1 doesn't do this but looking at the code differences between the two it doesn't make sense why one would work and the other not. Most of the changes are Kodi API or language fixes. The biggest changes were from 1.2.4 to 1.2.5 and those I just did. I'm not denying that it happens but I can't reproduce it or point to a single thing that would cause it. The actual program loop going on here is fairly simple.
I'm open to ideas but just run out of places to look. |
Just installed 1.2.1 and all working fine, happy now |
Where can I find 1.2.1? |
Sounds like you can just release 1.2.1 as 1.2.6 and call it a day :) |
I only wish it was that easy. Comparing 1.2.1 to 1.2.4 (as 1.2.5 was an attempt to fix this again) there are 70 files changes. 2 of them are actual Python files. The rest are language translations, the README, I'm going to leave this open in case new information surfaces that points in a better direction. For what it's worth I run this on my home system (Nexus) on a 2 hour scan, with cleaning enabled, and have never seen this happen. |
That's really strange indeed. FWIW, I run it on both a Google TV w/ Chromecast and FireTV Max and it happens on both. Both are recent clean installs of latest Kodi. Something is going here, either platform dependent or user settings. |
Another data point - I just had this happen to me on a fresh OSMC install on a Vero V, addon version 1.2.5 and Kodi 20.5. I also deleted a lot of movie files / folders and moved things around prior to the occured looping. Cleanup was enabled in the addon settings. Disabling cleanup in the addon settings seems to have stopped the loop and as suggested above, I instead enabled cleanonupdate in advancedsettings to achieve the desired behaviour of clean up. |
I seemed to have got it working after experiencing the same issues as others. It is my first time posting in this type of forum so bear with me as I think it best that give as many details as possible because I don't have enough technical knowledge to know what might be important. Okay... so after some fiddling, I noticed that if I chose to only clean up Videos, running a manual update completed successfully. So, I went into settings and deleted the entire Music cron expression first, making sure I did not leave any unseen spaces, and then carefully set it to run every minute. I went back into settings, disabled Use* Advanced Timer. Clicked Okay. Went back in and correctly entered the 15min cron expression. Clicked Okay. Kodi ran for approximately 2.5hrs with no looping. Mustered up the courage to change the time settings in various ways for each library. I really hope this helps. p.s. PC; Windows 11 Pro; Kodi and all addons are current |
Thanks for the detailed steps. I've never successfully been able to reproduce this behavior on my own. Even just now with a Win 11 computer I couldn't get the looping behavior to occur. I did however find an issue with the cron expression parsing based on your instructions. There are some situations where the cron library throws a different type of error other than a I'll continue to watch for this but it seems either system dependent or there are a series of circumstantial timing things going on I just can't seem to recreate. |
Throwing in some cents, i currently have the same problem stuck in loop. RPi 3, libreelc kodi 21.1 autoupdater 1.2.5. Media sources using webdav. Using clean library after update. From debug log i can see:
Looks fine, i have a cron schedule of once a week. I trigger manual update:
Update finishes and it starts again:
We can see here that it triggers a VideoLibrary.Scan again.
And my best guess is that none of the ifs on 329 or 332 is true. My setting is "both" so the first part of the ifs should be true in both cases, leaving database == 'video' or database == 'audio'. So my guess database is neither video or audio in my case, and the default behavior of CronSchedule() a VideoLibrary.Scan is run and the loop is on. |
Using the Library Auto Updater add-on) and it is fine when updating the audio library but when it updates the video library it seems to go into a loop.
I have run it with debug on and pasted the results here https://paste.osmc.tv/kigadokita 1
The loop constantly displays messages on the screen (when the add-on is run manually) Saying Compressing database, and searching for data on the TVDB database.
The log shows these messages when running using the “RUN” option on the Settings>Add-on browser>Library Auto Update screen and repeats them for ever.
When I invoke an update of the library from the context menu the update runs as expected with no issues
Kodi (OSMC) is running on a Raspberry Pi The files for the library are held on another Raspberry Pi acting as a file server. I have posted this on both the OSMC and KODI forums but they have been of no help.
Thank you.
The text was updated successfully, but these errors were encountered: