The OmniSharp-Roslyn HTTP (v1.32.2) server is refusing all HTTP connections.
The problem seems to have occurred between v1.32.1 and v1.32.2.
This issue has been reported to occur on these devices:
It does not occur on the Windows versions of the builds.
This was run with the -v flag, the previous version of the server printed thousands of lines of debug: data, whereas v1.32.2 did not.
Click to view output.
[axvr@arctic Redacted.Auth master]$ ~/.omnisharp/omnisharp-roslyn/run -v -p 4242 -s "$(pwd)/Redacted.Auth.sln"
info: OmniSharp.Http.Startup[0]
Starting OmniSharp on fedora 28.0 (x64)
info: OmniSharp.Cake.CakeProjectSystem[0]
Detecting Cake files in '/home/axvr/Documents/Projects/work/Redacted/Redacted.Auth'.
info: OmniSharp.Cake.CakeProjectSystem[0]
Could not find any Cake files
info: OmniSharp.Http.Startup[0]
Project system 'OmniSharp.DotNet.DotNetProjectSystem' is disabled in the configuration.
info: OmniSharp.MSBuild.ProjectSystem[0]
Detecting projects in '/home/axvr/Documents/Projects/work/Redacted/Redacted.Auth/Redacted.Auth.sln'.
info: OmniSharp.MSBuild.ProjectManager[0]
Queue project update for '/home/axvr/Documents/Projects/work/Redacted/Redacted.Auth/Redacted.Auth.Api/Redacted.Auth.Api.csproj'
info: OmniSharp.MSBuild.ProjectManager[0]
Queue project update for '/home/axvr/Documents/Projects/work/Redacted/Redacted.Auth/Redacted.Auth.Logic/Redacted.Auth.Logic.csproj'
info: OmniSharp.MSBuild.ProjectManager[0]
Queue project update for '/home/axvr/Documents/Projects/work/Redacted/Redacted.Auth/Redacted.Auth.Tests/Redacted.Auth.Tests.csproj'
info: OmniSharp.Script.ScriptProjectSystem[0]
Detecting CSX files in '/home/axvr/Documents/Projects/work/Redacted/Redacted.Auth'.
info: OmniSharp.Script.ScriptProjectSystem[0]
Could not find any CSX files
info: OmniSharp.Http.Startup[0]
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
info: OmniSharp.Http.Startup[0]
Configuration finished.
info: OmniSharp.Http.Startup[0]
Omnisharp server running on port '4242' at location '/home/axvr/Documents/Projects/work/Redacted/Redacted.Auth' on host -1.
info: OmniSharp.MSBuild.ProjectManager[0]
Loading project: /home/axvr/Documents/Projects/work/Redacted/Redacted.Auth/Redacted.Auth.Api/Redacted.Auth.Api.csproj
info: OmniSharp.MSBuild.ProjectManager[0]
Successfully loaded project file '/home/axvr/Documents/Projects/work/Redacted/Redacted.Auth/Redacted.Auth.Api/Redacted.Auth.Api.csproj'.
info: OmniSharp.MSBuild.ProjectManager[0]
Adding project '/home/axvr/Documents/Projects/work/Redacted/Redacted.Auth/Redacted.Auth.Api/Redacted.Auth.Api.csproj'
info: OmniSharp.MSBuild.ProjectManager[0]
Loading project: /home/axvr/Documents/Projects/work/Redacted/Redacted.Auth/Redacted.Auth.Logic/Redacted.Auth.Logic.csproj
info: OmniSharp.MSBuild.ProjectManager[0]
Successfully loaded project file '/home/axvr/Documents/Projects/work/Redacted/Redacted.Auth/Redacted.Auth.Logic/Redacted.Auth.Logic.csproj'.
info: OmniSharp.MSBuild.ProjectManager[0]
Adding project '/home/axvr/Documents/Projects/work/Redacted/Redacted.Auth/Redacted.Auth.Logic/Redacted.Auth.Logic.csproj'
info: OmniSharp.MSBuild.ProjectManager[0]
Loading project: /home/axvr/Documents/Projects/work/Redacted/Redacted.Auth/Redacted.Auth.Tests/Redacted.Auth.Tests.csproj
info: OmniSharp.MSBuild.ProjectManager[0]
Successfully loaded project file '/home/axvr/Documents/Projects/work/Redacted/Redacted.Auth/Redacted.Auth.Tests/Redacted.Auth.Tests.csproj'.
info: OmniSharp.MSBuild.ProjectManager[0]
Adding project '/home/axvr/Documents/Projects/work/Redacted/Redacted.Auth/Redacted.Auth.Tests/Redacted.Auth.Tests.csproj'
info: OmniSharp.MSBuild.ProjectManager[0]
Update project: Redacted.Auth.Api
info: OmniSharp.MSBuild.ProjectManager[0]
Update project: Redacted.Auth.Logic
info: OmniSharp.MSBuild.ProjectManager[0]
Update project: Redacted.Auth.Tests
OmniSharp-vim is unable to connect to v1.32.2 of the OmniSharp-Roslyn server, this is the error log produced.
NOTE: This does not seem to be an issue with OmniSharp-vim.
Click to view output.
2018-08-21 19:25:22,649 ERROR Could not connect to OmniSharp server: http://localhost:43993/v2/getcodeactions
Traceback (most recent call last):
File "/home/axvr/Documents/Projects/dotfiles/vim/.vim/pack/vivid/opt/omnisharp-vim/python/omnisharp/util.py", line 214, in doRequest
response = opener.open(req, body, timeout)
File "/usr/lib64/python2.7/urllib2.py", line 429, in open
response = self._open(req, data)
File "/usr/lib64/python2.7/urllib2.py", line 447, in _open
'_open', req)
File "/usr/lib64/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/usr/lib64/python2.7/urllib2.py", line 1230, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib64/python2.7/urllib2.py", line 1200, in do_open
raise URLError(err)
URLError:
2018-08-21 19:25:22,649 ERROR Error running python getCodeActions()
Traceback (most recent call last):
File "/home/axvr/Documents/Projects/dotfiles/vim/.vim/pack/vivid/opt/omnisharp-vim/python/omnisharp/vimcmd.py", line 25, in wrapper
ret = fxn(*args, **kwargs)
File "/home/axvr/Documents/Projects/dotfiles/vim/.vim/pack/vivid/opt/omnisharp-vim/python/omnisharp/commands.py", line 108, in getCodeActions
response = getResponse(ctx, '/v2/getcodeactions', parameters, json=True)
File "/home/axvr/Documents/Projects/dotfiles/vim/.vim/pack/vivid/opt/omnisharp-vim/python/omnisharp/util.py", line 195, in getResponse
json=json)
File "/home/axvr/Documents/Projects/dotfiles/vim/.vim/pack/vivid/opt/omnisharp-vim/python/omnisharp/util.py", line 218, in doRequest
raise ServerConnectionError(str(e))
ServerConnectionError:
2018-08-21 19:25:22,651 ERROR Could not connect to OmniSharp server: http://localhost:43993/v2/getcodeactions
Traceback (most recent call last):
File "/home/axvr/Documents/Projects/dotfiles/vim/.vim/pack/vivid/opt/omnisharp-vim/python/omnisharp/util.py", line 214, in doRequest
response = opener.open(req, body, timeout)
File "/usr/lib64/python2.7/urllib2.py", line 429, in open
response = self._open(req, data)
File "/usr/lib64/python2.7/urllib2.py", line 447, in _open
'_open', req)
File "/usr/lib64/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/usr/lib64/python2.7/urllib2.py", line 1230, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib64/python2.7/urllib2.py", line 1200, in do_open
raise URLError(err)
URLError:
2018-08-21 19:25:22,651 ERROR Error running python getCodeActions()
Traceback (most recent call last):
File "/home/axvr/Documents/Projects/dotfiles/vim/.vim/pack/vivid/opt/omnisharp-vim/python/omnisharp/vimcmd.py", line 25, in wrapper
ret = fxn(*args, **kwargs)
File "/home/axvr/Documents/Projects/dotfiles/vim/.vim/pack/vivid/opt/omnisharp-vim/python/omnisharp/commands.py", line 108, in getCodeActions
response = getResponse(ctx, '/v2/getcodeactions', parameters, json=True)
File "/home/axvr/Documents/Projects/dotfiles/vim/.vim/pack/vivid/opt/omnisharp-vim/python/omnisharp/util.py", line 195, in getResponse
json=json)
File "/home/axvr/Documents/Projects/dotfiles/vim/.vim/pack/vivid/opt/omnisharp-vim/python/omnisharp/util.py", line 218, in doRequest
raise ServerConnectionError(str(e))
ServerConnectionError:
2018-08-21 19:25:31,844 ERROR Could not connect to OmniSharp server: http://localhost:43993/updatebuffer
Traceback (most recent call last):
File "/home/axvr/Documents/Projects/dotfiles/vim/.vim/pack/vivid/opt/omnisharp-vim/python/omnisharp/util.py", line 214, in doRequest
response = opener.open(req, body, timeout)
File "/usr/lib64/python2.7/urllib2.py", line 429, in open
response = self._open(req, data)
File "/usr/lib64/python2.7/urllib2.py", line 447, in _open
'_open', req)
File "/usr/lib64/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/usr/lib64/python2.7/urllib2.py", line 1230, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib64/python2.7/urllib2.py", line 1203, in do_open
r = h.getresponse(buffering=True)
File "/usr/lib64/python2.7/httplib.py", line 1121, in getresponse
response.begin()
File "/usr/lib64/python2.7/httplib.py", line 438, in begin
version, status, reason = self._read_status()
File "/usr/lib64/python2.7/httplib.py", line 402, in _read_status
raise BadStatusLine(line)
BadStatusLine: ''
2018-08-21 19:25:31,845 ERROR Error running python updateBuffer()
Traceback (most recent call last):
File "/home/axvr/Documents/Projects/dotfiles/vim/.vim/pack/vivid/opt/omnisharp-vim/python/omnisharp/vimcmd.py", line 25, in wrapper
ret = fxn(*args, **kwargs)
File "/home/axvr/Documents/Projects/dotfiles/vim/.vim/pack/vivid/opt/omnisharp-vim/python/omnisharp/commands.py", line 254, in updateBuffer
getResponse(ctx, "/updatebuffer")
File "/home/axvr/Documents/Projects/dotfiles/vim/.vim/pack/vivid/opt/omnisharp-vim/python/omnisharp/util.py", line 195, in getResponse
json=json)
File "/home/axvr/Documents/Projects/dotfiles/vim/.vim/pack/vivid/opt/omnisharp-vim/python/omnisharp/util.py", line 218, in doRequest
raise ServerConnectionError(str(e))
ServerConnectionError: ''
Obviously you aren't meant to use OmniSharp from a web browser, but the responses do highlight a difference between the two versions of the server.
A blank web page is displayed and the server prints some connection info to STDOUT.
Nothing is printed to STDOUT, but the browser displays this error message:

