Closed mzabsky closed 7 years ago
what version of mono is this
Make sure you run certmgr -ssl https://discordapp.com
and certmgr -ssl https://gateway.discord.gg
otherwise mono wont connect to discord over ssl.
EDIT: Just compiled your bot and ran it on my linux machine running ubuntu 16.04 without issues.
Mono is Stable 4.6.1.3.
I did run the two certmgr commands before posting the issue.
I suspect the error has something to do with IPv6 (other google results for that exception suggest as much), but I'm not sure what can I do about it without drilling deep into DiscordNet (or even worse the communication library it uses).
Discord.Net does nothing that specifies networking configurations. If you're machine is specifying IPv6, it's something in your machine.
Exactly the same problem. Imported certs and using 4.6.1 mono.
Update: The problem seems to be mono itself. Downgrading from 4.6.1 to 4.4.2 fixes the issue instantly. If anyone is having this issue, looks like the temporary workaround is to just downgrade mono.
@mzabsky can you try Eric's fix, and see if that resolves it?
I just started experiencing this issue too after performing an update, so that is the likely cause. I'm not entirely sure how to downgrade to 4.4.2 though.
Depends on your OS. You need to use the system's package manager to uninstall then reinstall the specific version. (I've never had to downgrade, so there might be a specific command/method for that, depending on your OS)
I can confirm my bot works after downgrading to Mono 4.4.2.
I assume this is not a proper solution, so I am not closing yet :)
We use a different networking setup in 1.0, could someone please check if this issue is present there as well?
Expiriencing same after upgrade from 4.2 to 4.6.1. Connecting using WebSocket4Net to even ws:// not wss:// scheme and got this:
[DEBUG] <DMPCLIENT> 11-02 08:42:16: Starting ws://c1.XXXXXX.com/wsc/
[ERROR] <DMPCLIENT> 11-02 08:42:16: Can't start WSDMPClient - Exception has been thrown by the target of an invocation., at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0004d] in /builddir/build/BUILD/mono-4.6.1/mcs/class/corlib/System.Reflection/MonoMethod.cs:313
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /builddir/build/BUILD/mono-4.6.1/mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs:229
at SuperSocket.ClientEngine.ConnectAsyncExtension.ConnectAsync (System.Net.EndPoint remoteEndPoint, SuperSocket.ClientEngine.ConnectedCallback callback, System.Object state) [0x00039] in <4ba236fbf29248a4985a92e6e3907e4a>:0
at SuperSocket.ClientEngine.TcpClientSession.Connect () [0x00074] in <4ba236fbf29248a4985a92e6e3907e4a>:0
at WebSocket4Net.WebSocket.Open () [0x0003a] in <4ba236fbf29248a4985a92e6e3907e4a>:0
at DMPUtils.WSDMPClient.OnStart () [0x00046] in <08c32b8c89594a5db0dd068de82c3c6d>:0
[ERROR] <DMPCLIENT> 11-02 08:42:16: InnerException - An address incompatible with the requested protocol was used, at System.Net.Sockets.Socket..ctor (System.Net.Sockets.AddressFamily addressFamily, System.Net.Sockets.SocketType socketType, System.Net.Sockets.ProtocolType protocolType) [0x0005e] in /builddir/build/BUILD/mono-4.6.1/mcs/class/System/System.Net.Sockets/Socket.cs:212
at System.Net.Sockets.Socket.ConnectAsync (System.Net.Sockets.SocketType socketType, System.Net.Sockets.ProtocolType protocolType, System.Net.Sockets.SocketAsyncEventArgs e) [0x00000] in /builddir/build/BUILD/mono-4.6.1/mcs/class/System/System.Net.Sockets/Socket.cs:1361
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 /builddir/build/BUILD/mono-4.6.1/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
This is a live issue (see #442 ) and needs quick resolution.
@mcmonkey4eva Use mono 4.4.2 - people are reporting that downgrading fixes the issue.
Still, being incompatible with latest runner code is a big problem, and should be addressed as quickly as possible.
It isn't really a big problem, especially when 0.9 isn't even being actively maintained anymore. If the problem exists in 1.0, then it may be addressed.
It won't be recommended to use Mono, anyways, for 1.0. .NET Core works for most platforms, now, all but ARM, if you counter Docker Deployment, but even with ARM, that's scheduled for .NET Core this Quarter.
... I didn't realize there was a 1.0
available. Thanks, I'll see if I can get that one working...
... new question, how do I acquire Discord.NET 1.0? Nuget does not have it as the readme claims (nuget is at 0.9.6), and compiling it from .NET Core CLI
just gives failure messages :(
Just a lot of
MSBUILD : error MSB1009: Project file does not exist.
Switch: src\Discord.Net
Microsoft (R) Build Engine version 15.1.458.808
Copyright (C) Microsoft Corporation. All rights reserved.
under dotnet: 1.0.0-preview5-004275
which is latest currently.
Check the README in the dev branch. If you're still having issues, open up a new issue as 1.0 is unrelated to this issue.
Stale issue, closing
The bot works very well on my Windows machine, but when I tried to migrate it to a Linux server, it built fine, but when I start it, I get the following exception:
You can find source code of the bot here: https://github.com/mzabsky/webdrafter/tree/master/bot/PlaneSculptorsDiscordBot