pymedusa / Medusa

Automatic Video Library Manager for TV Shows. It watches for new episodes of your favorite shows, and when they are posted it does its magic.
https://pymedusa.com
GNU General Public License v3.0
1.8k stars 276 forks source link

Settings keep on being reset #8227

Closed wpigoury closed 4 years ago

wpigoury commented 4 years ago

Regularly when I open Medusa on my Synology I see that the settings have all been reverted to default and need to load a backup to get my settings back.

Steps to reproduce the behavior:

  1. Go to /config/general/ or any config page
  2. See that everything is back to default (for instance Show root directories is empty, no torrent provider is selected in Search Providers page...)

Previously configured settings should be kept.

General > Advanced Settings > Enable debug Will need to revert back for debug but here is the default log for now

``` 2020-07-06 10:23:10 ERROR Thread-18 :: [d9c31da] Missing time zone for network: FEARNet 2020-07-06 10:23:09 ERROR Thread-18 :: [d9c31da] Missing time zone for network: amc.com 2020-07-06 10:23:07 INFO Thread-37 :: [d9c31da] Broken providers found: [''] 2020-07-06 10:06:42 INFO SEARCHQUEUE-DAILY-SEARCH :: [d9c31da] No needed episodes found 2020-07-06 10:06:42 WARNING SEARCHQUEUE-DAILY-SEARCH :: [d9c31da] No NZB/Torrent providers found or enabled in the application config for daily searches. Please check your settings 2020-07-06 10:06:41 INFO CHECKVERSION :: [d9c31da] Checking for updates using GitHub Updater 2020-07-06 10:06:41 INFO SEARCHQUEUE-DAILY-SEARCH :: [d9c31da] Beginning daily search for new episodes 2020-07-06 09:26:42 INFO SEARCHQUEUE-DAILY-SEARCH :: [d9c31da] No needed episodes found 2020-07-06 09:26:42 WARNING SEARCHQUEUE-DAILY-SEARCH :: [d9c31da] No NZB/Torrent providers found or enabled in the application config for daily searches. Please check your settings 2020-07-06 09:26:41 INFO SEARCHQUEUE-DAILY-SEARCH :: [d9c31da] Beginning daily search for new episodes 2020-07-06 09:06:37 INFO CHECKVERSION :: [d9c31da] Checking for updates using GitHub Updater 2020-07-06 08:46:41 INFO SEARCHQUEUE-DAILY-SEARCH :: [d9c31da] No needed episodes found 2020-07-06 08:46:41 WARNING SEARCHQUEUE-DAILY-SEARCH :: [d9c31da] No NZB/Torrent providers found or enabled in the application config for daily searches. Please check your settings 2020-07-06 08:46:39 INFO SEARCHQUEUE-DAILY-SEARCH :: [d9c31da] Beginning daily search for new episodes 2020-07-06 08:46:37 INFO DAILYSEARCHER :: [d9c31da] Setting status (Wanted) for show airing today: Black Monday - S02E08 - Lucky Shoes 2020-07-06 08:46:37 INFO DAILYSEARCHER :: [d9c31da] Setting status (Wanted) for show airing today: Snowpiercer - S01E08 - These Are His Revolutions 2020-07-06 08:06:50 INFO MAIN :: [d9c31da] Building internal name cache for all shows 2020-07-06 08:06:50 INFO MAIN :: [d9c31da] Finished processing 3267 scene exceptions. 2020-07-06 08:06:49 INFO MAIN :: [d9c31da] Updating exception_cache and exception_season_cache 2020-07-06 08:06:41 INFO MAIN :: [d9c31da] Checking for scene exceptions updates from AniDB 2020-07-06 08:06:40 INFO MAIN :: [d9c31da] Checking for XEM scene exceptions updates for TVDBv2 2020-07-06 08:06:40 INFO MAIN :: [d9c31da] Checking for scene exception updates from https://cdn.pymedusa.com/scene_exceptions/scene_exceptions_tmdb.json 2020-07-06 08:06:40 INFO MAIN :: [d9c31da] Checking for scene exception updates from https://cdn.pymedusa.com/scene_exceptions/scene_exceptions_tvmaze.json 2020-07-06 08:06:39 INFO MAIN :: [d9c31da] Checking for scene exception updates from https://cdn.pymedusa.com/scene_exceptions/scene_exceptions_tvdb.json 2020-07-06 08:06:38 INFO TORNADO :: [d9c31da] Starting Medusa on http://0.0.0.0:8081/ 2020-07-06 08:06:38 INFO MAIN :: [d9c31da] Starting Medusa [master] using '/volume1/@appstore/medusa/var/config.ini' 2020-07-06 08:06:36 INFO MAIN :: [d9c31da] 352572: Unable to find IMDb info in the database: Groom 2020-07-06 08:06:35 INFO MAIN :: [d9c31da] 12345: Unable to find the show in the database 2020-07-06 08:06:07 INFO MAIN :: [d9c31da] Broken providers found: [''] 2020-07-06 01:00:21 INFO EVENT-QUEUE :: [d9c31da] Shutting down Tornado 2020-07-06 01:00:21 INFO EVENT-QUEUE :: [d9c31da] Broken providers found: [''] 2020-07-06 01:00:20 INFO EVENT-QUEUE :: [d9c31da] Saving config file to disk 2020-07-06 01:00:20 INFO EVENT-QUEUE :: [d9c31da] Saving all shows to the database 2020-07-06 01:00:20 INFO EVENT-QUEUE :: [d9c31da] Waiting for the EVENT-QUEUE thread to exit 2020-07-06 01:00:20 INFO EVENT-QUEUE :: [d9c31da] Waiting for the TORRENTCHECKER thread to exit 2020-07-06 01:00:20 INFO EVENT-QUEUE :: [d9c31da] Waiting for the FINDSUBTITLES thread to exit 2020-07-06 01:00:20 INFO EVENT-QUEUE :: [d9c31da] Waiting for the FINDPROPERS thread to exit 2020-07-06 01:00:20 INFO EVENT-QUEUE :: [d9c31da] Waiting for the TRAKTCHECKER thread to exit 2020-07-06 01:00:20 INFO EVENT-QUEUE :: [d9c31da] Waiting for the POSTPROCESSOR thread to exit 2020-07-06 01:00:20 INFO EVENT-QUEUE :: [d9c31da] Waiting for the MANUALSNATCHQUEUE thread to exit 2020-07-06 01:00:20 INFO EVENT-QUEUE :: [d9c31da] Waiting for the FORCEDSEARCHQUEUE thread to exit 2020-07-06 01:00:20 INFO EVENT-QUEUE :: [d9c31da] Waiting for the SEARCHQUEUE-DAILY-SEARCH thread to exit 2020-07-06 01:00:20 INFO EVENT-QUEUE :: [d9c31da] Waiting for the SHOWQUEUE thread to exit 2020-07-06 01:00:20 INFO EVENT-QUEUE :: [d9c31da] Waiting for the CHECKVERSION thread to exit 2020-07-06 01:00:20 INFO EVENT-QUEUE :: [d9c31da] Waiting for the SHOWUPDATER thread to exit 2020-07-06 01:00:20 INFO EVENT-QUEUE :: [d9c31da] Waiting for the BACKLOG thread to exit 2020-07-06 01:00:19 INFO EVENT-QUEUE :: [d9c31da] Waiting for the DAILYSEARCHER thread to exit 2020-07-06 01:00:19 INFO EVENT-QUEUE :: [d9c31da] Aborting all threads 2020-07-06 01:00:19 INFO MAIN :: [d9c31da] Signal 15 caught, saving and exiting... ```

