Libation
Libation copied to clipboard
Allow override of TMP on Linux
Describe the bug It looks like /tmp is being used on Linux to store downloads in progress. This is not a typical file system, and is relatively small, and hence it can run full before the full download/assembly is complete. The "out of diskspace" error is not shown in the app or the CLI component, but can be found by looking carefully in the log file.
Suggest creating a temporary directory in the working directory or allow a setup option/command parameter for the user to specify a better space to store the large temporary files.
To Reproduce Start a lot of transformations. Have a few of them fail (if you can) and /tmp runs full. Particular on smaller systems like VMs, will /tmp be small as it's based on tmpfs - which is basically just using memory (compressed). /var/tmp is likewize based on tmpfs. If your system has a lot of RAM like 64GB this error will be hard to find.
Expected behavior Not having the temporary run full. An error message saying if the file system is full.
Platform
Fedora 36 using Wine and dotnet-runtime
Log Files
{"ExceptionDetail":{"Type":"System.IO.IOException","HResult":28,"Message":"No space left on device : '/tmp/Libation/DownloadsInProgress/Galaxy Outlaws꞉ The Complete Black Ocean Mobius Missions, 1-16.5 [B079YYJK47].aaxc'","Source":"System.Private.CoreLib","TargetSite":"Void WriteAtOffset(Microsoft.Win32.SafeHandles.SafeFileHandle, System.ReadOnlySpan`1[System.Byte], Int64)"}}2022-08-08 08:58:23.172 -04:00 [ERR] (at AaxDecrypter.AaxcDownloadSingleConverter+<RunAsync>d__1.MoveNext()) Error encountered in download and convert Aaxc To "M4b"
System.IO.IOException: No space left on device : '/tmp/Libation/DecryptInProgress/Galaxy Outlaws꞉ The Complete Black Ocean Mobius Missions, 1-16.5 [B079YYJK47].m4b'
at System.IO.RandomAccess.WriteAtOffset(SafeFileHandle handle, ReadOnlySpan`1 buffer, Int64 fileOffset)
at System.IO.Strategies.BufferedFileStreamStrategy.FlushWrite()
at System.IO.Strategies.BufferedFileStreamStrategy.WriteSpan(ReadOnlySpan`1 source, ArraySegment`1 arraySegment)
at System.IO.FileStream.Write(ReadOnlySpan`1 buffer)
at Mpeg4Lib.Util.StreamExtensions.WriteInt16BE(Stream stream, Int16 value)
at AAXClean.Chapter.WriteChapter(Stream output) in /home/runner/work/AAXClean/AAXClean/src/AAXClean/Chapter.cs:line 29
at AAXClean.FrameFilters.Audio.Mp4aWriter.WriteChapters(ChapterInfo chapters) in /home/runner/work/AAXClean/AAXClean/src/AAXClean/FrameFilters/Audio/Mp4aWriter.cs:line 114
at AAXClean.FrameFilters.Audio.LosslessFilter.CloseWriter() in /home/runner/work/AAXClean/AAXClean/src/AAXClean/FrameFilters/Audio/LosslessFilter.cs:line 43
at AAXClean.FrameFilters.Audio.LosslessFilter.Dispose(Boolean disposing) in /home/runner/work/AAXClean/AAXClean/src/AAXClean/FrameFilters/Audio/LosslessFilter.cs:line 54
at AAXClean.FrameFilters.Audio.AavdFilter.Dispose(Boolean disposing) in /home/runner/work/AAXClean/AAXClean/src/AAXClean/FrameFilters/Audio/AavdFilter.cs:line 30
at AAXClean.FrameFilters.FrameFilterBase`1.Dispose() in /home/runner/work/AAXClean/AAXClean/src/AAXClean/FrameFilters/FrameFilterBase[TInput].cs:line 97
at AAXClean.Mp4File.ConvertToMp4aAsync(Stream outputStream, ChapterInfo userChapters, Boolean trimOutputToChapters) in /home/runner/work/AAXClean/AAXClean/src/AAXClean/Mp4File.cs:line 119
at AaxDecrypter.AaxcDownloadSingleConverter.Step_DownloadAudiobookAsSingleFile() in C:\Dropbox\DinahsFolder\coding\_NET\Visual Studio 2022\Libation\Source\AaxDecrypter\AaxcDownloadSingleConverter.cs:line 82
at AaxDecrypter.AaxcDownloadSingleConverter.RunAsync() in C:\Dropbox\DinahsFolder\coding\_NET\Visual Studio 2022\Libation\Source\AaxDecrypter\AaxcDownloadSingleConverter.cs:line 33
To clarify - this error happens if you use the GUI to start a long queue of downloads, and some of these downloads fail. This results in the partly downloaded files to remain in /tmp and once this has happened enough, a "small" /tmp runs full (4GB in my case).
You can change where temporary files are stored in Settings > Download / Decrypt (although you can't pick a custom location, you can choose between 5 presets.
Also, have you tried the Linux build? The install instructions are for Ubuntu, but it should work for any system capable of installing the dotnet runtime.
Just download the linux chardonnay release, extract, make ./Libation executable, and run.
@Mbucari Thanks - hadn't seen that. Looks like the presets aren't Linux friendly - most of them go to the home directory under Libation often with another Libation after it - all using back-slashes instead for forward. I'll try. I found another work-around and changed $HOME/Libation/Settings.json - and entered a very custom location. That allowed the largest book (34+ hours) to download fine. Suggest code still checks for space, and that old downloads aren't kept around in the location.
@Mbucari Another clarification, I didn't think I needed to do that. It's running - and while I saw it unstable initially I think I found the cause (the space on /tmp ran out). My library did convert - and it's being moved into Plex. I will most likely end up doing some fine tuning, but overall I can make it work.
I do plan on creating an "easy install" feature on Fedora and sending you a PR - hopefully this week.
@bit4man Thanks! I'm thrilled to have a Linux person chiming in
This will be included in the next version