If any more information is needed, please let me know. :smile:
Edit: Add more affected systems.
I had been meaning to try to debug this, or at least bisect to find the exact commit that causes problems, but I ran into the issue of not being able to build OmniSharp-roslyn on my archlinux machines. After some fiddling with GitVersion and making a couple of changes to build.cake I did manage to get builds working - described in #1202
However ... my build of the latest version works in vim! And so does a build of git checkout tags/v1.32.5 -b v1.32.5 and git checkout tags/v1.32.2 -b v1.32.2. But downloading those releases from omnisharp-roslyn/releases does _not_ work.
So as far as I can tell at this stage, the problem has something to do with the actual compiled releases, not the code itself?
@nickspoons this is on archlinux? That's really odd... everything shipped with the releases is built on Travis and shipped from there. Is there something about them being built on an ubuntu system that might cause issues?
@david-driscoll the issue is occurring on all *nix's, including Ubuntu, see the issue description.
I've experienced it in an archlinux VM, and an archlinux flavoured WSL.
Any update or progress on this?
I can confirm that manually building the latest source from git on Arch Linux (following @nickspoons modifications to the build scripts) results in a working build of the HTTP driver, whereas installing any compiled release after version 1.32.1 from here gives me a broken build that refuses connections.
$ mono --version
Mono JIT compiler version 5.16.0 (makepkg/6e48ad4f7b1 Mon Oct 15 22:56:48 CEST 2018)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: supported, not enabled.
GC: sgen (concurrent by default)
$ dotnet --version
2.1.403
@nickspoons
Maybe Eureka.
At https://github.com/OmniSharp/omnisharp-vim/issues/427#issuecomment-445017252 you said me to use omnisharp-roslyn/bin/Debug/OmniSharp.Http.Driver/net461/OmniSharp.exe. You didn't say to me to use omnisharp-roslyn/artifacts/publish/OmniSharp.Http.Driver/mono/OmniSharp.exe. In fact, if you use the second one, it doesn't work.
If you install the last version of OmniSharp:
rm -Rf ~/.omnisharp
cd ~/Downloads
wget https://github.com/OmniSharp/omnisharp-roslyn/releases/download/v1.32.8/omnisharp.http-linux-x64.tar.gz
mkdir -p ~/.omnisharp/omnisharp-roslyn
tar -xvzf ~/Downloads/omnisharp.http-linux-x64.tar.gz -C ~/.omnisharp/omnisharp-roslyn
Thanks the command :
$ diff -rq omnisharp-roslyn/artifacts/publish/OmniSharp.Http.Driver/mono/ ~/.omnisharp/omnisharp-roslyn/omnisharp | grep "Only"
you could see that there is nothing diff between this two folders. Therefore, the folder used for the release is omnisharp-roslyn/artifacts/publish/OmniSharp.Http.Driver/mono/
$ diff -rq omnisharp-roslyn/bin/Debug/OmniSharp.Http.Driver/net461 ~/.omnisharp/omnisharp-roslyn/omnisharp | grep "Only"
Or
$ diff -rq omnisharp-roslyn/artifacts/publish/OmniSharp.Http.Driver/mono/ omnisharp-roslyn/bin/Debug/OmniSharp.Http.Driver/net461
you could see there are missing files in the published version, especially
(...)
Only in omnisharp-roslyn/bin/Debug/OmniSharp.Http.Driver/net461: System.AppContext.dll
Only in omnisharp-roslyn/bin/Debug/OmniSharp.Http.Driver/net461: System.ComponentModel.Primitives.dll
Only in omnisharp-roslyn/bin/Debug/OmniSharp.Http.Driver/net461: System.ComponentModel.TypeConverter.dll
Only in omnisharp-roslyn/bin/Debug/OmniSharp.Http.Driver/net461: System.Console.dll
Only in omnisharp-roslyn/bin/Debug/OmniSharp.Http.Driver/net461: System.IO.FileSystem.dll
Only in omnisharp-roslyn/bin/Debug/OmniSharp.Http.Driver/net461: System.IO.FileSystem.Primitives.dll
Only in omnisharp-roslyn/bin/Debug/OmniSharp.Http.Driver/net461: System.Numerics.Vectors.dll
Only in omnisharp-roslyn/bin/Debug/OmniSharp.Http.Driver/net461: System.Runtime.InteropServices.RuntimeInformation.dll
Only in omnisharp-roslyn/bin/Debug/OmniSharp.Http.Driver/net461: System.Security.Cryptography.Encoding.dll
Only in omnisharp-roslyn/bin/Debug/OmniSharp.Http.Driver/net461: System.Security.Cryptography.Primitives.dll
Only in omnisharp-roslyn/bin/Debug/OmniSharp.Http.Driver/net461: System.Security.Cryptography.X509Certificates.dll
Only in omnisharp-roslyn/bin/Debug/OmniSharp.Http.Driver/net461: System.Threading.Thread.dll
(...)
$ cp -n omnisharp-roslyn/bin/Debug/OmniSharp.Http.Driver/net461/* ~/.omnisharp/omnisharp-roslyn/omnisharp
You could see that the released version works ! (cp -n copy only files quoted above, without overwriting (updating) any existing file).
Therefore, why in omnisharp-roslyn/artifacts/publish/OmniSharp.Http.Driver/mono, (the folder used to publish OmniSharp) this files are missing ? If you fix this problem, you will fix this issue.
I'm a student, therefore I'm very beginner in c#. Hard to me to find any solution. But I think it could be very simple to find a solution !
Eureka. It seems to delete in build.cake
void DeleteUnnecessaryAssemblies(string folder)
{
FileHelper.Delete(CombinePaths(folder, "System.AppContext.dll"));
FileHelper.Delete(CombinePaths(folder, "System.Numerics.Vectors.dll"));
FileHelper.Delete(CombinePaths(folder, "System.Runtime.InteropServices.RuntimeInformation.dll"));
FileHelper.Delete(CombinePaths(folder, "System.ComponentModel.Primitives.dll"));
FileHelper.Delete(CombinePaths(folder, "System.ComponentModel.TypeConverter.dll"));
FileHelper.Delete(CombinePaths(folder, "System.Console.dll"));
FileHelper.Delete(CombinePaths(folder, "System.IO.FileSystem.Primitives.dll"));
FileHelper.Delete(CombinePaths(folder, "System.IO.FileSystem.dll"));
FileHelper.Delete(CombinePaths(folder, "System.Security.Cryptography.Encoding.dll"));
FileHelper.Delete(CombinePaths(folder, "System.Security.Cryptography.Primitives.dll"));
FileHelper.Delete(CombinePaths(folder, "System.Security.Cryptography.X509Certificates.dll"));
FileHelper.Delete(CombinePaths(folder, "System.Threading.Thread.dll"));
}
I make a PR
Contrary to the hypothesis make above, the error is not caused by Travis. Therefore I have done a git bisect.
I've found:
b240da171358daeff827d9f7160379bb95c696b1 is the first bad commit
commit b240da171358daeff827d9f7160379bb95c696b1
Author: @david-driscoll
Date: Sat Jun 30 11:23:43 2018 -0400
Updated to latest msbuild / roslyn versions
I hope it will help to merge https://github.com/OmniSharp/omnisharp-roslyn/pull/1361 :-)
Any indications on when this issue may be fixed? OmniSharp is unusable for me on vim without this since I have projects referencing each other.
@satiani Even if this is fixed, will you still have confidence in a project that left Linux users high and dry for months on end?
@ohjames It's an open source project run by volunteers. If you can't make the time to help fix this issue, then at least avoid negative comments.
@satiani The issue has been fixed but nobody is listening. Just because people are volunteering their time doesn't make them immune to criticism. Had plenty of criticism on some of my own open source projects from time to time and when it's deserved I'm thankful that somebody booted me into action.
constructive criticism != cynicism
As @david-driscoll as merged #1361 (thanks :smile: ) this issue could be closed :smile:
@rchande @nickspoons maybe it could be cool to make a new release now for vim users ?
@JulioJu might as well wait for a release so we can test it, before closing this issue? (I don't have any control over releases, I'm just an OmniSharp-vim maintainer)
You can already test it by grabbing the pre-release using these instructions https://github.com/OmniSharp/omnisharp-roslyn#prerelease-versions
In this case, it would be the version 1.32.12-beta.51 or higher.
In the project, we have the approach that issues are closed as soon as the fix is merged (not when it's released). Feel free to open a new one (or reopen this one) when you still have problems with the prerelease - thanks!
Most helpful comment
@ohjames It's an open source project run by volunteers. If you can't make the time to help fix this issue, then at least avoid negative comments.