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

Error on Startup #2

Closed
ErikFeeley opened this issue Jul 11, 2019 · 33 comments
Closed

Error on Startup #2

ErikFeeley opened this issue Jul 11, 2019 · 33 comments

Comments

@ErikFeeley
Copy link

ErikFeeley commented Jul 11, 2019

CocInfo

`## versions

vim version: NVIM v0.4.0-1256-g564d415d2
node version: v11.15.0
coc.nvim version: 0.0.72-22daa03a7d
term: xterm-kitty
platform: linux

Messages

[coc.nvim] error: UnhandledRejection: Command "/home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/OmniSharp" of cs is not executable: Error: not found: /home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/OmniSharp
Error: Command "/home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/OmniSharp" of cs is not executable: Error: not found: /home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/OmniSharp
at LanguageClient.createMessageTransports (/home/erik/.local/share/nvim/plugged/coc.nvim/build/index.js:65458:23)

Output channel: prettier

Output channel: highlight

[Info - 9:14:05 AM] Highlight server running in node v11.15.0

Output channel: cs

[Error - 9:14:13 AM] Starting client failed:
Error: Command "/home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/OmniSharp" of cs is not executable: Error: not found: /home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/OmniSharp
at LanguageClient.createMessageTransports (/home/erik/.local/share/nvim/plugged/coc.nvim/build/index.js:65458:23)`

Steps taken.

  1. Open neovim at project solution root
  2. Open up a cs file in a project that is part of the solution

At first I thought it was a conflict due to not disabling the omnisharp server startup from vim-omnisharp. But I got the same error when configuring that to not start up its omnisharp server.

@yatli
Copy link
Member

yatli commented Jul 12, 2019

thanks,, I should chmod the unzipped executable

@zlianon
Copy link

zlianon commented Jul 13, 2019

@yatli OmniSharp.exe only exist. OmniSharp.exe must be executed via mono or via run script

@yatli
Copy link
Member

yatli commented Jul 13, 2019

you mean, for Linux it's not a self-contained dotnet application?

@yatli
Copy link
Member

yatli commented Jul 13, 2019

please try v0.0.3

@zlianon
Copy link

zlianon commented Jul 14, 2019

@yatli now get new error: [coc.nvim] error: UnhandledRejection: Command "mono" of cs is not executable: Error: not found: mono

Mono is located in omnisharp/bin folder, start from there, and yes, first chmod

@zlianon
Copy link

zlianon commented Jul 14, 2019

@yatli this line: https://github.com/yatli/coc-omnisharp/blob/master/src/client/platform.ts#L76

change to: const omnisharpDirectory = path.join(__dirname, "..", "..", "omnisharp/omnisharp")

and, mono must be installed manually via https://www.mono-project.com/download/stable/

after this changes, i don't get any errors, but completion is week, i don't get completions for class methods, attributes, namespaces...

@yatli
Copy link
Member

yatli commented Jul 14, 2019

@mihaelartz do you have dotnet installed? Maybe it will start the entry assembly just fine.

@yatli
Copy link
Member

yatli commented Jul 14, 2019

I guess I have to stop blind editing, and try to repro this problem

@yatli
Copy link
Member

yatli commented Jul 14, 2019

@mihaelartz what's the error when you try to run with the supplied mono?

@zlianon
Copy link

zlianon commented Jul 14, 2019

do you have dotnet installed? Maybe it will start the entry assembly just fine.

Yes, i have installed dotnet.

what's the error when you try to run with the supplied mono?

Command "mono" of cs is not executable: Error: not found: mono

OmniSharp.exe is located in: path.join(__dirname, "..", "..", "omnisharp/omnisharp")
mono is located in: path.join(__dirname, "..", "..", "omnisharp/bin") (but i recommend to install mono manually)

I think, best is to run OmniSharp via "run" script (linux)

@yatli
Copy link
Member

yatli commented Jul 14, 2019

pushed 0.0.4, please have a try.
It chmod & execute the script run.
I've tested on WSL and it works for me here.

@zlianon
Copy link

zlianon commented Jul 14, 2019

@yatli see my pull request

With 0.0.4 i get new error:
Error: Command "/home/zlianon/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/omnisharp/OmniSharp.exe" of cs is not executable: Error: not found: /home/zlianon/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/omnisharp/OmniSharp.exe
at LanguageClient.createMessageTransports (/home/zlianon/.config/nvim/plugged/coc.nvim/lib/language-client/index.js:348:23)

@yatli
Copy link
Member

yatli commented Jul 14, 2019

sorry for the trouble, some dumb mistakes..
please try 0.0.5

@yatli
Copy link
Member

yatli commented Jul 14, 2019

chmod timing is incorrect.
pushed 0.0.6

@zlianon
Copy link

zlianon commented Jul 14, 2019

@yatli i don't get any errors, but completion is very, very week

@zlianon
Copy link

zlianon commented Jul 14, 2019

