Closed Synergyst closed 7 years ago
Thanks for the extensive bug report!
YouTube-dl is working (indicated by YT Saved!
). The problem afterwards seems to be LiteDB, which is used to save the history.
For some reasons there sometimes occurs an InvalidCastException (see also #42 and #74) in LiteDB.
As far as I know there is no known fix for this (though I heard @Splamy thinks about moving to another database system, random crashes are not really good).
Maybe you can get a working bot by moving your history file (so a new one gets created), but I'm not sure if the database plays a role in this error.
Yes, as @Flakebi stated this is a problem of the database we are using. If you dont care about the song history you can delelte the history.db
file.
I will probably move to a new database system soon (or see if the author releases a fix).
Hello, I deleted all of the *.db files.
I received this error:
root@pentium:/media/ZFS-Pools/HGST-3TB-Mirror/Audio-Bots/TS3AudioBot-Source/TS3AudioBot/bin/Release# mono TS3AudioBot.exe
[14:17:33] Info: [============ TS3AudioBot started =============]
[14:17:33] Info: [=== Date/Time: Monday, August 21, 2017 2:17:33 PM
[14:17:33] Info: [=== Version: 0.5.1/master/f9631a01
[14:17:33] Info: [==============================================]
[14:17:33] Info: [============ Initializing Commands ===========]
[14:17:33] Info: [============ Initializing Modules ============]
[14:17:33] Info: [=========== Initializing Factories ===========]
[14:17:33] Info: [=========== Registering callbacks ============]
[14:17:33] Info: [================= Finalizing =================]
[14:17:33] Info: [==================== Done ====================]
[14:17:39] Debug: MB Got message from Pawkow: !play [URL]https://www.youtube.com/watch?v=AjPau5QYtYs[/URL]
[14:17:39] Debug: SM User Pawkow created session with the bot
[14:17:39]Warning: TH Web error: [403] Forbidden
[14:17:39] Debug: YT Ruined!
[14:17:43] Debug: YT Saved!
[14:17:43] Debug: PM ar start: Youtube ID:AjPau5QYtYs
[14:17:43] Error: MB Unexpected command error: MSG: The given key was not present in the dictionary.
TYPE:KeyNotFoundException
STACK: at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x00021] in <a3c4aef09b90421281b772cc05a43e75>:0
at LiteDB.DataService.GetBlock (LiteDB.PageAddress blockAddress) [0x00016] in <fd3cfe54fa504c7989678d84ffcd090b>:0
at LiteDB.DataService.Read (LiteDB.PageAddress blockAddress) [0x00000] in <fd3cfe54fa504c7989678d84ffcd090b>:0
at LiteDB.LiteEngine+<Find>d__52.MoveNext () [0x0013d] in <fd3cfe54fa504c7989678d84ffcd090b>:0
at LiteDB.LiteCollection`1+<Find>d__17[T].MoveNext () [0x000fc] in <fd3cfe54fa504c7989678d84ffcd090b>:0
at System.Linq.Enumerable.FirstOrDefault[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0003e] in <198d428ffe33413aa3c4cb6d388f57b3>:0
at LiteDB.LiteCollection`1[T].FindOne (System.Linq.Expressions.Expression`1[TDelegate] predicate) [0x00018] in <fd3cfe54fa504c7989678d84ffcd090b>:0
at TS3AudioBot.History.HistoryManager.FindByUniqueId (System.String uniqueId) [0x00084] in <67926bd564e64aa68365afd37223cfab>:0
at TS3AudioBot.History.HistoryManager.Store (TS3AudioBot.History.HistorySaveData saveData) [0x00026] in <67926bd564e64aa68365afd37223cfab>:0
at TS3AudioBot.History.HistoryManager.LogAudioResource (TS3AudioBot.History.HistorySaveData saveData) [0x00000] in <67926bd564e64aa68365afd37223cfab>:0
at TS3AudioBot.MainBot.<InitializeBot>b__69_1 (System.Object s, TS3AudioBot.PlayInfoEventArgs e) [0x0001c] in <67926bd564e64aa68365afd37223cfab>:0
at (wrapper delegate-invoke) System.EventHandler`1[TS3AudioBot.PlayInfoEventArgs]:invoke_void_object_TEventArgs (object,TS3AudioBot.PlayInfoEventArgs)
at TS3AudioBot.PlayManager.Play (TS3AudioBot.InvokerData invoker, TS3AudioBot.ResourceFactories.PlayResource play, TS3AudioBot.MetaData meta) [0x00089] in <67926bd564e64aa68365afd37223cfab>:0
at TS3AudioBot.PlayManager.Play (TS3AudioBot.InvokerData invoker, System.String link, System.Nullable`1[T] type, TS3AudioBot.MetaData meta) [0x00037] in <67926bd564e64aa68365afd37223cfab>:0
at TS3AudioBot.MainBot.CommandPlay (TS3AudioBot.CommandSystem.ExecutionInformation info, System.String parameter) [0x00021] in <67926bd564e64aa68365afd37223cfab>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <a3c4aef09b90421281b772cc05a43e75>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <a3c4aef09b90421281b772cc05a43e75>:0
at TS3AudioBot.CommandSystem.FunctionCommand.ExecuteFunction (System.Object[] parameters) [0x00020] in <67926bd564e64aa68365afd37223cfab>:0
at TS3AudioBot.CommandSystem.FunctionCommand.Execute (TS3AudioBot.CommandSystem.ExecutionInformation info, System.Collections.Generic.IEnumerable`1[T] arguments, System.Collections.Generic.IEnumerable`1[T] returnTypes) [0x00145] in <67926bd564e64aa68365afd37223cfab>:0
at TS3AudioBot.CommandSystem.BotCommand.Execute (TS3AudioBot.CommandSystem.ExecutionInformation info, System.Collections.Generic.IEnumerable`1[T] arguments, System.Collections.Generic.IEnumerable`1[T] returnTypes) [0x0002c] in <67926bd564e64aa68365afd37223cfab>:0
at TS3AudioBot.CommandSystem.CommandGroup.Execute (TS3AudioBot.CommandSystem.ExecutionInformation info, System.Collections.Generic.IEnumerable`1[T] arguments, System.Collections.Generic.IEnumerable`1[T] returnTypes) [0x000bd] in <67926bd564e64aa68365afd37223cfab>:0
at TS3AudioBot.CommandSystem.RootCommand.Execute (TS3AudioBot.CommandSystem.ExecutionInformation info, System.Collections.Generic.IEnumerable`1[T] arguments, System.Collections.Generic.IEnumerable`1[T] returnTypes) [0x00062] in <67926bd564e64aa68365afd37223cfab>:0
at TS3AudioBot.CommandSystem.AppliedCommand.Execute (TS3AudioBot.CommandSystem.ExecutionInformation info, System.Collections.Generic.IEnumerable`1[T] arguments, System.Collections.Generic.IEnumerable`1[T] returnTypes) [0x00013] in <67926bd564e64aa68365afd37223cfab>:0
at TS3AudioBot.CommandSystem.XCommandSystem.Execute (TS3AudioBot.CommandSystem.ExecutionInformation info, System.String command, System.Collections.Generic.IEnumerable`1[T] returnTypes) [0x00018] in <67926bd564e64aa68365afd37223cfab>:0
at TS3AudioBot.CommandSystem.XCommandSystem.Execute (TS3AudioBot.CommandSystem.ExecutionInformation info, System.String command) [0x00000] in <67926bd564e64aa68365afd37223cfab>:0
at TS3AudioBot.MainBot.TextCallback (System.Object sender, TS3Client.Messages.TextMessage textMessage) [0x001c8] in <67926bd564e64aa68365afd37223cfab>:0
Error call Stack:
Void TextCallback(System.Object, TS3Client.Messages.TextMessage)@0
Void ExtendedTextMessage(System.Object, System.Collections.Generic.IEnumerable`1[TS3Client.Messages.TextMessage])@0
Void InvokeEvent(TS3Client.LazyNotification)@0
Void DispatchLoop()@0
Void ThreadStart_Context(System.Object)@0
Void RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)@0
Void Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)@0
Void Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)@0
Void ThreadStart()@0 T:TS3Query MessageLoop
[14:17:43]Warning: SongStoppedHook could not play Next: No next song could be played
My only idea is try again and if everything fails, disable the history in the settings by setting HistoryManager::EnableHistory
to false
Okay. I have disabled that inside of my configuration file and now I am receiving this output:
root@pentium:/media/ZFS-Pools/HGST-3TB-Mirror/Audio-Bots/TS3AudioBot-Source/TS3AudioBot/bin/Release# mono TS3AudioBot.exe
[17:08:05] Info: [============ TS3AudioBot started =============]
[17:08:05] Info: [=== Date/Time: Monday, August 21, 2017 5:08:05 PM
[17:08:05] Info: [=== Version: 0.5.1/master/f9631a01
[17:08:05] Info: [==============================================]
[17:08:05] Info: [============ Initializing Commands ===========]
[17:08:05] Info: [============ Initializing Modules ============]
[17:08:05] Info: [=========== Initializing Factories ===========]
[17:08:05] Info: [=========== Registering callbacks ============]
[17:08:05] Info: [================= Finalizing =================]
[17:08:05] Info: [==================== Done ====================]
[17:08:10] Debug: MB Got message from Pawkow: !play [URL]https://www.youtube.com/watch?v=AjPau5QYtYs[/URL]
[17:08:10] Debug: SM User Pawkow created session with the bot
[17:08:10]Warning: TH Web error: [403] Forbidden
[17:08:10] Debug: YT Ruined!
[17:08:13] Debug: YT Saved!
[17:08:13] Debug: PM ar start: Youtube ID:AjPau5QYtYs
[17:08:13]Warning: SongStoppedHook could not play Next: No next song could be played
No sound is playing, regardless of how long I wait for it to download(if it even is..)
It's random whether or not it will choose to actually play a URL I feed it. However almost always it has the result given above..
The bot doesnt download song, it streams everything, though this seems very strange.
Have you set the bot up with the !bot setup
like in the tutorial?
Can you try to go into the same channel as the bot and try !channel on
I have given the bot sufficient permissions to use !bot setup
and I was given this output:
root@pentium:/media/ZFS-Pools/HGST-3TB-Mirror/Audio-Bots/TS3AudioBot-Source/TS3AudioBot/bin/Release# mono TS3AudioBot.exe
[18:06:17] Info: [============ TS3AudioBot started =============]
[18:06:17] Info: [=== Date/Time: Monday, August 21, 2017 6:06:17 PM
[18:06:17] Info: [=== Version: 0.5.1/master/f9631a01
[18:06:17] Info: [==============================================]
[18:06:17] Info: [============ Initializing Commands ===========]
[18:06:17] Info: [============ Initializing Modules ============]
[18:06:17] Info: [=========== Initializing Factories ===========]
[18:06:17] Info: [=========== Registering callbacks ============]
[18:06:17] Info: [================= Finalizing =================]
[18:06:18] Info: [==================== Done ====================]
[18:06:22] Debug: MB Got message from Pawkow: !bot setup
[18:06:22] Debug: SM User Pawkow created session with the bot
[18:06:41] Debug: MB Got message from Pawkow: !play [URL]https://www.youtube.com/watch?v=AjPau5QYtYs[/URL]
[18:06:42]Warning: TH Web error: [403] Forbidden
[18:06:42] Debug: YT Ruined!
[18:06:44] Debug: YT Saved!
[18:06:44] Debug: PM ar start: Youtube ID:AjPau5QYtYs
[18:06:44]Warning: SongStoppedHook could not play Next: No next song could be played
[18:06:52] Debug: MB Got message from Pawkow: !channel on
[18:06:54] Debug: MB Got message from Pawkow: !play [URL]https://www.youtube.com/watch?v=AjPau5QYtYs[/URL]
[18:06:55]Warning: TH Web error: [403] Forbidden
[18:06:55] Debug: YT Ruined!
[18:06:57] Debug: YT Saved!
[18:06:57] Debug: PM ar start: Youtube ID:AjPau5QYtYs
[18:06:58]Warning: SongStoppedHook could not play Next: No next song could be played
Have you tried other stuff like mp3 or soundcloud links?
Do you mind pm'ing me your server address so I can connect with my own bot instance and try around to see if it's the servers fault or the bot ones.
If you want to allow me to try around with your bot instance you can add my ts3 uid to the rights.toml admin group: uA0U7t4PBxdJ5TLnarsOHQh4/tY=
In case you can send me the the server address the earliest I could come would be tomorrow since it's late here and I'm a bit tired
I have sent an email containing the details for the server.
Are you still available to test the bot settings on my server?
Yeah, had a long day, I'm here now
UPDATE: I've been able to get this problem resolved by compiling the latest developer branch!
I can also confirm this is working on the Raspberry Pi 3 perfectly using some tweaks to the source code due to latency issues. ^^
I am going to mark this as solved since I am expecting the developer branch edits to be merged into the master branch.
already got merged bout an hour ago :)
btw, what do you mean with latency issues?
The Raspberry Pi 3 is based on the armv7l architecture, which is not a compatible option to compile the TS3AudioBot with using msbuild.
I was able to get the TS3AudioBot working perfectly on the Raspberry Pi 3 by adjusting the timeout periods in the source code for overhead compensation when using QEMU for emulation of the i686 architecture(which is needed to run the Intel-80386 executable that the TS3AudioBot.exe is compiled out to be).
Perhaps the latency issue on the Raspberry Pi 3 can be mitigated by adding more CPU compiler options for msbuild to choose from to compile with for native performance?
This is a non-issue on my dual-CPU Intel Xeon E5-2670 server, obviously.
Yeah, I will change the packet timeout algorithm soon anyway since it's stupid. It will have an average + standard deviation (similar as TCP does it)
It is possible to let the TS3AudioBot run "natively" (it's still C# ;) ) on a Raspberry Pi so QEMU doesn't add unnecessary bloat. (Sidenote: I'm using arch on the Raspberry Pi 3. On raspbian, getting mono is probably a bit more difficult.)
The only changes I made is replacing all occurences of x86 in TS3AudioBot/TS3AudioBot.csproj by AnyCPU: sed -i 's/x86/AnyCPU/g' TS3AudioBot/TS3AudioBot.csproj
Then compile it: xbuild /p:Configuration=Release TS3AudioBot/TS3AudioBot.csproj
And use it as normal.
LibGit2Sharp will fail to load the library and I didn't get that working, but it's ok as long as xbuild reports only warnings and no errors.
Fresh start, moved to channel, private messaged: !play https://www.youtube.com/watch?v=AjPau5QYtYs
Console output:
configTS3AudioBot.cfg contents:
I expect this to work normally and use my YouTube-DL binary path I specified. There is a cron job setup to check for YouTube-DL updates every 15 minutes; YouTube-DL IS up to date. I compiled FFMPEG from source with all of the modules, it works, I use it very often.
Perhaps I'm missing something in TS3AudioBot?
Kind regards