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

Bundled OmniSharp server crashes on startup, can't find System.Net.HttpListener #2383

Closed
11 tasks done
OskarSigvardsson opened this issue Oct 12, 2016 · 5 comments
Closed
11 tasks done

Comments

@OskarSigvardsson
Copy link

OskarSigvardsson commented Oct 12, 2016

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside
the brackets) before filing your issue:

  • I have read and understood YCM's [CONTRIBUTING][cont] document.
  • I have read and understood YCM's [CODE_OF_CONDUCT][code] document.
  • I have read and understood YCM's [README][readme], especially the
    [Frequently Asked Questions][faq] section.
  • I have searched YCM's issue tracker to find issues similar to the one I'm
    about to report and couldn't find an answer to my problem. ([Example Google
    search.][search])
  • If filing a bug report, I have included the output of vim --version.
  • If filing a bug report, I have included the output of :YcmDebugInfo.
  • If filing a bug report, I have included the output of
    :YcmToggleLogs stderr.
  • If filing a bug report, I have included which OS (including specific OS
    version) I am using.
  • If filing a bug report, I have included a minimal test case that reproduces
    my issue.
  • I understand this is an open-source project staffed by volunteers and
    that any help I receive is a selfless, heartfelt gift of their free time. I
    know I am not entitled to anything and will be polite and courteous.
  • I understand my issue may be closed if it becomes obvious I didn't
    actually perform all of these steps.

Thank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.

Issue Details

I am on macOS Sierra, and this is my vim --version: https://gist.github.com/26608c1c5d72752cae38c1afabf1a7c8

This is my .vimrc: https://github.com/OskarSigvardsson/dotfiles/blob/master/vim/vimrc.home (the YCM settings are on line 301 and on)

I'm a Unity C# developer, using YouCompleteMe for C#. After a recent update, i noticed that YCM asked me to recompile the server component, so i went into ~/.vim/bundle/YouCompleteMe and ran ./install.py --all (i do occasionally like to develop in other languages ;) ). The compilation process finished without errors.

When I started Vim again I got an error message when trying to autocomplete:

ConnectionError: HTTPConnectionPool(host='localhost', port=62512): Max retries exceeded with url: /autocomplete (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x102447c50>: Failed to establish a new connection: [Errno 61] Connection refused',))

I check YcmDebugInfo, which reports this:

Printing YouCompleteMe debug information...
-- Server has Clang support compiled in: True
-- Clang version: clang version 3.9.0 (tags/RELEASE_390/final)
-- C# completer debug information:
--   OmniSharp no longer running
--   OmniSharp executable: /Users/oskarsigvardsson/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/OmniSharp/bin/Release/OmniSharp.exe
--   OmniSharp logfiles:
--     /var/folders/0g/gc8vrlp55zq39_f16y2ppk8w0000gp/T/ycm_temp/omnisharp_62512_gro-family.sln_stdout.log
--     /var/folders/0g/gc8vrlp55zq39_f16y2ppk8w0000gp/T/ycm_temp/omnisharp_62512_gro-family.sln_stderr.log
--   OmniSharp solution: /Users/oskarsigvardsson/gro-play/gro-family/gro-family.sln
-- Server running at: http://127.0.0.1:62504
-- Server process ID: 52388
-- Server logfiles:
--   /var/folders/0g/gc8vrlp55zq39_f16y2ppk8w0000gp/T/ycm_temp/server_62504_stdout.log
--   /var/folders/0g/gc8vrlp55zq39_f16y2ppk8w0000gp/T/ycm_temp/server_62504_stderr.log

I check the OmniSharp stderr logfile, and it reports the following:

Unhandled Exception:
System.TypeLoadException: Could not load type 'System.Net.HttpListener' from assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
  at Nancy.Hosting.Self.NancyHost.StartListener () [0x00000] in <fa01803f5acc48669715852a0f5486ed>:0
  at Nancy.Hosting.Self.NancyHost.Start () [0x00000] in <fa01803f5acc48669715852a0f5486ed>:0
  at OmniSharp.Program.StartServer (System.String solutionPath, System.String clientPathMode, System.Int32 port, OmniSharp.Verbosity verbosity, System.String configLocation, System.Int32 hostPID) [0x000a4] in <e114fab593aa4834a8da0c87ff791d0b>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'System.Net.HttpListener' from assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
  at Nancy.Hosting.Self.NancyHost.StartListener () [0x00000] in <fa01803f5acc48669715852a0f5486ed>:0
  at Nancy.Hosting.Self.NancyHost.Start () [0x00000] in <fa01803f5acc48669715852a0f5486ed>:0
  at OmniSharp.Program.StartServer (System.String solutionPath, System.String clientPathMode, System.Int32 port, OmniSharp.Verbosity verbosity, System.String configLocation, System.Int32 hostPID) [0x000a4] in <e114fab593aa4834a8da0c87ff791d0b>:0

I don't know if I should be reporting this here or at OmniSharp, but I'll start here. I don't know why OmniSharp can't load HttpListener, or why this is happening in general. It's worked fine until just now.

I run regular old OmniSharp alongside YouCompleteMe for Syntastic support and various useful functionality ("GoToDefinition", "FindUsages", etc.), but YCM is running the OmniSharp server it comes with (that's built during the ./install.py --all process, right?). Regular OmniSharp works fine.

I'm updated to the latest version of YouCompleteMe, and I've tried rebuilding it again. Same error.

Also, since this is the first time I'm contacting the developers, I'd just like to say: YCM is the greatest thing ever. You make life so much easier. Good work.

@OskarSigvardsson
Copy link
Author

Any progress on this?

In the mean-time, is there any way to force YCM to use omnifunc for completion instead of the built in OmniSharp engine for C#? This problem has made YCM unusable for me, and I've had to turn it off in favour of OmniSharp's omnifunc completion + supertab, but it's not nearly as good as YCM when it works.

@micbou
Copy link
Collaborator

micbou commented Oct 17, 2016

Sorry for the late answer.

This issue has been reported on the OmniSharp Server repository. Unfortunately, the project is not maintained anymore and is replaced by OmniSharp Roslyn so the issue is unlikely to be fixed. @mispencer is working on adding OmniSharp Roslyn support to YCM (see PR ycm-core/ycmd#213). Until we adopt OmniSharp Roslyn, we may consider using a fork of the OmniSharp Server repository with the proper fix. However, I have no idea on how to fix this as I am not a C# user so help is welcome here.

As a temporary workaround, according to this post on SO, you could downgrade mono to 4.2.4.4.

@OskarSigvardsson
Copy link
Author

Ok! Thanks for the information and research, I understand that it's very difficult to fix when you have to rely on an external project. I'll see what I can do myself.

@puremourning
Copy link
Member

I think we can close this as it is not a YCM issue but an omnisharp issue.

@micbou
Copy link
Collaborator

micbou commented Mar 23, 2017

See #2530 (comment).

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants