Skip to content

OmniSharp fails on load but can be started via LspStart #1974

Open
@mrt181

Description

@mrt181

cross posted here: neovim/nvim-lspconfig#3906

I've searched open issues for similar requests

  • Yes

I've manually reviewed logs to find potential errors

  • Yes

I've recently downloaded the latest plugin version of mason.nvim

  • Yes

Problem description

After a machine failure I am reinstalling NeoVim, LazyVim.

I added omnisharp via Mason.

When I open a cs file I get this warning:

   Warn  12:36:17 notify.warn ...m/3834/usr/share/nvim/runtime/lua/vim/lsp/_transport.lua:68: Spawning language server with cmd: `{ "omnisharp", "-z", "--hostPID", "60960", "DotNet:enablePackageRestore=false", "--encoding", "utf-8", "--languageserver", "FormattingOptions:EnableEditorConfigSupport=true", "Sdk:IncludePrereleases=true" }` failed. The language server is either not installed, missing from PATH, or not executable.

The language server is installed in ~/.local/share/nvim/mason/packages/omnisharp and I do not have any further config related to omnisharp.

I have pinned mason at version 1.*.

I can start the language server manually and that works without any problem or message.

LspStart omnisharp

Expected behavior

language server starts without warnings, errors

Steps to reproduce

Install NeoVim
Install LazyVim
Install omnisharp via Mason
Open a c# project

Affected packages

omnisharp

Neovim version (>= 0.10.0)

NVIM v0.11.2
Build type: RelWithDebInfo
LuaJIT 2.1.1741730670

Operating system/version

Linux UN5CD50511M5 6.6.87.1-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Mon Apr 21 17:08:54 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Healthcheck

==============================================================================
mason:                                                                    8 ⚠️

mason.nvim ~
- ⚠️ WARNING mason.nvim version v1.11.0
  - ADVICE:
    - The latest version of mason.nvim is: v2.0.0
- ✅ OK PATH: prepend
- ✅ OK Providers: 
    mason.providers.registry-api
    mason.providers.client
- ✅ OK neovim version >= 0.7.0

mason.nvim [Registries] ~
- ✅ OK Registry `github.com/mason-org/mason-registry version: 2025-06-10-known-cymbal` is installed.

mason.nvim [Core utils] ~
- ✅ OK unzip: `UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP.`
- ✅ OK wget: `GNU Wget 1.21.4 built on linux-gnu.`
- ✅ OK curl: `curl 8.5.0 (x86_64-pc-linux-gnu) libcurl/8.5.0 OpenSSL/3.0.13 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.7 libpsl/0.21.2 (+libidn2/2.3.7) libssh/0.10.6/openssl/zlib nghttp2/1.59.0 librtmp/2.3 OpenLDAP/2.6.7`
- ✅ OK gzip: `gzip 1.12`
- ✅ OK tar: `tar (GNU tar) 1.35`
- ✅ OK bash: `GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu)`
- ✅ OK sh: `Ok`

mason.nvim [Languages] ~
- ⚠️ WARNING Go: not available
  - ADVICE:
    - spawn: go failed with exit code - and signal -. go is not executable
- ⚠️ WARNING Composer: not available
  - ADVICE:
    - spawn: composer failed with exit code - and signal -. composer is not executable
- ⚠️ WARNING PHP: not available
  - ADVICE:
    - spawn: php failed with exit code - and signal -. php is not executable
- ⚠️ WARNING Ruby: not available
  - ADVICE:
    - spawn: ruby failed with exit code - and signal -. ruby is not executable
- ⚠️ WARNING RubyGem: not available
  - ADVICE:
    - spawn: gem failed with exit code - and signal -. gem is not executable
- ✅ OK node: `v22.16.0`
- ✅ OK luarocks: `/usr/local/bin/luarocks 3.12.0`
- ⚠️ WARNING julia: not available
  - ADVICE:
    - spawn: julia failed with exit code - and signal -. julia is not executable
- ✅ OK python: `Python 3.12.3`
- ✅ OK java: `openjdk version "21.0.7" 2025-04-15`
- ✅ OK cargo: `cargo 1.87.0 (99624be96 2025-05-06)`
- ✅ OK npm: `11.4.1`
- ⚠️ WARNING pip: not available
  - ADVICE:
    - spawn: python3 failed with exit code 1 and signal 0. /usr/bin/python3: No module named pip

- ✅ OK python venv: `Ok`
- ✅ OK javac: `javac 21.0.7`

mason.nvim [GitHub] ~
- ✅ OK GitHub API rate limit. Used: 0. Remaining: 60. Limit: 60. Reset: Tue Jun 10 14:23:33 2025.
  Install and authenticate via gh-cli to increase rate limit.

Screenshots or recordings

Image

once started I get this message

Image

LSP is not working when searching using gr

Image

Starting lsp manually

Image

and for example searching via gr starts working.

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions