Medusa icon indicating copy to clipboard operation
Medusa copied to clipboard

Cannot add new shows the the database

Open ServerGuyHK opened this issue 3 years ago • 22 comments

Describe the bug Failing to add new shows to the database.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Add Show'
  2. Click on 'Add New Show'
  3. Enter Show name and click Search.
  4. Select show from list provided (its listed on TVDBv2 and TVmaze)
  5. Click 'Add Show"

Expected behavior I would expect the show to be added and directory created. But when I go to the show list, nothing is there and the directory on disk has not been created.

Medusa (please complete the following information):

  • OS: Windows 10
  • Branch: Master
  • Commit: 21e350cd4a21f6fb65f750ab5c2d1e9c92c621d6
  • Python version: 373
  • Database version: 44.18

Debug logs (at least 50 lines): General > Advanced Settings > Enable debug

2021-10-08 22:00:20 DEBUG    MAIN :: [21e350c] Started updating network timezones
2021-10-08 22:00:20 DEBUG    MAIN :: [21e350c] GET URL: https://cdn.pymedusa.com/sb_network_timezones/network_timezones.txt [Status: 200]
2021-10-08 22:00:20 DEBUG    MAIN :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; 0f5e3c86-2840-11ec-b9bc-9c2976425dfa)
2021-10-08 22:00:20 DEBUG    MAIN :: [21e350c] Finished updating network timezones
2021-10-08 22:00:54 DEBUG    APIv2-Thread_8 :: [21e350c] Searching for show with search term(s): ['the mating Game', 'mating Game'] on indexer: tvdb
2021-10-08 22:00:54 DEBUG    APIv2-Thread_8 :: [21e350c] Searching for show: the mating game
2021-10-08 22:00:55 DEBUG    APIv2-Thread_8 :: [21e350c] GET URL: https://api.thetvdb.com/search/series?name=the+mating+game [Status: 200]
2021-10-08 22:00:55 DEBUG    APIv2-Thread_8 :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; 0f5e3c86-2840-11ec-b9bc-9c2976425dfa)
2021-10-08 22:00:55 DEBUG    APIv2-Thread_8 :: [21e350c] Using custom UI: <class 'medusa.classes.AllShowsListUI'>
2021-10-08 22:00:55 DEBUG    APIv2-Thread_8 :: [21e350c] Searching for show: mating game
2021-10-08 22:00:55 DEBUG    APIv2-Thread_8 :: [21e350c] GET URL: https://api.thetvdb.com/search/series?name=mating+game [Status: 200]
2021-10-08 22:00:55 DEBUG    APIv2-Thread_8 :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; 0f5e3c86-2840-11ec-b9bc-9c2976425dfa)
2021-10-08 22:00:55 DEBUG    APIv2-Thread_8 :: [21e350c] Using custom UI: <class 'medusa.classes.AllShowsListUI'>
2021-10-08 22:00:55 DEBUG    APIv2-Thread_8 :: [21e350c] Searching for show with search term(s): ['the mating Game', 'mating Game'] on indexer: tvmaze
2021-10-08 22:00:55 DEBUG    APIv2-Thread_8 :: [21e350c] Searching for show the mating game
2021-10-08 22:00:56 DEBUG    APIv2-Thread_8 :: [21e350c] GET URL: http://api.tvmaze.com/search/shows?q=the%20mating%20game [Status: 200]
2021-10-08 22:00:56 DEBUG    APIv2-Thread_8 :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; 0f5e3c86-2840-11ec-b9bc-9c2976425dfa)
2021-10-08 22:00:56 DEBUG    APIv2-Thread_8 :: [21e350c] Using custom UI: <class 'medusa.classes.AllShowsListUI'>
2021-10-08 22:00:56 DEBUG    APIv2-Thread_8 :: [21e350c] Searching for show mating game
2021-10-08 22:00:56 DEBUG    APIv2-Thread_8 :: [21e350c] GET URL: http://api.tvmaze.com/search/shows?q=mating%20game [Status: 200]
2021-10-08 22:00:56 DEBUG    APIv2-Thread_8 :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; 0f5e3c86-2840-11ec-b9bc-9c2976425dfa)
2021-10-08 22:00:56 DEBUG    APIv2-Thread_8 :: [21e350c] Using custom UI: <class 'medusa.classes.AllShowsListUI'>
2021-10-08 22:00:56 DEBUG    APIv2-Thread_8 :: [21e350c] GET URL: https://api.themoviedb.org/3/configuration?api_key=edc5f123313769de83a71e157758030b [Status: 200]
2021-10-08 22:00:56 DEBUG    APIv2-Thread_8 :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; 0f5e3c86-2840-11ec-b9bc-9c2976425dfa)
2021-10-08 22:00:56 DEBUG    APIv2-Thread_8 :: [21e350c] Searching for show with search term(s): ['the mating Game', 'mating Game'] on indexer: tmdb
2021-10-08 22:00:56 DEBUG    APIv2-Thread_8 :: [21e350c] Searching for show: the mating game
2021-10-08 22:00:57 DEBUG    APIv2-Thread_8 :: [21e350c] GET URL: https://api.themoviedb.org/3/search/tv?query=the+mating+game&language=en&page=1&api_key=edc5f123313769de83a71e157758030b [Status: 200]
2021-10-08 22:00:57 DEBUG    APIv2-Thread_8 :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; 0f5e3c86-2840-11ec-b9bc-9c2976425dfa)
2021-10-08 22:00:57 DEBUG    APIv2-Thread_8 :: [21e350c] Using custom UI: <class 'medusa.classes.AllShowsListUI'>
2021-10-08 22:00:57 DEBUG    APIv2-Thread_8 :: [21e350c] Searching for show: mating game
2021-10-08 22:00:57 DEBUG    APIv2-Thread_8 :: [21e350c] GET URL: https://api.themoviedb.org/3/search/tv?query=mating+game&language=en&page=1&api_key=edc5f123313769de83a71e157758030b [Status: 200]
2021-10-08 22:00:57 DEBUG    APIv2-Thread_8 :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; 0f5e3c86-2840-11ec-b9bc-9c2976425dfa)
2021-10-08 22:00:57 DEBUG    APIv2-Thread_8 :: [21e350c] Using custom UI: <class 'medusa.classes.AllShowsListUI'>
2021-10-08 22:01:04 INFO     SHOWQUEUE-ADD :: [21e350c] Starting to add show by Indexer Id: 410848
2021-10-08 22:01:04 DEBUG    SHOWQUEUE-ADD :: [21e350c] 410848: Loading show info from database
2021-10-08 22:01:04 INFO     SHOWQUEUE-ADD :: [21e350c] 410848: Unable to find the show in the database
2021-10-08 22:01:04 DEBUG    SHOWQUEUE-ADD :: [21e350c] TVDBv2: {'language': 'en', 'use_zip': True, 'session': <medusa.session.core.IndexerSession object at 0x0000026D2AC60940>, 'cache': 'C:\\Medusa\\Data\\cache\\indexers\\TVDBv2'}
2021-10-08 22:01:04 DEBUG    SHOWQUEUE-ADD :: [21e350c] Configured language en override show language of en
2021-10-08 22:01:04 DEBUG    SHOWQUEUE-ADD :: [21e350c] Getting all series data for 410848
2021-10-08 22:01:04 DEBUG    SHOWQUEUE-ADD :: [21e350c] Getting all show data for 410848
2021-10-08 22:01:04 DEBUG    SHOWQUEUE-ADD :: [21e350c] GET URL: https://api.thetvdb.com/series/410848 [Status: 200]
2021-10-08 22:01:04 DEBUG    SHOWQUEUE-ADD :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; 0f5e3c86-2840-11ec-b9bc-9c2976425dfa)
2021-10-08 22:01:04 DEBUG    SHOWQUEUE-ADD :: [21e350c] Getting all episodes of 410848
2021-10-08 22:01:04 DEBUG    SHOWQUEUE-ADD :: [21e350c] GET URL: https://api.thetvdb.com/series/410848/episodes/query?page=1 [Status: 200]
2021-10-08 22:01:04 DEBUG    SHOWQUEUE-ADD :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; 0f5e3c86-2840-11ec-b9bc-9c2976425dfa)
2021-10-08 22:01:04 DEBUG    SHOWQUEUE-ADD :: [21e350c] 410848: Loading show info from TVDBv2
2021-10-08 22:01:04 DEBUG    SHOWQUEUE-ADD :: [21e350c] Trying other indexer: TVmaze get_id_by_external
2021-10-08 22:01:04 DEBUG    SHOWQUEUE-ADD :: [21e350c] GET URL: http://api.tvmaze.com/lookup/shows?thetvdb=410848 [Status: 301]
2021-10-08 22:01:04 DEBUG    SHOWQUEUE-ADD :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; 0f5e3c86-2840-11ec-b9bc-9c2976425dfa)
2021-10-08 22:01:05 DEBUG    SHOWQUEUE-ADD :: [21e350c] GET URL: https://api.tvmaze.com/shows/57899 [Status: 200]
2021-10-08 22:01:05 DEBUG    SHOWQUEUE-ADD :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; 0f5e3c86-2840-11ec-b9bc-9c2976425dfa)
2021-10-08 22:01:06 DEBUG    SHOWQUEUE-ADD :: [21e350c] GET URL: http://api.tvmaze.com/shows/57899 [Status: 200]
2021-10-08 22:01:06 DEBUG    SHOWQUEUE-ADD :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; 0f5e3c86-2840-11ec-b9bc-9c2976425dfa)
2021-10-08 22:01:06 DEBUG    SHOWQUEUE-ADD :: [21e350c] GET URL: https://api.themoviedb.org/3/configuration?api_key=edc5f123313769de83a71e157758030b [Status: 200]
2021-10-08 22:01:06 DEBUG    SHOWQUEUE-ADD :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; 0f5e3c86-2840-11ec-b9bc-9c2976425dfa)
2021-10-08 22:01:06 DEBUG    SHOWQUEUE-ADD :: [21e350c] Trying other indexer: TMDB get_id_by_external
2021-10-08 22:01:06 DEBUG    SHOWQUEUE-ADD :: [21e350c] GET URL: https://api.themoviedb.org/3/find/410848?external_source=tvdb_id&api_key=edc5f123313769de83a71e157758030b [Status: 200]
2021-10-08 22:01:06 DEBUG    SHOWQUEUE-ADD :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; 0f5e3c86-2840-11ec-b9bc-9c2976425dfa)
2021-10-08 22:01:06 DEBUG    SHOWQUEUE-ADD :: [21e350c] GET URL: https://api.themoviedb.org/3/tv/135546/external_ids?api_key=edc5f123313769de83a71e157758030b [Status: 200]
2021-10-08 22:01:06 DEBUG    SHOWQUEUE-ADD :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; 0f5e3c86-2840-11ec-b9bc-9c2976425dfa)
2021-10-08 22:01:06 DEBUG    SHOWQUEUE-ADD :: [21e350c] Transaction with 3 queries executed


Additional context This has been working for months and months without issue, noting has changed on my setup. If I try and add the show as an existing show, I get the same issue. The Windows PC is running just Medusa, uTorrent and SABnzdb All files are written out to a QNAP NAS drive. Existing shows are still being found, downloaded, moved to the correct directories and the database updated OK.

ServerGuyHK avatar Oct 08 '21 14:10 ServerGuyHK

Just to ensure its not my firewall or anything like that, I created a new VM, Windows 10 with nothing else on it. Installed a new Medusa on to the VM, did not set any options. Tried to add a new show, it searched fine and added the show, created the directory.

I have also tried on my main install of adding the show but setting the directory to C:\Videos just in case its an issue with the QNAP, but that did not work either.

I copied my fresh install DATA directory on to my main PC to see if anything with the PC had issues. Once the empty new DATA directory was in place, starting Medusa and then adding new shows worked fine.

So I can only guess now that there is some corruption or something in the data directory or one of its files.

ServerGuyHK avatar Oct 10 '21 01:10 ServerGuyHK

You can try to remove all non essential data, restart and try again. Remove all dbm files in cache folder. And remove cache.db.

p0psicles avatar Oct 10 '21 07:10 p0psicles

I've had issues with shows that have special characters in the title.. ie.. Star Trek: Project Orlan It will find the show listed if you enter Star Trek But it just adds the folder nothing in it.. and it's not in the DB show listing in Medusa

