Author Topic: [6361] No automatic clean-up of temporary files that fill up system drive  (Read 3311 times)

theta_wave

  • Sr. Member
  • ****
  • Posts: 680
Unfortunately, I don't have the luxury of 60GB of free space on my system's 128GB SSD (OS and programs only).  In the middle of my on-the-fly conversion of selected playlists to a 128GB USB key, I found out my user's TEMP directory filling up with temporary Musicbee created mp3s long after they already copied to the USB key.  I definitely have enough space on the HDD that holds Musicbee's mbl files for such a process to play out, but not on my system's SSD.  In the past, I synced the same playlists (60 GB of mp3s, many transcoded on-the-fly from lossless sources) with the same system drive space constraints from start to finish plenty of times with no problems.

Code
MusicBee v3.1.6361.38930 (Win6.1), 3 Jun 2017 16:56:

System.IO.IOException: There is not enough space on the disk.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.FileStream.FlushWrite(Boolean calledFromFinalizer)
   at System.IO.FileStream.Dispose(Boolean disposing)
   at System.IO.Stream.Close()
   at System.IO.BinaryWriter.Dispose(Boolean disposing)
   at System.IO.BinaryWriter.Dispose()
   at #=qcId4O6D2vjhdbXjSu4w7ogfFpbIuj_vS8dj0FTqkmM0=.#=qKz1EO$vJL22D5ViCI4BSAwH7Nb2asYqeM7sZ8MVgg4I=.#=quz7LpyQau$xBaL4OvqXG8w==(FileStream #=qVqbUjF2wknjSR_11wXoyHg==)
   at #=qcId4O6D2vjhdbXjSu4w7ogfFpbIuj_vS8dj0FTqkmM0=.#=qrfmUWCbBLxrZXM2nCO5PtQ==.#=q3NT3CD4ZRnKuYbda5iqZJA==()
   at MusicBee.Media.Storage.#=qH1KKB4e5fSbHwtF1ej7gLg==(Boolean #=qLwvzKAMNp3pHdg_OAJPJYg==, Boolean #=qU5d5BW8_1NpQdZSHx_dS1w==, Dictionary`2 #=qjgAZwmy23TM$ILzZNhE7H4$Vv7_cPVHsNdF_lkRr9Ew=, List`1 #=qze$I74eUce113fn7HZs4czrPvxzfy563IRg2Ub2UkFM=, Object #=qn61f1idtsP36d7CfUrYGe5zzMsk8SspxwbFxT28h7dw=)
   at MusicBee.Media.Storage.#=qN7B4$F2zcDugvw$GL9Sg_w==(Boolean #=qojPxzxTtblLdKvWRFo3jrw==, #=q7pqJ3QRKEUCHKCJRMq7B1l4CcxdB7hxPZlS54zPziy0= #=qXcj4jOQY3n9aLB2GnGrqCQ==, Object #=qZZKC8pbU5C6jafN$P4pvp_UiuwW$VmNB5hsLk3Ey55Q=)
   at MusicBee.Media.Storage.#=qYyBuEGuhEzd6hrIz0ltL9g==(Object #=qun28yapneMQ7MlDHkLVz7p8u5q8QF5APlE6_g3tLe7Y=)
   at #=qF_dMnseeXePMESiVBqgqb_x27xaqOdxMvs9EN3zkKVU=.#=qqmt2FVJ_inMCsJQmZVOLryMmqIsd9uYKXXy8h5T3mc4=(Object #=qRMPc_YTVIUbC1VJrCtt0AQ==)

