andruzzzhka / BeatSaberMultiplayer

MIT License
152 stars 39 forks source link

Errors on songs with special characters #5

Closed noideaman closed 6 years ago

noideaman commented 6 years ago

Some Songs throw errors when the system tries to load them Preventing the server from running. Please look into supporting non-alpha/numeric characters

Unhandled Exception: System.AggregateException: One or more errors occurred. (One or more errors occurred. (Could not find file '/home/noideaman/beatsaber/MultiplayerServer_linux-64/AvailableSongs/Downloaded/Bad Apple!! - FalKKonE/BAD APPLE - edit.ogg'.)) (Could not find file '/home/noideaman/beatsaber/MultiplayerServer_linux-64/AvailableSongs/Downloaded/Bad Apple!! - FalKKonE/BAD APPLE - edit.ogg'.) ---> System.IO.FileNotFoundException: Could not find file '/home/noideaman/beatsaber/MultiplayerServer_linux-64/AvailableSongs/Downloaded/Bad Apple!! - FalKKonE/BAD APPLE - edit.ogg'.
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at BeatSaberMultiplayerServer.ServerMain.<>c.<DownloadSongs>b__24_2(CustomSongInfo song) in C:\Users\Tyler\RiderProjects\BeatSaberMultiplayer\BeatSaberMultiplayerServer\ServerMain.cs:line 228
   at System.Linq.Parallel.ForAllOperator`1.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey)
   at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()
   at System.Linq.Parallel.SpoolingTaskBase.Work()
   at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
   at System.Linq.Parallel.QueryTask.RunTaskSynchronously(Object o)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
   --- End of inner exception stack trace ---
   at System.Linq.Parallel.QueryTaskGroupState.QueryEnd(Boolean userInitiatedDispose)
   at System.Linq.Parallel.SpoolingTask.SpoolForAll[TInputOutput,TIgnoreKey](QueryTaskGroupState groupState, PartitionedStream`2 partitions, TaskScheduler taskScheduler)
   at System.Linq.Parallel.MergeExecutor`1.Execute()
   at System.Linq.Parallel.MergeExecutor`1.Execute[TKey](PartitionedStream`2 partitions, Boolean ignoreOutput, ParallelMergeOptions options, TaskScheduler taskScheduler, Boolean isOrdered, CancellationState cancellationState, Int32 queryId)
   at System.Linq.Parallel.PartitionedStreamMerger`1.Receive[TKey](PartitionedStream`2 partitionedStream)
   at System.Linq.Parallel.ForAllOperator`1.WrapPartitionedStream[TKey](PartitionedStream`2 inputStream, IPartitionedStreamRecipient`1 recipient, Boolean preferStriping, QuerySettings settings)
   at System.Linq.Parallel.UnaryQueryOperator`2.UnaryQueryOperatorResults.ChildResultsRecipient.Receive[TKey](PartitionedStream`2 inputStream)
   at System.Linq.Parallel.ListQueryResults`1.GivePartitionedStream(IPartitionedStreamRecipient`1 recipient)
   at System.Linq.Parallel.UnaryQueryOperator`2.UnaryQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient`1 recipient)
   at System.Linq.Parallel.QueryOperator`1.GetOpenedEnumerator(Nullable`1 mergeOptions, Boolean suppressOrder, Boolean forEffect, QuerySettings querySettings)
   at System.Linq.Parallel.ForAllOperator`1.RunSynchronously()
   at System.Linq.ParallelEnumerable.ForAll[TSource](ParallelQuery`1 source, Action`1 action)
   at BeatSaberMultiplayerServer.ServerMain.DownloadSongs() in C:\Users\Tyler\RiderProjects\BeatSaberMultiplayer\BeatSaberMultiplayerServer\ServerMain.cs:line 225
   at BeatSaberMultiplayerServer.ServerMain.Start(String[] args) in C:\Users\Tyler\RiderProjects\BeatSaberMultiplayer\BeatSaberMultiplayerServer\ServerMain.cs:line 65
   at BeatSaberMultiplayerServer.ServerMain.Main(String[] args) in C:\Users\Tyler\RiderProjects\BeatSaberMultiplayer\BeatSaberMultiplayerServer\ServerMain.cs:line 43
Aborted
noideaman commented 6 years ago

It might be a diffrent issue. It failed on to other songs with no special charecters. The files are there, set to the permissions of the user running the multiplayer server

https://www.beatsaver.com/details.php?id=1186 https://www.beatsaver.com/details.php?id=900

working on a bash script that picks random songs from beatsaver and configures the settings.json to provide them one can set the maximum number of songs to download in the script

jaddie commented 6 years ago

@artman41 Are you able to reproduce this? I obv don't own any of this gubbins so can't actually presumably run the server? This issue doesn't really have enough info for me to work on it :o

kellyprankin commented 6 years ago

I can help with this potentially

On Thu, Jun 14, 2018 at 7:36 PM Jaddie notifications@github.com wrote:

@artman41 https://github.com/artman41 Are you able to reproduce this? I obv don't own any of this gubbins so can't actually presumably run the server? This issue doesn't really have enough info for me to work on it :o

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/andruzzzhka/BeatSaberMultiplayer/issues/5#issuecomment-397496018, or mute the thread https://github.com/notifications/unsubscribe-auth/ABzhAyf5TrewlciSkR3XtD8ARy8tJs4Eks5t8x2vgaJpZM4UYLpa .

pfgithub commented 6 years ago

@jaddie You can just download the server from releases and make a config file. No one needs to connect to the server for it to download the maps.

jaddie commented 6 years ago

Yeah my previous comment can be disregarded, the reason I couldn't run the server wasn't anything to do with that -- its because I'm running the next version of windows and there was a bug installing the .net framework etc :)

I'll see about reproducing this later and discuss it with Nick as he'll know, and I'll see about spinning up a new VM to test it on a copy of linux, just out of curiosity not that it should make any difference @noideaman what distro & version were you running this on?

pfgithub commented 6 years ago

I have the same problem with it on Centos 7

LatePacket commented 6 years ago

For those that don't know why this is happening or how to fix it, its simple, the files are case sensitive (at least with my testing on Linux not sure if windows runs into the same issue).

You can see in the error log above that it says the server can't find the file, its because in the info file the capitalization is probably not the same as the audio files capitalization.

E.G if its named "Song.ogg" in the info.json file inside the downloaded zip, the audio file needs to be named exactly "Song.ogg" not "song.ogg". So to fix this you will need to open the zip and edit the capitalization of the audio file or edit info.json in a text editor then rezip and place it back into the servers song download location.

@noideaman originally thought the issue was special characters crashing the server. If this is the case you can fix this also by renaming the audio file and updating the info file to match the new file name. You should only need to do this on the server side.

I only know of one song that I can't find the cause of why it causes the server to crash, and that being song ID 1451"Dance till your dead" which gives a completely different error. Its info.json file seems to be laid out differently to other songs so I'm not sure if that is the cause. But I have however tried redoing the layout to that of the standard I see other songs info.json use with no luck.

Anyways hope this helps.

kellyprankin commented 6 years ago

I'm not sure there is a great way to fix this issue due to the case sensitivity. I could make it so that it doesn't try to load songs that it can't find due to the case sensitivity problem. It would no longer crash, but you would still not have access to those songs.

kellyprankin commented 6 years ago

OK, what I have done is to make it so that it will not crash the server if it can't load a song. Instead it will log an error. I am having a bit of trouble testing it because it seems that I can't connect to the server hub.

LatePacket commented 6 years ago

Oh that's great @kellyprankin would be handy for when super long playlists get created so we don't have to sort through all the songs that don't work right away, also need any help testing?