Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OmniSharp-Roslyn v1.32.2+ HTTP is refusing connections #1274

Closed
axvr opened this issue Aug 21, 2018 · 18 comments
Closed

OmniSharp-Roslyn v1.32.2+ HTTP is refusing connections #1274

axvr opened this issue Aug 21, 2018 · 18 comments

Comments

@axvr
Copy link

axvr commented Aug 21, 2018

The Problem

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.

Systems this occurs on

This issue has been reported to occur on these devices:

  • Fedora Linux 28 (OmniSharp-Roslyn HTTP Linux)
  • macOS High Sierra (OmniSharp-Roslyn HTTP OSX Mono)
  • Arch Linux (OmniSharp-Roslyn HTTP Linux)
  • Ubuntu 18.10 (OmniSharp-Roslyn HTTP Linux)

It does not occur on the Windows versions of the builds.

Running v1.32.2 of the server from the command line

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 log:

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: ''

Visiting the server in a web browser

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.

v.32.1

A blank web page is displayed and the server prints some connection info to STDOUT.

v.32.2

Nothing is printed to STDOUT, but the browser displays this error message:

image


If any more information is needed, please let me know. 😄


Edit: Add more affected systems.

@nickspoons
Copy link
Member

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 added a commit to OmniSharp/omnisharp-vim that referenced this issue Sep 16, 2018
Until OmniSharp/omnisharp-roslyn#1274 is
resolved, `:OmniSharpInstall` with no arguments will install version
v1.32.1

Closes #393, #410
@david-driscoll
Copy link
Member

@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?

@nickspoons
Copy link
Member

@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.

@SneWs
Copy link

SneWs commented Nov 2, 2018

Any update or progress on this?

@rudism
Copy link

rudism commented Nov 2, 2018

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

@JulioJu
Copy link
Contributor

JulioJu commented Dec 12, 2018

@nickspoons

Maybe Eureka.

  • At Issue with dotnet version 2.1.500 and later omnisharp-vim#427 (comment) 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/

  • But thanks:
$ 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
(...)
  • If you copy this files in the released version thanks the command
$ 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 !

@JulioJu
Copy link
Contributor

JulioJu commented Dec 12, 2018

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

@JulioJu
Copy link
Contributor

JulioJu commented Dec 16, 2018

Contrary to the hypothesis make above, the error is not caused by Travis. Therefore I have done a git bisect.

I've found:
b240da1 is the first bad commit
commit b240da1
Author: @david-driscoll
Date: Sat Jun 30 11:23:43 2018 -0400

Updated to latest msbuild / roslyn versions

@JulioJu
Copy link
Contributor

JulioJu commented Dec 16, 2018

I hope it will help to merge #1361 :-)

@axvr axvr changed the title OmniSharp-Roslyn v1.32.2 HTTP is refusing connections OmniSharp-Roslyn v1.32.2+ HTTP is refusing connections Dec 21, 2018
@satiani
Copy link

satiani commented Feb 28, 2019

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.

@insidewhy
Copy link
Contributor

@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?

@satiani
Copy link

satiani commented Mar 13, 2019

@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.

@insidewhy
Copy link
Contributor

@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.

@satiani
Copy link

satiani commented Mar 13, 2019

constructive criticism != cynicism

david-driscoll added a commit that referenced this issue Mar 19, 2019
@JulioJu
Copy link
Contributor

JulioJu commented Mar 19, 2019

As @david-driscoll as merged #1361 (thanks 😄 ) this issue could be closed 😄

@JulioJu
Copy link
Contributor

JulioJu commented Mar 19, 2019

@rchande @nickspoons maybe it could be cool to make a new release now for vim users ?

@nickspoons
Copy link
Member

@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)

@filipw
Copy link
Member

filipw commented Mar 19, 2019

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!

@filipw filipw closed this as completed Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants