Author Topic: problems with long file names  (Read 3759 times)

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
I recall this thread: https://getmusicbee.com/forum/index.php?topic=21316.msg125612

Maybe this is related to it?  In any case, MusicBee has crashed on me twice this weekend, with this error:


Code
5/29/2017 12:32:58 AM - 10.0.15063.0 - 3.1.6357.35666 - System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
   at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.GetPathRoot(String path)
   at System.IO.RenamedEventArgs.get_OldFullPath()
   at #=qsprbBBWcw9R3W8JqWuOhjkd9oAPsn884Pcfyntn78y8=.#=qchnVkVKeOQovUhN7roJZmnpC8hKyGmp0NTj2iC_u7_c=..ctor(RenamedEventArgs #=q8i2Kz0CJG9nlpZEwxFyegQ==)
   at #=qsprbBBWcw9R3W8JqWuOhjkd9oAPsn884Pcfyntn78y8=.#=qozmiQqjiT3A2aHjf9iJFTA==.#=qdAY$fft2$dPsRyxPd7ufeqT_UCiTy8PO5D2aLusWmQE=(Object #=qYWmdx5dxURQ9mK9QRr8D4g==, RenamedEventArgs #=qC0Sofu$xnM9E$BzhxcH85w==)
   at System.IO.FileSystemWatcher.OnRenamed(RenamedEventArgs e)
   at System.IO.FileSystemWatcher.NotifyRenameEventArgs(WatcherChangeTypes action, String name, String oldName)
   at System.IO.FileSystemWatcher.CompletionStatusChanged(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* overlappedPointer)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)


I've also had some problems with tracks not being recognized by other programs until I shorten the filenames, but MusicBee doesn't give any kind of notice about long file names.
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34351
MusicBee 3.1 has support for long windows filenames (>260 chars)
However, the continous monitor was one place i overlooked.
I can see why .NET might throw the error but in my own testing i didnt actually get the error, instead the filename was automatically set to 8.3 short name format. I believe its possible to disable 8.3 short names in windows so thats why it might have thrown the error for you but its not something i want to experiment with.
For the next update, I have put in a microsoft documented solution as long as you are using windows 10 or .NET 4.6.2 installed then its supposed to work.
For the reason stated above, i cant reproduce your scenario to prove it works so all i can say is it probably works.
To test this, your old filename (including folder path) needs to exceed > 260 chars (which MB v3.1 allows you to do) and then change the track title so its auto-organised to a new filename


psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
I'm still getting this crash when I edit the Sort Title for long filenames.  Now it's actually opening the error log rather than giving me an error message.

Code
6/4/2017 7:17:00 PM - 10.0.15063.0 - 3.1.6364.39041 - System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
   at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.GetPathRoot(String path)
   at System.IO.RenamedEventArgs.get_OldFullPath()
   at #=qvHK_w0ng2GMvBwqTe7FK454WEML15F3cEAdjTK7$Dqg=.#=qVZ9Pz$VnP6isFrv3LTNUdLIbDwNoI_Rsi8QJ3JIVOgg=..ctor(RenamedEventArgs #=qxWbw3rPJiOewbEmWOqHZDQ==)
   at #=qvHK_w0ng2GMvBwqTe7FK454WEML15F3cEAdjTK7$Dqg=.#=qxW0S5_6vaxeCUtUAN0C2Ew==.#=quYcjXEkrKHSDIYvz$Y07QpcOqmzvJ1RAAPeIW8q_M9U=(Object #=qbjyphfqZNDmDrRMfFU_elQ==, RenamedEventArgs #=qXcXcNl5LmnIbC_vzrQe8Iw==)
   at System.IO.FileSystemWatcher.OnRenamed(RenamedEventArgs e)
   at System.IO.FileSystemWatcher.NotifyRenameEventArgs(WatcherChangeTypes action, String name, String oldName)
   at System.IO.FileSystemWatcher.CompletionStatusChanged(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* overlappedPointer)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
And now I'm trying to get back to these files to fix them, and I'm getting a popup that says "MusicBee Startup Error" in the title bar and "Object reference not set to an instance of an object" in the box (that's it, not a regular error message).  It also opens the error log in Notepad, with this error.  If I hit OK on the popup, it just comes right back and opens another instance of the error log.  I think it happened when I tried to open the tag editor.

Code
6/4/2017 7:22:32 PM - 10.0.15063.0 - 3.1.6364.39041 - System.NullReferenceException: Object reference not set to an instance of an object.
   at MusicBee.MusicBeeMain.NavigationHeader.#=q5$Agt5QprM$5RTG4XH2_HTAAqA2hJ6Bm8e9AA6Xmd30=(Point #=qn03MUzd2tJtuhUa9aWeoVQ==)
   at MusicBee.MusicBeeMain.NavigationHeader.#=qmTAWP2k6S0NA60PuKxKrY3oAdc8iX9XWvu9wqLiaYps=(Point #=qHsNzkA4AjFFGx1eEWdWleg==)
   at MusicBee.MusicBeeMain.#=qGcfg22KWBN1fc_tIeUaSDLCYX3IYMqlZJ1Y_DSBEPiU=(Point #=qYmQK6g9nLjvsbKxzzf7e5g==)
   at #=qbww7dp3LBqi3O$ZkzhVYoHxQKAzagFA6qG1yk2367wI=.WndProc(Message& #=q4CgS4vppEOzedoogyMOeIg==)
   at MusicBee.MusicBeeMain.WndProc(Message& #=q0Z6nYhXLnIzvWDMeAo8Odw==)
   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)
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34351
Could you send me your settings file: MusicBee3Settings.ini?

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34351
is the error repeatable? I dont seem to be able to reproduce this using your settings.
If it is then i can give you a debug version

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
Yes, I can reproduce it by getting rid of the Sort Title so that the file is renamed to the longer filename, then trying to shorten again with the Sort Title.
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34351
the System.NullReferenceException error relates to moving the mouse over the header bar that contains the tabs and i dont see how that could be related - it was what i was asking about if that error is repeatable.

For the original reported error, the latest MB builds include the supposed fix from microsoft for long filename handling within .NET. Are you getting exactly the same errors when you remove Sort Title from the file naming?
Last Edit: June 06, 2017, 07:50:04 AM by Steven

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
It's only when the name is already long and I add a Sort Title to shorten it that I'm getting the errors. And it's not MusicBee's error messages anymore, it's the strange pop ups and opening the error log in notepad.  I'll get screenshots tonight if you're not sure what I mean.
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34351
looking at the code and from your description, i can see how the System.NullReferenceException error might occur but i dont know the root problem. The next v3.1 update should stop that error but not solve the actual issue.
i think i am going to need to give you a debug version but before that can you confirm the following:
- you are able to start MB
- you open the tag editor and edit the file with the very long title
- you enter a sort title and save the file
- your library naming rules include a condition that takes the sort title in preference to the title field?
- as MB is saving the file you get the crash?

also it might be useful if you send me a zip of the entire error log file

edit:
i am fairly sure i know the sequence of events that triggers the error behavior. I think the next version should stop completely crashing but i expect there will still be an error silently logged, so could you send me that error once i make the new version available and you have used it
Last Edit: June 06, 2017, 06:37:02 PM by Steven

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34351

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
Yes, it worked without any new errors, even in the background!
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)