nydave69 avatar Oct 11 '21 16:10 nydave69

You can try to remove all non essential data, restart and try again. Remove all dbm files in cache folder. And remove cache.db.

I have tried this and no change, still the same issue and the same entries going in to the log files.

Meanwhile, the system is happily processing existing shows, downloading, moving and renaming files correctly while updating the database.

ServerGuyHK avatar Oct 12 '21 02:10 ServerGuyHK

After a lot of pain and suffering, I uninstalled and reinstalled the whole setup. Using the "Add Existing Shows" option I have managed to get all my shows back in to the databased a fresh, but I now have 20 that just will not add at all. It does not matter if I try to add them as existing or even new, they just wont add. I have tried using TheTVDb and tvmaze, but no diffeerent, all that happens is the same i each case as per the below log trace.

Any ideas ?

2021-10-16 11:29:02 DEBUG	SHOWQUEUE-ADD :: [21e350c] Transaction with 3 queries executed
2021-10-16 11:29:02 DEBUG	SHOWQUEUE-ADD :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; f03ad342-2dbe-11ec-a438-9c2976425dfa)
2021-10-16 11:29:02 DEBUG	SHOWQUEUE-ADD :: [21e350c] GET URL: https://api.themoviedb.org/3/tv/82382/external_ids?api_key=ghjffgj[Status: 200]
2021-10-16 11:29:02 DEBUG	SHOWQUEUE-ADD :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; f03ad342-2dbe-11ec-a438-9c2976425dfa)
2021-10-16 11:29:02 DEBUG	SHOWQUEUE-ADD :: [21e350c] GET URL: https://api.themoviedb.org/3/find/317662?external_source=tvdb_id&api_key=dghjdghj[Status: 200]
2021-10-16 11:29:02 DEBUG	SHOWQUEUE-ADD :: [21e350c] Trying other indexer: TMDB get_id_by_external
2021-10-16 11:29:02 DEBUG	SHOWQUEUE-ADD :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; f03ad342-2dbe-11ec-a438-9c2976425dfa)
2021-10-16 11:29:02 DEBUG	SHOWQUEUE-ADD :: [21e350c] GET URL: https://api.themoviedb.org/3/configuration?api_key=dghjdhj[Status: 200]
2021-10-16 11:29:02 DEBUG	SHOWQUEUE-ADD :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; f03ad342-2dbe-11ec-a438-9c2976425dfa)
2021-10-16 11:29:02 DEBUG	SHOWQUEUE-ADD :: [21e350c] GET URL: http://api.tvmaze.com/shows/21760 [Status: 200]
2021-10-16 11:29:02 DEBUG	SHOWQUEUE-ADD :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; f03ad342-2dbe-11ec-a438-9c2976425dfa)
2021-10-16 11:29:02 DEBUG	SHOWQUEUE-ADD :: [21e350c] GET URL: https://api.tvmaze.com/shows/21760 [Status: 200]
2021-10-16 11:29:01 DEBUG	SHOWQUEUE-ADD :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; f03ad342-2dbe-11ec-a438-9c2976425dfa)
2021-10-16 11:29:01 DEBUG	SHOWQUEUE-ADD :: [21e350c] GET URL: http://api.tvmaze.com/lookup/shows?thetvdb=317662 [Status: 301]
2021-10-16 11:29:01 DEBUG	SHOWQUEUE-ADD :: [21e350c] Trying other indexer: TVmaze get_id_by_external
2021-10-16 11:29:01 DEBUG	SHOWQUEUE-ADD :: [21e350c] 317662: Loading show info from TVDBv2
2021-10-16 11:29:01 DEBUG	SHOWQUEUE-ADD :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; f03ad342-2dbe-11ec-a438-9c2976425dfa)
2021-10-16 11:29:01 DEBUG	SHOWQUEUE-ADD :: [21e350c] GET URL: https://api.thetvdb.com/series/317662/episodes/query?page=2 [Status: 200]
2021-10-16 11:29:01 DEBUG	SHOWQUEUE-ADD :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; f03ad342-2dbe-11ec-a438-djhdhj)
2021-10-16 11:29:01 DEBUG	SHOWQUEUE-ADD :: [21e350c] GET URL: https://api.thetvdb.com/series/317662/episodes/query?page=1 [Status: 200]
2021-10-16 11:29:00 DEBUG	SHOWQUEUE-ADD :: [21e350c] Getting all episodes of 317662
2021-10-16 11:29:00 DEBUG	SHOWQUEUE-ADD :: [21e350c] User-Agent: Medusa/0.5.18 (Windows; 10; f03ad342-2dbe-11ec-a438-dhdghg)
2021-10-16 11:29:00 DEBUG	SHOWQUEUE-ADD :: [21e350c] GET URL: https://api.thetvdb.com/series/317662 [Status: 200]
2021-10-16 11:29:00 DEBUG	SHOWQUEUE-ADD :: [21e350c] Getting all show data for 317662
2021-10-16 11:29:00 DEBUG	SHOWQUEUE-ADD :: [21e350c] Getting all series data for 317662
2021-10-16 11:29:00 DEBUG	SHOWQUEUE-ADD :: [21e350c] Configured language en override show language of en
2021-10-16 11:29:00 DEBUG	SHOWQUEUE-ADD :: [21e350c] TVDBv2: {'language': 'en', 'use_zip': True, 'session': <medusa.session.core.IndexerSession object at 0x000001F377F40978>, 'cache': 'C:\\Medusa\\Data\\cache\\indexers\\TVDBv2'}
2021-10-16 11:29:00 INFO	SHOWQUEUE-ADD :: [21e350c] 317662: Unable to find the show in the database
2021-10-16 11:29:00 DEBUG	SHOWQUEUE-ADD :: [21e350c] 317662: Loading show info from database
2021-10-16 11:29:00 INFO	SHOWQUEUE-ADD :: [21e350c] Starting to add show by Indexer Id: 317662

