3ventic / BotVentic

Twitch-focused Discord bot
https://github.com/3ventic/BotVenticCore
MIT License
22 stars 4 forks source link

Linux Support With Mono #6

Closed Zackery closed 8 years ago

Zackery commented 8 years ago

I love your bot! Is it possible to run it on linux with Mono? I run it with mono on the server and get this

[root@everything Debug]# mono BotVentic.exe Version 1.0.5803.28485 Started!

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at BotVentic.Program.UpdateBttvEmotes () [0x00000] in :0 at BotVentic.Program.UpdateAllEmotes () [0x00000] in :0 at BotVentic.Program.Main (System.String[] args) [0x00000] in :0 [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object at BotVentic.Program.UpdateBttvEmotes () [0x00000] in :0 at BotVentic.Program.UpdateAllEmotes () [0x00000] in :0 at BotVentic.Program.Main (System.String[] args) [0x00000] in :0 [root@everything Debug]#

Is there something i'm doing wrong? Are you guys adding Linux support later? Thank you.

3ventic commented 8 years ago

I run it under mono myself, so it should work. The error seems to be caused by the request to BTTV's emote API returning something it shouldn't (possibly due to a failed connection).

I added some checks to it so it should no longer crash if that happens and simply fail to add the emotes to its list instead.

Zackery commented 8 years ago

Interesting, I downloaded the new build and I still seem to be having issues.

[root@everything Release]# mono BotVentic.exe
Version 1.0.5808.30814
Started!
Error loading bttv emotes
Error loading twitch emotes!
Emotes acquired!
Connecting...
System.Net.WebException: Error getting response stream (Write: The authentication or decryption has failed.): SendFailure ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: Invalid certificate received from server. Error code: 0xffffffff800b010a
  at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.RemoteValidation (Mono.Security.Protocol.Tls.ClientContext context, AlertDescription description) [0x00000] in <filename unknown>:0
  at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.validateCe                                                                                                                                                             rtificates (Mono.Security.X509.X509CertificateCollection certificates) [0x00000]                                                                                                                                                              in <filename unknown>:0
  at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.ProcessAsT                                                                                                                                                             ls1 () [0x00000] in <filename unknown>:0
  at Mono.Security.Protocol.Tls.Handshake.HandshakeMessage.Process () [0x00000]                                                                                                                                                              in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) Mono.Security.Protocol.Tls.Handshake.H                                                                                                                                                             andshakeMessage:Process ()
  at Mono.Security.Protocol.Tls.ClientRecordProtocol.ProcessHandshakeMessage (Mo                                                                                                                                                             no.Security.Protocol.Tls.TlsStream handMsg) [0x00000] in <filename unknown>:0
  at Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (IA                                                                                                                                                             syncResult asyncResult) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResu                                                                                                                                                             lt asyncResult) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Net.HttpWebRequest.EndGetRequestStream (IAsyncResult asyncResult) [0                                                                                                                                                             x00000] in <filename unknown>:0
  at RestSharp.Http.RequestStreamCallback (IAsyncResult result, System.Action`1                                                                                                                                                              callback) [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] i                                                                                                                                                             n <filename unknown>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwa                                                                                                                                                             iter[TResult].GetResult () [0x00000] in <filename unknown>:0
  at Discord.API.RestClient+<Send>d__31.MoveNext () [0x00000] in <filename unkno                                                                                                                                                             wn>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] i                                                                                                                                                             n <filename unknown>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwa                                                                                                                                                             iter[TResult].GetResult () [0x00000] in <filename unknown>:0
  at Discord.API.RestClient+<Send>d__29`1[Discord.API.LoginResponse].MoveNext ()                                                                                                                                                              [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] i                                                                                                                                                             n <filename unknown>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwa                                                                                                                                                             iter[TResult].GetResult () [0x00000] in <filename unknown>:0
  at Discord.DiscordAPIClient+<Login>d__15.MoveNext () [0x00000] in <filename un                                                                                                                                                             known>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] i                                                                                                                                                             n <filename unknown>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwa                                                                                                                                                             iter[TResult].GetResult () [0x00000] in <filename unknown>:0
  at Discord.Helpers.TaskHelper+<Timeout>d__5`1[Discord.API.LoginResponse].MoveN                                                                                                                                                             ext () [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] i                                                                                                                                                             n <filename unknown>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwa                                                                                                                                                             iter[TResult].GetResult () [0x00000] in <filename unknown>:0
  at Discord.DiscordClient+<Connect>d__145.MoveNext () [0x00000] in <filename un                                                                                                                                                             known>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] i                                                                                                                                                             n <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x0000                                                                                                                                                             0] in <filename unknown>:0
  at BotVentic.Program+<>c__DisplayClass16_0+<<Main>b__0>d.MoveNext () [0x00000]                                                                                                                                                              in <filename unknown>:0
Press Any key to quit

You don't have to worry about it dude, however thanks for the reply regardless. <3

(edited the bot output for readability -3v)

3ventic commented 8 years ago

Seems like your server doesn't trust the TLS certificates used by Twitch and BetterTTV. That's not really something I can help with, unfortunately.