2019-07-14-131552_1680x1050_scrot
2019-07-14-131554_1680x1050_scrot
2019-07-14-131611_1680x1050_scrot

@yatli
Copy link
Member

yatli commented Jul 14, 2019

Yeah, it doesn't look like Omnisharp is helping a lot here

@yatli
Copy link
Member

yatli commented Jul 14, 2019

I got some exceptions in the log:

[Info  - 7:22:48 PM] Converting params for Request (1) textDocument/documentSymbol to OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentSymbolParams
[Error  - 7:22:48 PM] Failed to handle notification textDocument/documentSymbol - System.NullReferenceException: Object reference not set to an instance of an object
  at OmniSharp.LanguageServerProtocol.Handlers.DocumentSymbolHandler.Handle (OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentSymbolParams request, System.Threading.CancellationToken token) [0x00096] in <f545fd1de73a4d3082979fdff3bd0923>:0 
  at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline`2[TRequest,TResponse].Handle (TRequest request, System.Threading.CancellationToken cancellationToken, OmniSharp.Extensions.Embedded.MediatR.RequestHandlerDelegate`1[TResponse] next) [0x000e1] in <cdcdd2bceac34772b5fb2962192e6b77>:0 
  at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.RouteRequest (OmniSharp.Extensions.JsonRpc.IHandlerDescriptor descriptor, OmniSharp.Extensions.JsonRpc.Server.Request request) [0x002e2] in <cdcdd2bceac34772b5fb2962192e6b77>:0 
[Info  - 7:22:48 PM] Finished: Routing Request (1) textDocument/documentSymbol in 16ms
[Error  - 7:22:48 PM] Request textDocument/documentSymbol failed.
  Message: Internal Error - System.NullReferenceException: Object reference not set to an instance of an object
  at OmniSharp.LanguageServerProtocol.Handlers.DocumentSymbolHandler.Handle (OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentSymbolParams request, System.Threading.CancellationToken token) [0x00096] in <f545fd1de73a4d3082979fdff3bd0923>:0 
  at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline`2[TRequest,TResponse].Handle (TRequest request, System.Threading.CancellationToken cancellationToken, OmniSharp.Extensions.Embedded.MediatR.RequestHandlerDelegate`1[TResponse] next) [0x000e1] in <cdcdd2bceac34772b5fb2962192e6b77>:0 
  at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.RouteRequest (OmniSharp.Extensions.JsonRpc.IHandlerDescriptor descriptor, OmniSharp.Extensions.JsonRpc.Server.Request request) [0x002e2] in <cdcdd2bceac34772b5fb2962192e6b77>:0 
  Code: -32602 

@yatli
Copy link
Member

yatli commented Jul 14, 2019

CodeLens works, find reference works

@yatli
Copy link
Member

yatli commented Jul 14, 2019

hmm, autocompletion started to work after some time:

image

@yatli
Copy link
Member

yatli commented Jul 14, 2019

well, not really. it's giving me wrong entries:

image

@yatli
Copy link
Member

yatli commented Jul 14, 2019

Note, in the first screenshot the completion is correct, but the second one (Console) still displays the Global members.

@yatli
Copy link
Member

yatli commented Jul 14, 2019

@mihaelartz on Windows I had better luck with NetFX projects -- could you try change the target framework to something like net46?

@zlianon
Copy link

zlianon commented Jul 14, 2019

@yatli I do not know how to help, i'm new in .NET, I almost start to learn C#. In fact, I'm a Back-End Developer.

It would be good if omnisharp-vscode i adapt for coc.nvim (at least basic things).

@yatli
Copy link
Member

yatli commented Jul 14, 2019

@mihaelartz don't worry. You're helping a lot by testing it out :)

Please try 0.0.7 -- I've added an option to specify how to start omnisharp -- defaults to dotnet -- make sure you have dotnet core installed.

@ErikFeeley
Copy link
Author

Hello @yatli I have just updated to 0.0.7 to give it another go!

I have a new issue now.

## versions

vim version: NVIM v0.4.0-1280-g47d53d66b
node version: v11.15.0
coc.nvim version: 0.0.73-226801ef28
term: xterm-kitty
platform: linux

## Messages

## Output channel: prettier


## Output channel: highlight

[Info  - 9:49:37 AM] Highlight server running in node v11.15.0

## Output channel: cs

