sureshfizzy / CineSync

CineSync is a Python based library management tool designed to organize debrid & local libraries without the support of Sonarr & Radarr
65 stars 7 forks source link

database is locked #17

Closed snucker-fod closed 1 month ago

snucker-fod commented 1 month ago

CineSync runs for a few seconds, processes ~100 or so files in Zurg, then stops or crashes. I am running this on unraid.

I either run in to this:

2024-09-09 14:10:04 [ERROR] Task failed with exception: database is locked Traceback (most recent call last): File "/app/MediaHub/processors/symlink_creator.py", line 130, in process_file save_processed_file(src_file) File "/app/MediaHub/processors/db_utils.py", line 68, in save_processed_file cursor.execute("INSERT OR IGNORE INTO processed_files (file_path) VALUES (?)", (file_path,)) sqlite3.OperationalError: database is locked

Or I see CineSync waiting for the next 60 second refresh, but it never happens.

sureshfizzy commented 1 month ago

Could you check the permissions of db folder ?

snucker-fod commented 1 month ago

Good idea, I forgot to add PUID and GUID.

sureshfizzy commented 1 month ago

Good idea, I forgot to add PUID and GUID.

Check and let me know how it goes, if that is the issue then I'll add the ID's on compose file too

snucker-fod commented 1 month ago

I set my container to 99:100, and I chown'ed the config folder to 99:100 as well, then it just stops processing files and sits here:

2024-09-09 14:21:40 [INFO] Renaming Arrow.S04E11.1080p.Bluray.x265-HiQVE.mkv to Arrow - S04E11 - A.W.O.L..mkv based on episode name A.W.O.L. 2024-09-09 14:21:41,983 - INFO - Directories to watch: ['/mnt/remote/__all__'] 2024-09-09 14:21:42,080 - INFO - Started monitoring directories.

sureshfizzy commented 1 month ago

Using all is not suggested, use the folders inside it.

Eg Movies, Shows and you can add multiple source directory seperated with commas

Edit: This should also work anyway, can you try running the script locally instead of docker ? Also add few files and see if it symlinks into the destination directory, I guess logs are not being printed on inotiy

snucker-fod commented 1 month ago

My Zurg is just setup as *, I'll have to find a regex to split the content.

Running just the script will be complicated, on the host system the files are in /mnt/user/appdata/etc/etc, in my containers they are /mnt/remote and /mnt/symlinks, I suppose it could work with relative paths, it's just ugly when I need to ls -la XD

Adding files via DMM does not trigger a rescan.

sureshfizzy commented 1 month ago

My Zurg is just setup as *, I'll have to find a regex to split the content.

Running just the script will be complicated, on the host system the files are in /mnt/user/appdata/etc/etc, in my containers they are /mnt/remote and /mnt/symlinks, I suppose it could work with relative paths, it's just ugly when I need to ls -la XD

Adding files via DMM does not trigger a rescan.

It can't handle animes names for now, apart from that it's fine. I'll check on DMM scan on my end and let you know tomorrow. But if you want to use realtime monitoring until this is sorted, you can setup realtime monitoring alone on your unraid from the secondary script. Run python3 CineSync.py to see the options available.

snucker-fod commented 1 month ago

It might be coincidence, but half of my R-D files went wonky/vanished. To test this further I'll have to only use some files that I don't already have mapped.

sureshfizzy commented 1 month ago

That's very strange, I'm running this script on 70tb rd files and it's good so far. This script has nothing to do with deletion .

sureshfizzy commented 1 month ago

@snucker-fod Pull the latest docker image, DB and real-time monitor has been fixed

snucker-fod commented 1 month ago

I'll give it a try when I can, thanks!

sureshfizzy commented 1 month ago

Alright I'll close this issue then since it has been fixed. Feel free to reopen incase if you face anything.

snucker-fod commented 1 month ago

I still have the same issue unfortunately.