ServerGuyHK avatar Oct 16 '21 03:10 ServerGuyHK

Can you pm me your main.db. then I'll try to reproduce

p0psicles avatar Oct 16 '21 05:10 p0psicles

Can you pm me your main.db. then I'll try to reproduce

This might sound stupid or I am blind, but I cannot find a PM link anywhere, how do I do this ?

ServerGuyHK avatar Oct 17 '21 03:10 ServerGuyHK

Ooh sorry. Use discord

p0psicles avatar Oct 17 '21 07:10 p0psicles

After some debugging it came clear that it's hanging on the imdb-pie api calls. It's strange why it's hanging on them without throwing any errors. But as the imdb-pie client isn't supported anymore, and no issues can be filed. https://pypi.org/project/imdbpie/5.6.4/

@duramato @medariox thoughts about this? Maybe switch to the scraped api client?

p0psicles avatar Oct 19 '21 09:10 p0psicles

BTW found this as a similar issue. https://github.com/pymedusa/Medusa/issues/8863#issuecomment-743732502

p0psicles avatar Oct 19 '21 15:10 p0psicles

What's the scraped api client? The issue only occurs to some people, right?

medariox avatar Oct 19 '21 15:10 medariox

https://github.com/alberanid/imdbpy seems to be still maintained

The anoying thing, about the current api. Is that when it fails it just locks up. Not throwing an exception at all.

