C9Glax / tranga

Docker-Container to monitor (Manga) Scanlation-Sites for download new chapters.
GNU General Public License v3.0
157 stars 15 forks source link

Fatal crash after trying to copy over a cover missing from the imageCache #82

Closed darR3Ke closed 1 year ago

darR3Ke commented 1 year ago

What is broken?

Due to some shenanigans on my part i lost all images in the imageCache, but i still had Manga between my jobs that haven't created a folder with the chapters in.

When it tries to create the folder and copy over the image from the imageCache it gets a fatal unhandled exception.

Log-output

[11/12/2023 02:50:32.81 ]   MangaKatana | Cloning cover /usr/share/tranga-api/imageCache/638352376278674139.jpg -> /Manga/Usuzumi no Hate/cover.jpg
 Unhandled exception. System.IO.FileNotFoundException: Could not find file '/usr/share/tranga-api/imageCache/638352376278674139.jpg'.
 File name: '/usr/share/tranga-api/imageCache/638352376278674139.jpg'
    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Func`4 createOpenException)
    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Func`4 createOpenException)
    at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite)
    at Tranga.MangaConnectors.MangaConnector.CopyCoverFromCacheToDownloadLocation(Manga manga) in /src/Tranga/MangaConnectors/MangaConnector.cs:line 153
    at Tranga.Jobs.DownloadNewChapters.ExecuteReturnSubTasksInternal() in /src/Tranga/Jobs/DownloadNewChapters.cs:line 46
    at Tranga.Jobs.Job.ExecuteReturnSubTasks() in /src/Tranga/Jobs/Job.cs:line 89
    at Tranga.Jobs.JobBoss.CheckJobs() in /src/Tranga/Jobs/JobBoss.cs:line 240
    at Tranga.Tranga.<StartJobBoss>b__10_0() in /src/Tranga/Tranga.cs:line 74

Additional stuff

This can be solved by manually creating the image in the imageCache

C9Glax commented 1 year ago

Should be fixed now, added logic to try and re-download missing covers as well