2024-09-10 16:43:35 [INFO] Skipping extras file: Season 01 - Behind the Scenes of the Behind the Scenes Featurette.mkv 2024-09-10 16:43:35 [INFO] Skipping extras file: Season 01 - Behind the Scenes.mkv 2024-09-10 16:43:35 [INFO] Skipping extras file: Behind The Scenes - Documentary (480p DVDRip).mp4 2024-09-10 16:43:35 [INFO] Skipping extras file: DC.Super.Hero.Girls.2019.S02E01.AmBatgirl.Part.1.1080p.AMZN.WEB-DL.DDP5.1.H.264-NYH.mkv 2024-09-10 16:43:35 [INFO] Skipping extras file: DC.Super.Hero.Girls.2019.S02E02.AmBatgirl.Part.2.1080p.AMZN.WEB-DL.DDP5.1.H.264-NYH.mkv 2024-09-10 16:43:35 [INFO] Skipping extras file: Spider-Man.The.New.Animated.Series.S01E12.Mind.Games.Part.1.480p.WEB.H264.AAC-MiDWEEK.mp4 2024-09-10 16:43:35 [INFO] Skipping extras file: Spider-Man.The.New.Animated.Series.S01E13.Mind.Games.Part.1.480p.WEB.H264.AC3-MiDWEEK.mp4 2024-09-10 16:43:35 [INFO] Skipping extras file: Transformers.Animated.S01E01.Transform.And.Roll.Out.Part.1.720p.HDTV.h264-OOO.mkv 2024-09-10 16:43:35 [INFO] Skipping extras file: Transformers.Animated.S01E02.Transform.And.Roll.Out.Part.2.720p.HDTV.h264-OOO.mkv 2024-09-10 16:43:35 [INFO] Skipping extras file: Transformers.Animated.S01E03.Transform.And.Roll.Out.Part.3.720p.HDTV.h264-OOO.mkv 2024-09-10 16:43:35 [INFO] Skipping extras file: Transformers.Animated.S01E15.Megatron.Rising.Part.1.720p.HDTV.h264-OOO.mkv 2024-09-10 16:43:35 [INFO] Skipping extras file: Transformers.Animated.S01E16.Megatron.Rising.Part.2.720p.HDTV.h264-OOO.mkv 2024-09-10 16:43:35 [INFO] Skipping extras file: Transformers.Animated.S02E12.A.Bridge.Too.Close.Part.1.720p.HDTV.h264-OOO.mkv 2024-09-10 16:43:35 [INFO] Skipping extras file: Transformers.Animated.S02E13.A.Bridge.Too.Close.Part.2.720p.HDTV.h264-OOO.mkv 2024-09-10 16:43:35 [INFO] Skipping extras file: Transformers.Animated.S03E01.Transwarped.Part.1.720p.HDTV.h264-OOO.mkv 2024-09-10 16:43:35 [INFO] Skipping extras file: Transformers.Animated.S03E02.Transwarped.Part.2.720p.HDTV.h264-OOO.mkv 2024-09-10 16:43:35 [INFO] Skipping extras file: Transformers.Animated.S03E03.Transwarped.Part.3.720p.HDTV.h264-OOO.mkv 2024-09-10 16:43:35 [INFO] Skipping extras file: Transformers.Animated.S03E08.Human.Error.Part.1.720p.HDTV.h264-OOO.mkv 2024-09-10 16:43:35 [INFO] Skipping extras file: Transformers.Animated.S03E09.Human.Error.Part.2.720p.HDTV.h264-OOO.mkv 2024-09-10 16:43:35 [INFO] Skipping extras file: Transformers.Animated.S03E12.Endgame.Part.1.720p.HDTV.h264-OOO.mkv 2024-09-10 16:43:35 [INFO] Skipping extras file: Transformers.Animated.S03E13.Endgame.Part.2.720p.HDTV.h264-OOO.mkv 2024-09-10 16:43:35 [INFO] Skipping extras file: X-Men (Marvel ANIME) - Episode 09 - Revelations...From Behind the Scenes (720p).mp4 2024-09-10 16:43:35 [INFO] Found movie: 14 Love Letters (2022) {tmdb-956001} 2024-09-10 16:43:35 [INFO] Found existing variation for 14 Love Letters (2022) {tmdb-956001}: 14 Love Letters (2022) {tmdb-956001} 2024-09-10 16:43:35 [INFO] Found existing variation for 14 Love Letters (2022) {tmdb-956001}: 14 Love Letters (2022) {tmdb-956001} 2024-09-10 16:43:35 [INFO] Processed file: /mnt/remote/all/14.Love.Letters.2022.1080p.AMZN.WEBRip.1400MB.DD5.1.x264-GalaxyRG.mkv/14.Love.Letters.2022.1080p.AMZN.WEBRip.1400MB.DD5.1.x264-GalaxyRG.mkv to /mnt/symlinks/cinesync/CineSync/Movies/FullHD/14 Love Letters (2022) {tmdb-956001}/14 Love Letters (2022) {tmdb-956001}.mkv 2024-09-10 16:43:35 [INFO] Found movie: 3 Bed, 2 Bath, 1 Ghost (2023) {tmdb-1160972} 2024-09-10 16:43:35 [INFO] Found existing variation for 3 Bed, 2 Bath, 1 Ghost (2023) {tmdb-1160972}: 3 Bed, 2 Bath, 1 Ghost (2023) {tmdb-1160972} 2024-09-10 16:43:35 [INFO] Found existing variation for 3 Bed, 2 Bath, 1 Ghost (2023) {tmdb-1160972}: 3 Bed, 2 Bath, 1 Ghost (2023) {tmdb-1160972} 2024-09-10 16:43:35 [INFO] Processed file: /mnt/remote/all/3.Bed.2.Bath.1.Ghost.2023.1080p.WEB-DL.DDP2.0.H264-AOC.mkv/3.Bed.2.Bath.1.Ghost.2023.1080p.WEB-DL.DDP2.0.H264-AOC.mkv to /mnt/symlinks/cinesync/CineSync/Movies/FullHD/3 Bed, 2 Bath, 1 Ghost (2023) {tmdb-1160972}/3 Bed, 2 Bath, 1 Ghost (2023) {tmdb-1160972}.mkv 2024-09-10 16:43:35 [INFO] Found movie: 10 Lives (2024) {tmdb-567811} 2024-09-10 16:43:35 [INFO] Found existing variation for 10 Lives (2024) {tmdb-567811}: 10 Lives (2024) {tmdb-567811} 2024-09-10 16:43:35 [INFO] Found existing variation for 10 Lives (2024) {tmdb-567811}: 10 Lives (2024) {tmdb-567811} 2024-09-10 16:43:35 [INFO] Processed file: /mnt/remote/all/10.Lives.2024.1080p.WEB.UA-RGB.mkv/10.Lives.2024.1080p.WEB.UA-RGB.mkv to /mnt/symlinks/cinesync/CineSync/Movies/FullHD/10 Lives (2024) {tmdb-567811}/10 Lives (2024) {tmdb-567811}.mkv 2024-09-10 16:43:35 [INFO] Found movie: 2001: A Space Odyssey (1968) {tmdb-62} 2024-09-10 16:43:35 [INFO] Found existing variation for 2001: A Space Odyssey (1968) {tmdb-62}: 2001: A Space Odyssey (1968) {tmdb-62} 2024-09-10 16:43:35 [INFO] Found existing variation for 2001: A Space Odyssey (1968) {tmdb-62}: 2001: A Space Odyssey (1968) {tmdb-62} 2024-09-10 16:43:35 [INFO] Processed file: /mnt/remote/all/2001.A.Space.Odyssey.1968.UHD.BluRay.2160p.DDP.5.1.DV.HDR10Plus.x265-hallowed.mkv/2001.A.Space.Odyssey.1968.UHD.BluRay.2160p.DDP.5.1.DV.HDR10Plus.x265-hallowed.mkv to /mnt/symlinks/cinesync/CineSync/Movies/UltraHD/2001: A Space Odyssey (1968) {tmdb-62}/2001: A Space Odyssey (1968) {tmdb-62}.mkv 2024-09-10 16:43:35 [INFO] Found movie: The 27-Hour Day (2021) {tmdb-847353} 2024-09-10 16:43:35 [INFO] Found existing variation for The 27-Hour Day (2021) {tmdb-847353}: The 27-Hour Day (2021) {tmdb-847353} 2024-09-10 16:43:35 [INFO] Found existing variation for The 27-Hour Day (2021) {tmdb-847353}: The 27-Hour Day (2021) {tmdb-847353} 2024-09-10 16:43:35 [INFO] Processed file: /mnt/remote/all/27.Hour.Day.2021.1080p.AMZN.WEBRip.DDP5.1.x264-TEPES/27.Hour.Day.2021.1080p.AMZN.WEB-DL.DDP5.1.H.264-TEPES.mkv to /mnt/symlinks/cinesync/CineSync/Movies/FullHD/The 27-Hour Day (2021) {tmdb-847353}/The 27-Hour Day (2021) {tmdb-847353}.mkv 2024-09-10 16:43:35 [INFO] Found movie: A Costa Rican Wedding (2024) {tmdb-1310505} 2024-09-10 16:43:35 [INFO] Found existing variation for A Costa Rican Wedding (2024) {tmdb-1310505}: A Costa Rican Wedding (2024) {tmdb-1310505} 2024-09-10 16:43:35 [INFO] Found existing variation for A Costa Rican Wedding (2024) {tmdb-1310505}: A Costa Rican Wedding (2024) {tmdb-1310505} 2024-09-10 16:43:35 [INFO] Processed file: /mnt/remote/all/A Costa Rican Wedding (2024) [1080p] [WEBRip] [YTS.MX]/A.Costa.Rican.Wedding.2024.1080p.WEBRip.x264.AAC-[YTS.MX].mp4 to /mnt/symlinks/cinesync/CineSync/Movies/FullHD/A Costa Rican Wedding (2024) {tmdb-1310505}/A Costa Rican Wedding (2024) {tmdb-1310505}.mp4 2024-09-10 16:43:35 [INFO] Found movie: 8-Bit Christmas (2021) {tmdb-802217} 2024-09-10 16:43:35 [INFO] Renaming 3.Body.Problem.S01E06.The.Stars.Our.Destination.1080p.WEBRip.x265.DDP5.1.Atmos-WAR.mkv to 3 Body Problem - S01E06 - The Stars Our Destination.mkv based on episode name The Stars Our Destination 2024-09-10 16:43:35 [INFO] Found existing variation for 8-Bit Christmas (2021) {tmdb-802217}: 8-Bit Christmas (2021) {tmdb-802217} 2024-09-10 16:43:35 [INFO] Processed file: /mnt/remote/all/3.Body.Problem.S01.1080p.WEBRip.x265.DDP5.1.Atmos-WAR/3.Body.Problem.S01E06.The.Stars.Our.Destination.1080p.WEBRip.x265.DDP5.1.Atmos-WAR.mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/3 Body Problem (2024) {tmdb-108545}/Season 1/3 Body Problem - S01E06 - The Stars Our Destination.mkv 2024-09-10 16:43:35 [INFO] Found existing variation for 8-Bit Christmas (2021) {tmdb-802217}: 8-Bit Christmas (2021) {tmdb-802217} 2024-09-10 16:43:35 [INFO] Processed file: /mnt/remote/all/8-Bit.Christmas.2021.2160p.MA.WEB-DL.DDP5.1.Atmos.DV.HDR.H.265-FLUX.mkv/8-Bit.Christmas.2021.2160p.MA.WEB-DL.DDP5.1.Atmos.DV.HDR.H.265-FLUX.mkv to /mnt/symlinks/cinesync/CineSync/Movies/UltraHD/8-Bit Christmas (2021) {tmdb-802217}/8-Bit Christmas (2021) {tmdb-802217}.mkv 2024-09-10 16:43:35 [INFO] Found movie: 47 Ronin (2013) {tmdb-64686} 2024-09-10 16:43:35 [INFO] Found existing variation for 47 Ronin (2013) {tmdb-64686}: 47 Ronin (2013) {tmdb-64686} 2024-09-10 16:43:35 [INFO] Found existing variation for 47 Ronin (2013) {tmdb-64686}: 47 Ronin (2013) {tmdb-64686} 2024-09-10 16:43:35 [INFO] Processed file: /mnt/remote/all/47.Ronin.2013.2160p.UHD.BluRay.DTS-HD.MA.7.1.HDR.x265-CtrlHD.mkv/47.Ronin.2013.2160p.UHD.BluRay.DTS-HD.MA.7.1.HDR.x265-CtrlHD.mkv to /mnt/symlinks/cinesync/CineSync/Movies/UltraHD/47 Ronin (2013) {tmdb-64686}/47 Ronin (2013) {tmdb-64686}.mkv 2024-09-10 16:43:35 [INFO] Renaming 3.Body.Problem.S01E05.Judgment.Day.1080p.WEBRip.x265.DDP5.1.Atmos-WAR.mkv to 3 Body Problem - S01E05 - Judgment Day.mkv based on episode name Judgment Day 2024-09-10 16:43:35 [INFO] Processed file: /mnt/remote/all/3.Body.Problem.S01.1080p.WEBRip.x265.DDP5.1.Atmos-WAR/3.Body.Problem.S01E05.Judgment.Day.1080p.WEBRip.x265.DDP5.1.Atmos-WAR.mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/3 Body Problem (2024) {tmdb-108545}/Season 1/3 Body Problem - S01E05 - Judgment Day.mkv 2024-09-10 16:43:35 [INFO] Found movie: A Biltmore Christmas (2023) {tmdb-1064137} 2024-09-10 16:43:35 [INFO] Renaming 3.Body.Problem.S01E01.Countdown.1080p.WEBRip.x265.DDP5.1.Atmos-WAR.mkv to 3 Body Problem - S01E01 - Countdown.mkv based on episode name Countdown 2024-09-10 16:43:35 [INFO] Processed file: /mnt/remote/all/3.Body.Problem.S01.1080p.WEBRip.x265.DDP5.1.Atmos-WAR/3.Body.Problem.S01E01.Countdown.1080p.WEBRip.x265.DDP5.1.Atmos-WAR.mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/3 Body Problem (2024) {tmdb-108545}/Season 1/3 Body Problem - S01E01 - Countdown.mkv 2024-09-10 16:43:35 [INFO] Renaming 3.Body.Problem.S01E03.Destroyer.of.Worlds.1080p.WEBRip.x265.DDP5.1.Atmos-WAR.mkv to 3 Body Problem - S01E03 - Destroyer of Worlds.mkv based on episode name Destroyer of Worlds 2024-09-10 16:43:35 [INFO] Processed file: /mnt/remote/all/3.Body.Problem.S01.1080p.WEBRip.x265.DDP5.1.Atmos-WAR/3.Body.Problem.S01E03.Destroyer.of.Worlds.1080p.WEBRip.x265.DDP5.1.Atmos-WAR.mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/3 Body Problem (2024) {tmdb-108545}/Season 1/3 Body Problem - S01E03 - Destroyer of Worlds.mkv 2024-09-10 16:43:35 [INFO] Processed file: /mnt/remote/all/A.Biltmore.Christmas.2023.1080p.WEB-DL.DDP5.1.H264.mkv/A.Biltmore.Christmas.2023.1080p.WEB-DL.DDP5.1.H264.mkv to /mnt/symlinks/cinesync/CineSync/Movies/FullHD/A Biltmore Christmas (2023) {tmdb-1064137}/A Biltmore Christmas (2023) {tmdb-1064137}.mkv 2024-09-10 16:43:35 [INFO] Renaming 3.Body.Problem.S01E04.Our.Lord.1080p.WEBRip.x265.DDP5.1.Atmos-WAR.mkv to 3 Body Problem - S01E04 - Our Lord.mkv based on episode name Our Lord 2024-09-10 16:43:35 [INFO] Processed file: /mnt/remote/all/3.Body.Problem.S01.1080p.WEBRip.x265.DDP5.1.Atmos-WAR/3.Body.Problem.S01E04.Our.Lord.1080p.WEBRip.x265.DDP5.1.Atmos-WAR.mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/3 Body Problem (2024) {tmdb-108545}/Season 1/3 Body Problem - S01E04 - Our Lord.mkv 2024-09-10 16:43:35 [INFO] Renaming 3.Body.Problem.S01E08.Wallfacer.1080p.WEBRip.x265.DDP5.1.Atmos-WAR.mkv to 3 Body Problem - S01E08 - Wallfacer.mkv based on episode name Wallfacer 2024-09-10 16:43:35 [INFO] Renaming 3.Body.Problem.S01E07.Only.Advance.1080p.WEBRip.x265.DDP5.1.Atmos-WAR.mkv to 3 Body Problem - S01E07 - Only Advance.mkv based on episode name Only Advance 2024-09-10 16:43:35 [INFO] Processed file: /mnt/remote/all/3.Body.Problem.S01.1080p.WEBRip.x265.DDP5.1.Atmos-WAR/3.Body.Problem.S01E08.Wallfacer.1080p.WEBRip.x265.DDP5.1.Atmos-WAR.mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/3 Body Problem (2024) {tmdb-108545}/Season 1/3 Body Problem - S01E08 - Wallfacer.mkv 2024-09-10 16:43:35 [INFO] Processed file: /mnt/remote/all/3.Body.Problem.S01.1080p.WEBRip.x265.DDP5.1.Atmos-WAR/3.Body.Problem.S01E07.Only.Advance.1080p.WEBRip.x265.DDP5.1.Atmos-WAR.mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/3 Body Problem (2024) {tmdb-108545}/Season 1/3 Body Problem - S01E07 - Only Advance.mkv 2024-09-10 16:43:36 [INFO] Renaming 3.Body.Problem.S01E02.Red.Coast.1080p.WEBRip.x265.DDP5.1.Atmos-WAR.mkv to 3 Body Problem - S01E02 - Red Coast.mkv based on episode name Red Coast 2024-09-10 16:43:36 [INFO] Processed file: /mnt/remote/all/3.Body.Problem.S01.1080p.WEBRip.x265.DDP5.1.Atmos-WAR/3.Body.Problem.S01E02.Red.Coast.1080p.WEBRip.x265.DDP5.1.Atmos-WAR.mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/3 Body Problem (2024) {tmdb-108545}/Season 1/3 Body Problem - S01E02 - Red Coast.mkv 2024-09-10 16:43:36 [INFO] Found movie: A Greek Recipe for Romance (2024) {tmdb-1285269} 2024-09-10 16:43:36 [INFO] Found existing variation for A Greek Recipe for Romance (2024) {tmdb-1285269}: A Greek Recipe for Romance (2024) {tmdb-1285269} 2024-09-10 16:43:36 [INFO] Found existing variation for A Greek Recipe for Romance (2024) {tmdb-1285269}: A Greek Recipe for Romance (2024) {tmdb-1285269} 2024-09-10 16:43:36 [INFO] Processed file: /mnt/remote/all/A.Greek.Recipe.For.Romance.2024.1080p.WEBRip.x264.AAC-[YTS.MX].mp4/A.Greek.Recipe.For.Romance.2024.1080p.WEBRip.x264.AAC-[YTS.MX].mp4 to /mnt/symlinks/cinesync/CineSync/Movies/FullHD/A Greek Recipe for Romance (2024) {tmdb-1285269}/A Greek Recipe for Romance (2024) {tmdb-1285269}.mp4 2024-09-10 16:43:36 [INFO] Renaming 100.years.of.warner.bros.s01e04.1080p.web.h264-whatsupdoc.mkv to 100 years of warner bros - S01E01 - The Stuff That Dreams Are Made Of.mkv based on episode name The Stuff That Dreams Are Made Of 2024-09-10 16:43:36 [INFO] Renaming 100.years.of.warner.bros.s01e02.1080p.web.h264-bigdoc.mkv to 100 years of warner bros - S01E01 - The Stuff That Dreams Are Made Of.mkv based on episode name The Stuff That Dreams Are Made Of 2024-09-10 16:43:36 [INFO] Renaming 100.years.of.warner.bros.s01e03.1080p.web.h264-whatsupdoc.mkv to 100 years of warner bros - S01E01 - The Stuff That Dreams Are Made Of.mkv based on episode name The Stuff That Dreams Are Made Of 2024-09-10 16:43:36 [INFO] Renaming 100.years.of.warner.bros.s01e01.1080p.web.h264-bigdoc.mkv to 100 years of warner bros - S01E01 - The Stuff That Dreams Are Made Of.mkv based on episode name The Stuff That Dreams Are Made Of 2024-09-10 16:43:36 [INFO] Processed file: /mnt/remote/all/100.years.of.warner.bros.s01e04.1080p.web.h264-whatsupdoc.mkv/100.years.of.warner.bros.s01e04.1080p.web.h264-whatsupdoc.mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/100 Years of Warner Bros. (2023) {tmdb-223249}/Season 1/100 years of warner bros - S01E01 - The Stuff That Dreams Are Made Of.mkv 2024-09-10 16:43:36 [INFO] Processed file: /mnt/remote/all/100.years.of.warner.bros.s01e01.1080p.web.h264-bigdoc.mkv/100.years.of.warner.bros.s01e01.1080p.web.h264-bigdoc.mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/100 Years of Warner Bros. (2023) {tmdb-223249}/Season 1/100 years of warner bros - S01E01 - The Stuff That Dreams Are Made Of.mkv 2024-09-10 16:43:36 [ERROR] Task failed with exception: [Errno 17] File exists: '/mnt/remote/all/100.years.of.warner.bros.s01e03.1080p.web.h264-whatsupdoc.mkv/100.years.of.warner.bros.s01e03.1080p.web.h264-whatsupdoc.mkv' -> '/mnt/symlinks/cinesync/CineSync/Shows/FullHD/100 Years of Warner Bros. (2023) {tmdb-223249}/Season 1/100 years of warner bros - S01E01 - The Stuff That Dreams Are Made Of.mkv' Traceback (most recent call last): File "/app/MediaHub/processors/symlink_creator.py", line 124, in process_file os.symlink(src_file, dest_file) FileExistsError: [Errno 17] File exists: '/mnt/remote/all/100.years.of.warner.bros.s01e03.1080p.web.h264-whatsupdoc.mkv/100.years.of.warner.bros.s01e03.1080p.web.h264-whatsupdoc.mkv' -> '/mnt/symlinks/cinesync/CineSync/Shows/FullHD/100 Years of Warner Bros. (2023) {tmdb-223249}/Season 1/100 years of warner bros - S01E01 - The Stuff That Dreams Are Made Of.mkv'

