Is their a limit to the number of TV shows?

Pi 3 connected to a server. It works great, as do the Pi 2 and 1 I also have.
My issue is that when the number of TV shows on the server gets to about 190 they won’t load.
From the TV main menu, when I select a show, it tries to load to the TV show’s (seasons etc) menu but then stays on the main TV screen. So I am wondering if there is a limit to the number of shows that Kodi / OSMC can have on the server?
Multiple Movies - no problem, it is just the TV shows.

Not that I’m aware of. Logs should give a clue as to why you might have an issue.

I’m close to your limit, I currently have 183 shows (8177 episodes) and my library is fine. But as @ActionA said, logs would help narrow down the problem.

OK, to replicate the problem ( this isn’t a one off though it has happened previously and to fix it I am unloaded shows to get me under the 190 mark or there about)
Uploaded the 12 shows that I deleted from the server back to the server
Updated the TV library.
On completion TV shows won’t load, tried 3 - 4 times with different shows.
Downloaded log immediately after and:
18:03:41.619 T:2658137072 ERROR: SQL: [MyVideos107] Undefined MySQL error: Code (126)
Query: select * from episode_view ORDER BY dateAdded desc, idEpisode desc LIMIT 10
18:03:41.620 T:2658137072 ERROR: GetEpisodesByWhere failed
18:03:41.633 T:2658137072 DEBUG: RunQuery took 4 ms for 0 items query: select * from musicvideo_view ORDER BY dateAdded desc, idMVideo desc LIMIT 10
18:03:41.664 T:2658137072 DEBUG: CRecentlyAddedJob::UpdateTotal() - Running RecentlyAdded home screen update
18:03:41.693 T:2658137072 DEBUG: GetArtistsByWhere query: SELECT COUNT(DISTINCT artistview.idArtist) FROM artistview WHERE ((EXISTS (SELECT 1 FROM song_artist WHERE song_artist.idArtist = artistview.idArtist AND song_artist.idRole = 1) OR EXISTS (SELECT 1 FROM album_artist WHERE album_artist.idArtist = artistview.idArtist)) AND (artistview.strArtist != ‘’)) AND (artistview.strArtist <> ‘Various artists’)
18:03:48.060 T:2814845936 DEBUG: script.module.osmcsetting.updates : - blurp 721 - Home.xml
18:03:54.909 T:3025379328 INFO: CheckIdle - Closing session to (easy=0x976822b0, multi=0x9dd99140)
18:03:57.083 T:2523919344 DEBUG: Thread JobWorker 2523919344 terminating (autodelete)
18:04:11.230 T:2532307952 DEBUG: Thread JobWorker 2532307952 terminating (autodelete)
18:04:14.718 T:2658137072 DEBUG: Thread JobWorker 2658137072 terminating (autodelete)
18:04:14.765 T:2579493872 DEBUG: Thread JobWorker 2579493872 terminating (autodelete)
Then, deleted same shows, cleaned library and deleted shows from home list. Shows now load.

No idea, but I’m guessing ERROR is relevant.

I’d hazard a guess that the SQL is crashing out with a memory problem. Although it limits the output to just 10 rows, it first needs to sort the entire table on two columns.

You can try it out for yourself:

sqlite3 ~/.kodi/userdata/Database/MyVideos107.db
select * from episode_view ORDER BY dateAdded desc, idEpisode desc LIMIT 10;

Ctrl-d to exit.

So the ilimit seems to be with the number of episodes.

Edit: I missed that it’s a MySQL error, not sqlite. To logon should be something like:

mysql --u <username> --p MyVideos107

I also see that it’s a view, not a table, and has joins between 7 tables. That just complicates things even more. To see if it fails on the joins or on the sort you could also try:

select count(*) from episode_view;

Thanks for the reply, I have only a vague idea of what you are talking about. Also I am using PHPMyAdmin to manage MySQL on my server.

Fair enough. Just be aware that you’ll probably need to keep the total number of episodes below a certain number or Bad Things™ are likely to happen.

Is there a way to fix the issue through PHPMyAdmin? Keeping the total number of episode below a certain number is not really an option as that is where I am at present.

Well as @dillthedog wrote. Let’s find out who or what is crashing. So try to execute select * from episode_view ORDER BY dateAdded desc, idEpisode desc LIMIT 10; via phpmyadmin and see what you get back

I appreciate the answers that I am getting and I had a look at phpmyadmin but cannot figure out how to execute the command.

Click on the respective table and then choose “SQL”, paste the SQL command and execute

If I did it correctly, this is what I got:

SELECT idEpisode, idFile, c00, c01, c02, c03, c04, c05, c06, c07, c08, c09, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, idShow, userrating, idSeason, strFileName, strPath, playCount, lastPlayed, dateAdded, strTitle, genre, studio, premiered, mpaa, resumeTimeInSeconds, totalTimeInSeconds, rating, votes, rating_type, uniqueid_value, uniqueid_type FROM episode_view WHERE 1

Can you paste the SQL

select * from episode_view ORDER BY dateAdded desc, idEpisode desc LIMIT 10;


I got

#126 - Incorrect key file for table ‘/tmp/#sql_add_0.MYI’; try to repair it

That seems to imply that your database is corrupt. Try creating a new database, and re-scrape. I can run that command on my MySQL database, and it works fine.

Any table on /tmp will be temporary work space, so it (still) looks like a space issue to me.

I’ll just reiterate that running grab-logs -A would be very helpful.

1 Like

Right, I didn’t notice the /tmp part…

How / where do I ‘grab-logs -A’?

If we are talking about a physical space then that shouldn’t be an issue unless a setting has restricted the size of /tmp.

At he beginning of this thread, there is a link about logs :wink:

It would be interesting to see the output of:

$ df -h

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘$ df -h’ at line 1