Code: error.log
6/3/2017 4:55:20 PM - Copy I:\Soundtrack - Game\Mega Man - Albums\(1990) Mega Man 3\23. Staff Roll.mp3 to P:\Music\Soundtrack - Game\Mega Man 3 (1990)\23. Staff Roll.mp3
6/3/2017 4:55:20 PM - There is not enough space on the disk. [I:\Soundtrack - Game\Mega Man - Albums\(1990) Mega Man 3\23. Staff Roll.mp3]
6/3/2017 4:55:20 PM - Copy I:\Soundtrack - Game\Mega Man - Albums\(1992) Mega Man 5\23. Ending.mp3 to P:\Music\Soundtrack - Game\Mega Man 5 (1992)\23. Ending.mp3
6/3/2017 4:55:20 PM - There is not enough space on the disk. [I:\Soundtrack - Game\Mega Man - Albums\(1992) Mega Man 5\23. Ending.mp3]
6/3/2017 4:55:20 PM - Copy I:\Soundtrack - Game\Metroid Prime (2002)\10. Chozo Artifact Temple.mp3 to P:\Music\Soundtrack - Game\Metroid Prime [Game Rip] (2002)\10. Chozo Artifact Temple.mp3
6/3/2017 4:55:20 PM - There is not enough space on the disk. [I:\Soundtrack - Game\Metroid Prime (2002)\10. Chozo Artifact Temple.mp3]
6/3/2017 4:55:20 PM - Copy I:\Soundtrack - Game\Metroid Prime (2002)\27. Phendrana Drifts Theme 2.mp3 to P:\Music\Soundtrack - Game\Metroid Prime [Game Rip] (2002)\27. Phendrana Drifts Theme 2.mp3
6/3/2017 4:55:20 PM - There is not enough space on the disk. [I:\Soundtrack - Game\Metroid Prime (2002)\27. Phendrana Drifts Theme 2.mp3]
6/3/2017 4:55:21 PM - Copy I:\Soundtrack - Game\The Secret of Monkey Island 2- Lechuck's Revenge (1991)\101. Opening Themes & Introduction.mp3 to P:\Music\Soundtrack - Game\Monkey Island 2- Lechuck's Revenge (1991)\101. Opening Themes & Introduction.mp3
6/3/2017 4:55:21 PM - There is not enough space on the disk. [I:\Soundtrack - Game\The Secret of Monkey Island 2- Lechuck's Revenge (1991)\101. Opening Themes & Introduction.mp3]
6/3/2017 4:55:21 PM - Copy I:\Soundtrack - Game\Myst (1998)\02. Myst Island Treegate.mp3 to P:\Music\Soundtrack - Game\Myst (1998)\02. Myst Island Treegate.mp3
6/3/2017 4:55:21 PM - There is not enough space on the disk. [I:\Soundtrack - Game\Myst (1998)\02. Myst Island Treegate.mp3]
6/3/2017 4:55:21 PM - Copy I:\Soundtrack - Game\Myst IV- Revelation (2005)\02. Yeesha's Joyride.mp3 to P:\Music\Soundtrack - Game\Myst IV- Revelation (2005)\02. Yeesha's Joyride.mp3
6/3/2017 4:55:21 PM - There is not enough space on the disk. [I:\Soundtrack - Game\Myst IV- Revelation (2005)\02. Yeesha's Joyride.mp3]
6/3/2017 4:55:21 PM - Copy I:\Soundtrack - Anime\The Nightmare Before Christmas [Bonus] (2006)\02. Sally's Song.mp3 to P:\Music\Soundtrack - Anime\Nightmare Before Christmas [Bonus], The (2006)\02. Sally's Song.mp3
6/3/2017 4:55:21 PM - There is not enough space on the disk. [I:\Soundtrack - Anime\The Nightmare Before Christmas [Bonus] (2006)\02. Sally's Song.mp3]
6/3/2017 4:55:21 PM - Copy I:\Soundtrack - Anime\Ninja Scroll (1993)\15. Somewhere, Faraway, Everyone is Listening to a Ballad.mp3 to P:\Music\Soundtrack - Anime\Ninja Scroll (1993)\15. Somewhere, Faraway, Everyone is Listening to a Ballad.mp3
6/3/2017 4:55:21 PM - There is not enough space on the disk. [I:\Soundtrack - Anime\Ninja Scroll (1993)\15. Somewhere, Faraway, Everyone is Listening to a Ballad.mp3]
6/3/2017 4:55:21 PM - Copy I:\Soundtrack - Game\Oolong Tea Story ~Searching for Delicious Tea~ (2008)\06. Presentation.mp3 to P:\Music\Soundtrack - Game\Oolong Tea Story ~Searching for Delicious Tea~ (2008)\06. Presentation.mp3
6/3/2017 4:55:21 PM - There is not enough space on the disk. [I:\Soundtrack - Game\Oolong Tea Story ~Searching for Delicious Tea~ (2008)\06. Presentation.mp3]
6/3/2017 4:55:21 PM - Copy I:\Soundtrack - Game\Oolong Tea Story ~Searching for Delicious Tea~ (2008)\08. Drink.mp3 to P:\Music\Soundtrack - Game\Oolong Tea Story ~Searching for Delicious Tea~ (2008)\08. Drink.mp3
6/3/2017 4:55:21 PM - There is not enough space on the disk.

6/3/2017 4:55:21 PM - Copy I:\Soundtrack - Game\Oolong Tea Story ~Searching for Delicious Tea~ (2008)\09. Memories.mp3 to P:\Music\Soundtrack - Game\Oolong Tea Story ~Searching for Delicious Tea~ (2008)\09. Memories.mp3
6/3/2017 4:55:21 PM - There is not enough space on the disk. [I:\Soundtrack - Game\Oolong Tea Story ~Searching for Delicious Tea~ (2008)\09. Memories.mp3]
6/3/2017 4:55:21 PM - There is not enough space on the disk. [I:\Soundtrack - Game\Oolong Tea Story ~Searching for Delicious Tea~ (2008)\10. Tea Field [Looped].mp3]
Last Edit: June 04, 2017, 03:43:37 AM by theta_wave

theta_wave

  • Sr. Member
  • ****
  • Posts: 680
An interesting observation while I was babysitting the conversion.  I continually checked the TEMP drive to clear files before the syncing task filled up my system drive again (bad things happen when the system drive's free space falls to 0) and deleted files I thought already copied over (checked the tags and file size in both TEMP and destination device locations).  Unwittingly, I deleted some that have yet to transfer over resulting in "6/3/2017 5:39:45 PM - The system cannot find the file specified. [%USERPROFILE%\AppData\Local\Temp\MusicBee_foo.mp3]"

Following that error message, the expected behavior returns: temporary %USERPROFILE%\AppData\Local\Temp\MusicBee_foo.mp3 is deleted upon copying over.
Last Edit: June 04, 2017, 03:44:16 AM by theta_wave

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34349
MB should be deleting the temporary files as soon as they are copied. What has changed from v3.0 to v3.1 is the encoding and copying are done in parallel so if the copying is slow then the encoding threads may build up a number of encoded files ready for copy. I suggest you try reducing the number of encoding threads and reduce their priority.
One thing that I dont understand is the actual error provided was when MB flushes the database cache. I would expect that file to reside on the target device, not on the drive with the temporary data

theta_wave

  • Sr. Member
  • ****
  • Posts: 680
MB should be deleting the temporary files as soon as they are copied. What has changed from v3.0 to v3.1 is the encoding and copying are done in parallel so if the copying is slow then the encoding threads may build up a number of encoded files ready for copy. I suggest you try reducing the number of encoding threads and reduce their priority.
One thing that I dont understand is the actual error provided was when MB flushes the database cache. I would expect that file to reside on the target device, not on the drive with the temporary data
Encoding threads is set to "1" and priority set to "normal".  The thing is that 20GB of files were already copied and 20GB of files were left in the TEMP directory almost extinguishing whatever free space I had.  With respect to the error messages provided, I had the same expectations too.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34349
if a file is not converted to a new format but still requires resaving eg. embeded artwork is resized, artist substituted etc then it does appear the temp file is not removed until MB closes. If the file is converted to a new format then it should get deleted as soon as possible.
Thats fixed for the next v3.1 update

http://musicbee.niblseed.com/V3_1/MusicBee31_Patched.zip
Last Edit: June 04, 2017, 09:24:48 PM by Steven

theta_wave

  • Sr. Member
  • ****
  • Posts: 680
if a file is not converted to a new format but still requires resaving eg. embeded artwork is resized, artist substituted etc then it does appear the temp file is not removed until MB closes. If the file is converted to a new format then it should get deleted as soon as possible.
Thats fixed for the next v3.1 update

http://musicbee.niblseed.com/V3_1/MusicBee31_Patched.zip
That was it!  In the device profile, I selected the option to have artwork embedded and resized.  I should have posted my device profile settings.  I'm sorry if you had to do any additional detective work.

Thanks, Steven!

amp

  • Newbie
  • *
  • Posts: 11
Have to bring this up again, I have the same issue, and has been plaguing me for years since the iPod classic. Now though, it is my regular MTP/MSC Android phone with a 128GB sd card. I have in the settings to encode files anything above 191k AAC bitrate, tried all sorts of artwork settings, and the temp folder storage builds only with encoded files that are never transferred to the device. Some files below 191k are copied fine, but the files that are encoded are built in the temp and never copied over. Only closing Musicbee will wipe the temp folder clean rendering cpu heat, cycles and disk storage a waste because the encoded files are never copied. If it were, I could deal with it by once in a while restarting Musicbee, but not in this case. Thanks.

Edit: Alright! Developer has stated several times throughout different posts that Musicbee should delete temp files automatically, this is true but I just found out that the syncing to MTP device works with auto delete temp files when the "except codec" option is UNCHECKED.


Code
on-the-fly-conversion > convert all files [ ] except <codec> with [<bitrate>]k or less bitrate

In my previous case, I had it checked for AAC and 127k, so convert all 128k aac files or above to the desired on-the-fly conversion bitrate, this triggered an endless build up of temp files in which where "encoded" but never copied to the device. Now unchecked, the temp folder behaves accordingly to auto delete files. This must be a bug if it is checked, right? If someone wants to convert certain codecs at a certain bitrate by checking this box, then he or she will face this problem by temp folder buildup and encoded files not copying over to device. Thanks.
Last Edit: April 21, 2018, 10:43:53 PM by amp