2024-09-10 16:43:37 [INFO] Database already initialized. Skipping initialization. 2024-09-10 16:43:37 [INFO] Scanning directories for changes...


From: Suresh S @.> Sent: September 10, 2024 10:06 AM To: sureshfizzy/CineSync @.> Cc: snucker-fod @.>; Mention @.> Subject: Re: [sureshfizzy/CineSync] database is locked (Issue #17)

@snucker-fodhttps://github.com/snucker-fod Pull the latest docker image, DB and real-time monitor has been fixed

— Reply to this email directly, view it on GitHubhttps://github.com/sureshfizzy/CineSync/issues/17#issuecomment-2340923486, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASVPAPNUEF6ZA6MU744MW53ZV34GJAVCNFSM6AAAAABN5CYGFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBQHEZDGNBYGY. You are receiving this because you were mentioned.Message ID: @.***>

snucker-fod commented 1 month ago

It seems to have rescanned at least, but there are still DB is locked errors.

2024-09-10 16:53:44 [INFO] Processed file: /mnt/remote/__all__/Friends.S01-S10.Incl.The.Reunion.1080p.BDRip.x265.HEVC-Silence/Friends (1994) - S05E19 - The One Where Ross Can't Flirt (1080p BluRay x265 Silence).mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/Friends (1994) {tmdb-1668}/Season 5/Friends - S05E19 - The One Where Ross Can't Flirt.mkv 2024-09-10 16:53:44 [ERROR] Database error: database is locked 2024-09-10 16:53:44 [INFO] Renaming Friends (1994) - S05E22 - The One With Joey's Big Break (1080p BluRay x265 Silence).mkv to Friends - S05E22 - The One with Joey's Big Break.mkv based on episode name The One with Joey's Big Break 2024-09-10 16:53:44 [INFO] Processed file: /mnt/remote/__all__/Friends.S01-S10.Incl.The.Reunion.1080p.BDRip.x265.HEVC-Silence/Friends (1994) - S05E22 - The One With Joey's Big Break (1080p BluRay x265 Silence).mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/Friends (1994) {tmdb-1668}/Season 5/Friends - S05E22 - The One with Joey's Big Break.mkv 2024-09-10 16:53:44 [INFO] Renaming Friends (1994) - S05E21 - The One With The Ball (1080p BluRay x265 Silence).mkv to Friends - S05E21 - The One with the Ball.mkv based on episode name The One with the Ball 2024-09-10 16:53:44 [INFO] Processed file: /mnt/remote/__all__/Friends.S01-S10.Incl.The.Reunion.1080p.BDRip.x265.HEVC-Silence/Friends (1994) - S05E21 - The One With The Ball (1080p BluRay x265 Silence).mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/Friends (1994) {tmdb-1668}/Season 5/Friends - S05E21 - The One with the Ball.mkv 2024-09-10 16:53:44 [INFO] Renaming Friends (1994) - S05E23 - The One In Vegas (1) (1080p BluRay x265 Silence).mkv to Friends - S05E23 - The One in Vegas.mkv based on episode name The One in Vegas 2024-09-10 16:53:44 [INFO] Processed file: /mnt/remote/__all__/Friends.S01-S10.Incl.The.Reunion.1080p.BDRip.x265.HEVC-Silence/Friends (1994) - S05E23 - The One In Vegas (1) (1080p BluRay x265 Silence).mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/Friends (1994) {tmdb-1668}/Season 5/Friends - S05E23 - The One in Vegas.mkv 2024-09-10 16:53:44 [INFO] Renaming Friends (1994) - S06E01 - The One After Vegas (1080p BluRay x265 Silence).mkv to Friends - S06E01 - The One After Vegas.mkv based on episode name The One After Vegas 2024-09-10 16:53:44 [INFO] Processed file: /mnt/remote/__all__/Friends.S01-S10.Incl.The.Reunion.1080p.BDRip.x265.HEVC-Silence/Friends (1994) - S06E01 - The One After Vegas (1080p BluRay x265 Silence).mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/Friends (1994) {tmdb-1668}/Season 6/Friends - S06E01 - The One After Vegas.mkv 2024-09-10 16:53:44 [ERROR] Error fetching episode data: 404 Client Error: Not Found for url: https://api.themoviedb.org/3/tv/1668/season/5/episode/24?api_key=e10c6338c32c6cb23af850d87359cff6 2024-09-10 16:53:44 [WARNING] Episode name not found for Friends (1994) - S05E24 - The One In Vegas (2) (1080p BluRay x265 Silence).mkv, renaming to Friends - S05E24.mkv 2024-09-10 16:53:44 [INFO] Processed file: /mnt/remote/__all__/Friends.S01-S10.Incl.The.Reunion.1080p.BDRip.x265.HEVC-Silence/Friends (1994) - S05E24 - The One In Vegas (2) (1080p BluRay x265 Silence).mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/Friends (1994) {tmdb-1668}/Season 5/Friends - S05E24.mkv 2024-09-10 16:53:44 [INFO] Renaming Friends (1994) - S06E02 - The One Where Ross Hugs Rachel (1080p BluRay x265 Silence).mkv to Friends - S06E02 - The One Where Ross Hugs Rachel.mkv based on episode name The One Where Ross Hugs Rachel 2024-09-10 16:53:44 [INFO] Processed file: /mnt/remote/__all__/Friends.S01-S10.Incl.The.Reunion.1080p.BDRip.x265.HEVC-Silence/Friends (1994) - S06E02 - The One Where Ross Hugs Rachel (1080p BluRay x265 Silence).mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/Friends (1994) {tmdb-1668}/Season 6/Friends - S06E02 - The One Where Ross Hugs Rachel.mkv 2024-09-10 16:53:44 [INFO] Renaming Friends (1994) - S06E03 - The One With Ross' Denial (1080p BluRay x265 Silence).mkv to Friends - S06E03 - The One with Ross's Denial.mkv based on episode name The One with Ross's Denial 2024-09-10 16:53:44 [INFO] Processed file: /mnt/remote/__all__/Friends.S01-S10.Incl.The.Reunion.1080p.BDRip.x265.HEVC-Silence/Friends (1994) - S06E03 - The One With Ross' Denial (1080p BluRay x265 Silence).mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/Friends (1994) {tmdb-1668}/Season 6/Friends - S06E03 - The One with Ross's Denial.mkv 2024-09-10 16:53:44 [INFO] Renaming Friends (1994) - S06E04 - The One Where Joey Loses His Insurance (1080p BluRay x265 Silence).mkv to Friends - S06E04 - The One Where Joey Loses His Insurance.mkv based on episode name The One Where Joey Loses His Insurance 2024-09-10 16:53:44 [INFO] Processed file: /mnt/remote/__all__/Friends.S01-S10.Incl.The.Reunion.1080p.BDRip.x265.HEVC-Silence/Friends (1994) - S06E04 - The One Where Joey Loses His Insurance (1080p BluRay x265 Silence).mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/Friends (1994) {tmdb-1668}/Season 6/Friends - S06E04 - The One Where Joey Loses His Insurance.mkv 2024-09-10 16:53:44 [INFO] Renaming Friends (1994) - S06E05 - The One With Joey's Porsche (1080p BluRay x265 Silence).mkv to Friends - S06E05 - The One with Joey's Porsche.mkv based on episode name The One with Joey's Porsche 2024-09-10 16:53:44 [INFO] Processed file: /mnt/remote/__all__/Friends.S01-S10.Incl.The.Reunion.1080p.BDRip.x265.HEVC-Silence/Friends (1994) - S06E05 - The One With Joey's Porsche (1080p BluRay x265 Silence).mkv to /mnt/symlinks/cinesync/CineSync/Shows/FullHD/Friends (1994) {tmdb-1668}/Season 6/Friends - S06E05 - The One with Joey's Porsche.mkv 2024-09-10 16:53:44 [ERROR] Database error: database is locked

snucker-fod commented 1 month ago

Is there an .env file that can be set to throttle the requests per second? I think that could be a factor.

sureshfizzy commented 1 month ago

Can you remove your old db folder and re run again. Also what's the count of your total Torrents ?

sureshfizzy commented 1 month ago

I've pushed few more optimizations for db with throttles on symlinks branch codebase, try running it locally and see how it goes

snucker-fod commented 1 month ago

I tried starting fresh, because my persistent docker data was not mapped to /app, but to /config and it was causing issues for me. Now I cannot start the container at all.

python3: can't open file '/app/MediaHub/main.py': [Errno 2] No such file or directory

It seems like the container doesn't create it's own MediaHub and db folders and .txt file now?

sureshfizzy commented 1 month ago

I tried starting fresh, because my persistent docker data was not mapped to /app, but to /config and it was causing issues for me. Now I cannot start the container at all.

python3: can't open file '/app/MediaHub/main.py': [Errno 2] No such file or directory

It seems like the container doesn't create it's own MediaHub and db folders and .txt file now?

yea, it's because of the /app, also for symlinks branch it was on test flight so i did'nt push any docker updates for it. Threshold's and retries are going good for now, but at few rare cases I still see some issues over db connection which happens due to permission mismatch. I'm checking on how the permission changes during run.

sureshfizzy commented 1 month ago

@snucker-fod This issue must be resolved now, I have also updated the Docker images, which you can fetch. Before proceeding with any modifications, either alter the permissions of the db folder and your destination folder, or entirely erase both and perform a fresh scan. Make sure you set the id to PUID and PGID in accordance with the new Docker compose modification. Real-time monitoring will also work now.

snucker-fod commented 1 month ago

I did a bit of testing today and it seems to be working well with the latest fixes. There are some errors popping up but nothing related to locked DB's.

sureshfizzy commented 1 month ago

Check the permissions of the db folder, do ls -l on the cinesync folder and as well as ls -l db, and verify if it matches with the user which you gave on the compose file

RunAway189 commented 1 month ago

@snucker-fod I am having a similar issue (or maybe the same one). Basically if I try to run the script with my old symlinks, the database seems to be corrupted. In this case, my script will always ignore it and runs the full scan always from scratch, like it doesn't exist. Running a full scan on a new empty destination dir seems to fix the problem instead.

snucker-fod commented 1 month ago

@snucker-fod I am having a similar issue (or maybe the same one). Basically if I try to run the script with my old symlinks, the database seems to be corrupted. In this case, my script will always ignore it and runs the full scan always from scratch, like it doesn't exist. Running a full scan on a new empty destination dir seems to fix the problem instead.

There is no longer an issue with the DB for me when I started fresh, the errors I saw were from bad URLs to TVDB.

I will see if I have the same behavior as RunAway189 when starting it a second time.

snucker-fod commented 1 month ago

@snucker-fod I am having a similar issue (or maybe the same one). Basically if I try to run the script with my old symlinks, the database seems to be corrupted. In this case, my script will always ignore it and runs the full scan always from scratch, like it doesn't exist. Running a full scan on a new empty destination dir seems to fix the problem instead.

I didn't get anything out of the ordinary, started the container a second time after letting it make links for me yesterday and the only "errors" were for skipping Extras files. Could you share some logs?

sureshfizzy commented 1 month ago

@snucker-fod Issue 21 was closed when new code was pushed, db should not crash now if it does reopen that one. Also if this issue is solved we can close Issue 17 as well..

snucker-fod commented 1 month ago

Seems to run well now. I will open another issue for a second logic problem I believe there is.