p0psicles avatar Oct 19 '21 16:10 p0psicles

@p0psicles We used imdbpy in the past, but it wasn't that great IIRC. Here is the GH repo of imdb-pie: https://github.com/richardARPANET/imdb-pie Can you reproduce the issue locally? Maybe we can fork and fix it?

medariox avatar Oct 20 '21 17:10 medariox

Yeah would be nice if we could reproduce it

p0psicles avatar Oct 20 '21 18:10 p0psicles

I've reported this before; If the show or episode title has a special character in it (ie : or ') it fails to add show or if it's an older show that was already added before this bug, then it fails on post processing etc where it needs to pull the data from online.

nydave69 avatar Oct 21 '21 13:10 nydave69

@nydave69 sorry I think your issue is a different issue but it got of my radar. I'll check it out. This issue is really specific because of Imdb connectivity issues.

Can you link me to your issue? I can't find it

p0psicles avatar Oct 21 '21 13:10 p0psicles

@nydave69 I checked your issue with adding the show start trek projet orlan. It's only added in the french language. If you add the show with the french language selected. It adds fine.

p0psicles avatar Nov 24 '21 15:11 p0psicles

ive got the same problem, adding show and nothing, log is showing Starting to add show by Indexer Id:****, and nothing happens at all, any progress with sorting out this issue?

xDereCx avatar Mar 11 '22 20:03 xDereCx

@ServerGuyHK is this still an issue, else i'm going to close it.

p0psicles avatar May 24 '22 11:05 p0psicles

Close it please, I gave up in the end.

ServerGuyHK avatar May 24 '22 12:05 ServerGuyHK

I've noticed it's happening when different language for the show are in main setup (general). Obce switched back to English it worked

On Tue, 24 May 2022, 14:38 ServerGuyHK, @.***> wrote:

Close it please, I gave up in the end.

— Reply to this email directly, view it on GitHub https://github.com/pymedusa/Medusa/issues/9928#issuecomment-1135867300, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB743P4HAUJQVVER3L6BCIDVLTETRANCNFSM5FTWHMHQ . You are receiving this because you commented.Message ID: @.***>

xDereCx avatar May 24 '22 14:05 xDereCx

Close it please, I gave up in the end.

Hello, I suspect I am experiencing the same issue. What did you eventually end up doing?

refelian avatar May 18 '23 20:05 refelian