osu-framework icon indicating copy to clipboard operation
osu-framework copied to clipboard

Game crashing on file selectors due to disconnected network drives on Windows

Open ItsShamed opened this issue 3 years ago • 2 comments
trafficstars

Type

Crash to desktop

Bug description

When trying to open a file/directory selector (e.g.: "Import files" in the maintenance settings) on Windows, the game freezes then continues to run normally but the selectors won't show up anymore and will throw errors. Sometimes the game crashes completely (I think if it is spammed).

Possible cause

I did a little research in the logs and found out this is because I used to have SMB drives connected to Windows but I recently decided to take them down on the "backend" side which keeps the drives listed on Windows but will throw errors upon trying to access them (expected behavior). So I'm not really that surprised that this error was thrown.

Screenshots or videos

Few examples in the Explorer and PowerShell: Network drives listed in the Explorer Example of trying to access a network drive in PowerShell

Example in-game:

https://user-images.githubusercontent.com/39100084/179367737-6e985123-abbc-4d55-ae7e-2a96ce97ca8e.mp4

Version

2022.716.1.0

Logs

database.log legacy-ipc.log network.log performance.log performance-audio.log performance-draw.log performance-input.log performance-update.log runtime.log updater.log

From runtime.log:

2022-07-16 17:31:30 [error]: System.IO.IOException: The network path was not found. : 'I:\'
2022-07-16 17:31:30 [error]: at System.IO.FileSystemInfo.EnsureDataInitialized()
2022-07-16 17:31:30 [error]: at System.IO.FileSystemInfo.get_Attributes()
2022-07-16 17:31:30 [error]: at osu.Framework.Graphics.UserInterface.DirectorySelectorDirectory..ctor(DirectoryInfo directory, String displayName)
2022-07-16 17:31:30 [error]: at osu.Game.Graphics.UserInterfaceV2.OsuDirectorySelectorDirectory..ctor(DirectoryInfo directory, String displayName)
2022-07-16 17:31:30 [error]: at osu.Game.Graphics.UserInterfaceV2.OsuFileSelector.CreateDirectoryItem(DirectoryInfo directory, String displayName)
2022-07-16 17:31:30 [error]: at osu.Framework.Graphics.UserInterface.DirectorySelector.updateDisplay()
2022-07-16 17:31:30 [error]: at osu.Framework.Graphics.UserInterface.DirectorySelector.<load>b__11_1(ValueChangedEvent`1 _)
2022-07-16 17:31:30 [error]: at osu.Framework.Graphics.UserInterface.DirectorySelector.load(GameHost gameHost)

ItsShamed avatar Jul 16 '22 18:07 ItsShamed

I don't know if it's relevant nor if it's worth a PR, but for my case a simple workaround would be

--- a/osu.Framework/Graphics/UserInterface/DirectorySelector.cs
+++ b/osu.Framework/Graphics/UserInterface/DirectorySelector.cs
@@ -163,7 +163,10 @@ private void updateDisplay()
                     var drives = DriveInfo.GetDrives();
 
                     foreach (var drive in drives)
-                        directoryFlow.Add(CreateDirectoryItem(drive.RootDirectory));
+                    {
+                        if (drive.IsReady)
+                            directoryFlow.Add(CreateDirectoryItem(drive.RootDirectory));
+                    }
 
                     return;
                 }

I did some tests with this and this fixed the issue on my side.

ItsShamed avatar Aug 01 '22 00:08 ItsShamed

I don't know if it's relevant nor if it's worth a PR, but for my case a simple workaround would be

I think this is a fine first step, better than a crash at least.

peppy avatar Aug 02 '22 05:08 peppy

Sentry issue: OSU-3QA