My Synology is automatically shut down every night at 1AM and restarted at 8AM. I did not change the config file manually and I do nothing particular when the bug arise, it looks completely random for now. My guess is that Medusa sometimes doesn't have time to write the config file when shutting down at 1AM resulting in a broken config which reverts to default on next start.

p0psicles commented 4 years ago

Then that's your issue. Make sure you always cleanly shut down medusa

wpigoury commented 4 years ago

Then that's your issue. Make sure you always cleanly shut down medusa

Not sure if it's "my issue" as you say. As I never had the issue for years using SickRage and then SickChill, nor during the 6 first months since I switched to Medusa. It started to happen since 2 or 3 updates ago and seems to be even more frequent since latest update.

Of course I'll try to set a planned task to stop Medusa several minutes before my Synology automatically shuts down, but this won't solve the issue in case of unplanned shutdowns.

medariox commented 4 years ago

If you force shut down an application it's integrity can't be guaranteed. This is valid for all applications, not just Medusa. When it doesn't error out you were lucky, because there was no I/O happening at that time. Probably the show updater runs around that time, so that's what happens. It could also be a search. Always stop Medusa cleanly before shutting down the system.

wpigoury commented 4 years ago

Ok, so no further investigations on why this only started couple of versions ago or why this never happened on other forks for years? Great, beginning to regret making the switch :(

medariox commented 4 years ago

It has nothing to do with the different forks. The code that is responsible for this hasn't been changed for the last 2+ years. It is also very likely still the same across the various forks. I explained the reason why this is happening above and there is nothing more we can do to help.