A fatal error was encountered. The library 'libhostpolicy.so' required to execute the application was not found in '/home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/omnisharp/'.
Failed to run as a self-contained app. If this should be a framework-dependent app, add the /home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/omnisharp/OmniSharp.runtimeconfig.json file specifying the appropriate framework.
[Error  - 9:49:39 AM] dotnet exited with code: 131
[Info  - 9:49:39 AM] Connection to server got closed. Server will restart.
A fatal error was encountered. The library 'libhostpolicy.so' required to execute the application was not found in '/home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/omnisharp/'.
Failed to run as a self-contained app. If this should be a framework-dependent app, add the /home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/omnisharp/OmniSharp.runtimeconfig.json file specifying the appropriate framework.
[Error  - 9:49:39 AM] dotnet exited with code: 131
[Info  - 9:49:39 AM] Connection to server got closed. Server will restart.
A fatal error was encountered. The library 'libhostpolicy.so' required to execute the application was not found in '/home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/omnisharp/'.
Failed to run as a self-contained app. If this should be a framework-dependent app, add the /home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/omnisharp/OmniSharp.runtimeconfig.json file specifying the appropriate framework.
[Error  - 9:49:39 AM] dotnet exited with code: 131
[Info  - 9:49:39 AM] Connection to server got closed. Server will restart.
A fatal error was encountered. The library 'libhostpolicy.so' required to execute the application was not found in '/home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/omnisharp/'.
Failed to run as a self-contained app. If this should be a framework-dependent app, add the /home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/omnisharp/OmniSharp.runtimeconfig.json file specifying the appropriate framework.
[Error  - 9:49:39 AM] dotnet exited with code: 131
[Info  - 9:49:39 AM] Connection to server got closed. Server will restart.
A fatal error was encountered. The library 'libhostpolicy.so' required to execute the application was not found in '/home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/omnisharp/'.
Failed to run as a self-contained app. If this should be a framework-dependent app, add the /home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/omnisharp/OmniSharp.runtimeconfig.json file specifying the appropriate framework.
[Error  - 9:49:39 AM] Connection to server got closed. Server will not be restarted.
[Error  - 9:49:39 AM] dotnet exited with code: 131

And my output from dotnet --info

.NET Core SDK (reflecting any global.json):
 Version:   2.2.105
 Commit:    7cecb35b92

Runtime Environment:
 OS Name:     manjaro
 OS Version:  
 OS Platform: Linux
 RID:         arch-x64
 Base Path:   /opt/dotnet/sdk/2.2.105/

Host (useful for support):
  Version: 2.2.3
  Commit:  6b8ad509b6

.NET Core SDKs installed:
  2.2.105 [/opt/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.NETCore.App 2.2.3 [/opt/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

I am not using a global.json.

@Philipp-M
Copy link
Contributor

I've got the same error as @ErikFeeley.

dotnet --info gives the same with the exception of OS name: arch:

Maybe something arch related (as manjaro is based on arch)?

@Admicos
Copy link

Admicos commented Jul 20, 2019

Same issue, on Arch

admicos ~ $ dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   2.2.108
 Commit:    33ed5b90ce

Runtime Environment:
 OS Name:     arch
 OS Version:
 OS Platform: Linux
 RID:         arch-x64
 Base Path:   /opt/dotnet/sdk/2.2.108/

Host (useful for support):
  Version: 2.2.6
  Commit:  7dac9b1b51

.NET Core SDKs installed:
  2.2.108 [/opt/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.NETCore.App 2.2.6 [/opt/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

I was able to get to a different error by copying a runtimeconfig.json file from a hello world project's bin:

admicos ~/src/asd/bin/Debug/netcoreapp2.2 $ cp asd.runtimeconfig.json ~/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/omnisharp/OmniSharp.runtimeconfig.json

the second error is:

System.IO.FileNotFoundException: Could not load file or assembly 'System.Security.Permissions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.

Edit: Launching OmniSharp.exe with mono from the command line doesn't show any errors, so maybe try that?

Edit 2: setting "omnisharp.useDotnet": false, in :CocConfig works... Somewhat...

@yatli
Copy link
Member

yatli commented Jul 31, 2019

@ErikFeeley @Philipp-M @Admicos @m5ome could you try 0.0.9? fixed some major problems. It's running snappy for me now :)

@ErikFeeley
Copy link
Author

@yatli Definite improvement! I still have some local conflicts going on since I still have vim-omnisharp going on at the same time. But im definitely getting snappy completion from the language server!

@svermeulen
Copy link

svermeulen commented Aug 3, 2019

Just chiming in to say that I've been trying to get it to work on macOS and having similar issues. No errors but doesn't seem to help with suggestions at all after installing. But when I set "useDotnet" to true, it helps a lot, but still gives me a lot of incorrect suggestions (looks like from the Global scope?). I also noticed that if I force a write (:w<cr>) then try to open the suggestions again it works a lot better and shows the member functions correctly (but obviously that's not practical to do every time)

@yatli
Copy link
Member

yatli commented Aug 4, 2019

hi @svermeulen !
currently useDotnet is not yet ready -- dotnet is not aware that Omnisharp is built as a self-contained app with all the dependencies, and will fail to look them up.
When that happens, coc-omnisharp will appear to fail to start the language server, and effectively disabled.

I guess you have other completion plugins installed? If so, what you're seeing is the behavior of the other plugin.

@yatli
Copy link
Member

yatli commented Mar 19, 2020

closing for now.

@yatli yatli closed this as completed Mar 19, 2020
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

6 participants