Author Topic: System.UnauthorizedAccessException: Access to the path is denied.  (Read 2512 times)

lusal

  • Newbie
  • *
  • Posts: 1
MusicBee v3.3.7367.38620D  (Win10.0), 25 Mar 2020 19:58:

System.UnauthorizedAccessException: Access to the path is denied.
   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.StreamWriter.Dispose(Boolean disposing)
   at System.IO.TextWriter.Dispose()
   at #=zRd$3rjqKgAHiSmUPWWTLwWY=.#=zQf_zezQVh9tk()
   at #=zRd$3rjqKgAHiSmUPWWTLwWY=.#=zPnlZ_u8=(#=zcUzi2DsMzTxzPLoWDpGnaGY= #=z_5MgmPE=, Boolean #=zWG3HEkg=)
   at #=z8NkH9l$piq$lW_KGDZdD1XdU0rCyDSiyiw==.#=zYO4E4bp$dGR3(Object #=z4OVDJ6s=, EventArgs #=zHB5no$s=)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at #=z0cPqHI7KNGXgARY2g1eMHmQ=.OnClick(EventArgs #=zHB5no$s=)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9346
What were you doing when this happened?

Make sure the path to MB and the path to your music files is not set to Read Only.
Make sure your music files are not in C:\users\[username]\
Also try whitelisting the entire MB directory in your AV software.
Download the latest MusicBee v3.5 or 3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Posting screenshots is here
Searching the forum with Google is  here

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34344
in windows explorer, right click on the folder/ Properties/ Security and check the user id you are logged into windows with has full access to the Music\MusicBee folder

fjelsten

  • Jr. Member
  • **
  • Posts: 28
I am also getting this. My user does have full access to the folder - and the file!

MusicBee v3.3.7491.38139D  (Win10.0), 28 dec 2020 16:20:

System.UnauthorizedAccessException: Access to the path 'C:\Users\[USERNAME]\AppData\Roaming\MusicBee\Tag Backups\.Master Tag Index.mbi' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at MusicBeePlugin.BackupIndex.saveBackup(String backupName, String statusbarText, Boolean isAutocreatedParam)
   at MusicBeePlugin.Plugin.regularAutobackup(Object state)
   at System.Threading.TimerQueueTimer.CallCallbackInContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.TimerQueueTimer.CallCallback()
   at System.Threading.TimerQueueTimer.Fire()
   at System.Threading.TimerQueue.FireNextTimers()
   at System.Threading.TimerQueue.AppDomainTimerCallback(Int32 id)

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34344
I am also getting this. My user does have full access to the folder - and the file!
That error is from the backup plugin so you should report this on the plugin author's topic, although he hasn't been active on the forum for some time.
It looks like the plugin backup is run at timed intervals and conflicted with MB also saving the database at the same time.
Perhaps there is a configuration option in the plugin to change when it runs the backup

fjelsten

  • Jr. Member
  • **
  • Posts: 28