omnisharp-sublime icon indicating copy to clipboard operation
omnisharp-sublime copied to clipboard

OmniSharp: Error talking to localhost

Open zshep427 opened this issue 6 years ago • 31 comments

Platform

  • [ ] Linux
  • [x] Windows
  • [ ] OSX

Type

  • [x] This is an issue
  • [ ] This is a feature request
  • [ ] Other

Checklist

  • [x] It hasn't been fixed in the latest master
  • [ ] I can reproduce this issue in a fresh Sublime Text install without other extensions

Versions

output of mono --version:

5.16.0.179

output of msbuild /version:


Details

This might be less of a bug and more of an issue with my setup. I was using the setup detailed here https://www.youtube.com/watch?v=z7na1MuMDRg and it was working up until about a week ago. I tried several different solutions I found for recent issues I found on the internet (reinstalling from scratch, doubling the time for connection timeout, updating Mono to latest, etc and it keeps failing). I was hoping my problem might just be something obvious I'm not seeing. Every time I launch ST I get the error:

"OmniSharp: Error talking to http://localhost:xxxxx/checkreadystatus"

Thanks in advance for your help! Hopefully it's something simple.

How-To

How do I reproduce this issue?

zshep427 avatar Oct 19 '18 08:10 zshep427

read the README, you need msbuild

Rosalie241 avatar Oct 19 '18 09:10 Rosalie241

@tim241 Installing msbuild did not resolve the issue, either.

zshep427 avatar Oct 21 '18 02:10 zshep427

is it included in your PATH then?

also, what msbuild version do you have?

It all states this clearly in the README

On 20.10 07:27, zshep427 wrote:

@tim241 Installing msbuild did not resolve the issue, either.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/OmniSharp/omnisharp-sublime/issues/250#issuecomment-431633626

Rosalie241 avatar Oct 21 '18 10:10 Rosalie241

I added this filepath to PATH: C:\Program Files (x86)\MSBuild\14.0\Bin

Is that correct? It's 2015, downloaded from here: https://www.microsoft.com/en-us/download/details.aspx?id=48159

Thanks for your help!

zshep427 avatar Oct 21 '18 22:10 zshep427

seems correct, does it work now or does it still not work?

Rosalie241 avatar Oct 21 '18 22:10 Rosalie241

Nope, still doesn't work. Still receiving the same "Error talking to localhost" when I launch Sublime and it attempts to start the server.

zshep427 avatar Oct 21 '18 22:10 zshep427

Can you try to execute omnisharp.cmd manually in cmd to see what it says then?

Rosalie241 avatar Oct 21 '18 23:10 Rosalie241

Says that omnisharp.cmd is not recognized as a command. Will I not have that if I installed OmniSharp via Package Control?

zshep427 avatar Oct 21 '18 23:10 zshep427

λ omnisharp.cmd
Application startup exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at OmniSharp.MSBuild.ProjectSystem..ctor(IOmniSharpEnvironment environment, OmniSharpWorkspace workspace, IMSBuildLocator msbuildLocator, IDotNetCliService dotNetCliService, SdksPathResolver sdksPathResolver, MetadataFileReferenceCache metadataFileReferenceCache, IEventEmitter eventEmitter, IFileSystemWatcher fileSystemWatcher, FileSystemHelper fileSystemHelper, ILoggerFactory loggerFactory, IEnumerable`1 eventSinks)
   at lambda_method(Closure , LifetimeContext , CompositionOperation )
   at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate(Int32 sharingId, CompositionOperation operation, CompositeActivator creator)
   at System.Composition.Hosting.Providers.ImportMany.ImportManyExportDescriptorProvider.<>c__DisplayClass3_2`1.<GetImportManyDescriptor>b__4(ExportDescriptor e)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at lambda_method(Closure , LifetimeContext , CompositionOperation )
   at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate(Int32 sharingId, CompositionOperation operation, CompositeActivator creator)
   at System.Composition.Hosting.Core.CompositionOperation.Run(LifetimeContext outermostLifetimeContext, CompositeActivator compositionRootActivator)
   at System.Composition.Hosting.Core.LifetimeContext.TryGetExport(CompositionContract contract, Object& export)
   at System.Composition.CompositionContext.GetExport(CompositionContract contract)
   at System.Composition.CompositionContext.GetExport[TExport](String contractName)
   at OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider, CompositionHost compositionHost)
   at OmniSharp.Http.Startup.Configure(IApplicationBuilder app, IServiceProvider serviceProvider, ILoggerFactory loggerFactory, HttpEnvironment httpEnvironment)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
System.NullReferenceException: Object reference not set to an instance of an object.
   at OmniSharp.MSBuild.ProjectSystem..ctor(IOmniSharpEnvironment environment, OmniSharpWorkspace workspace, IMSBuildLocator msbuildLocator, IDotNetCliService dotNetCliService, SdksPathResolver sdksPathResolver, MetadataFileReferenceCache metadataFileReferenceCache, IEventEmitter eventEmitter, IFileSystemWatcher fileSystemWatcher, FileSystemHelper fileSystemHelper, ILoggerFactory loggerFactory, IEnumerable`1 eventSinks)
   at lambda_method(Closure , LifetimeContext , CompositionOperation )
   at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate(Int32 sharingId, CompositionOperation operation, CompositeActivator creator)
   at System.Composition.Hosting.Providers.ImportMany.ImportManyExportDescriptorProvider.<>c__DisplayClass3_2`1.<GetImportManyDescriptor>b__4(ExportDescriptor e)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at lambda_method(Closure , LifetimeContext , CompositionOperation )
   at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate(Int32 sharingId, CompositionOperation operation, CompositeActivator creator)
   at System.Composition.Hosting.Core.CompositionOperation.Run(LifetimeContext outermostLifetimeContext, CompositeActivator compositionRootActivator)
   at System.Composition.Hosting.Core.LifetimeContext.TryGetExport(CompositionContract contract, Object& export)
   at System.Composition.CompositionContext.GetExport(CompositionContract contract)
   at System.Composition.CompositionContext.GetExport[TExport](String contractName)
   at OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider, CompositionHost compositionHost)
   at OmniSharp.Http.Startup.Configure(IApplicationBuilder app, IServiceProvider serviceProvider, ILoggerFactory loggerFactory, HttpEnvironment httpEnvironment)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.<StartAsync>d__26.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.Start()
   at OmniSharp.Http.Host.Start()
   at OmniSharp.Http.Driver.Program.<>c__DisplayClass0_1.<Main>b__1()
   at OmniSharp.HostHelpers.Start(Func`1 action)

kufii avatar Nov 03 '18 21:11 kufii

@kufii is the correct msbuild installed?

Rosalie241 avatar Nov 05 '18 09:11 Rosalie241

Yes 2015

kufii avatar Nov 05 '18 14:11 kufii

@kufii please show me the output of msbuild /version then :+1:

Rosalie241 avatar Nov 05 '18 18:11 Rosalie241

λ msbuild /version
Microsoft (R) Build Engine version 14.0.23107.0
Copyright (C) Microsoft Corporation. All rights reserved.

14.0.23107.0

kufii avatar Nov 06 '18 01:11 kufii

@tim241 I had the same output than @zshep427, saying is not recognized even after installing from the package control. Then I reached the OmniSharp.exe from:

...User\AppData\Roaming\Sublime Text 3\Packages\OmniSharp\prebuilt-omnisharp-roslyn\prebuilt\OmniSharp.exe

and after tryng to execute it, the same output of @kufii

>OmniSharp.exe
Application startup exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at OmniSharp.MSBuild.ProjectSystem..ctor(IOmniSharpEnvironment environment, OmniSharpWorkspace workspace, IMSBuildLocator msbuildLocator, IDotNetCliService dotNetCliService, SdksPathResolver sdksPathResolver, MetadataFileReferenceCache metadataFileReferenceCache, IEventEmitter eventEmitter, IFileSystemWatcher fileSystemWatcher, FileSystemHelper fileSystemHelper, ILoggerFactory loggerFactory, IEnumerable`1 eventSinks)
   at lambda_method(Closure , LifetimeContext , CompositionOperation )
   at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate(Int32 sharingId, CompositionOperation operation, CompositeActivator creator)
   at System.Composition.Hosting.Providers.ImportMany.ImportManyExportDescriptorProvider.<>c__DisplayClass3_2`1.<GetImportManyDescriptor>b__4(ExportDescriptor e)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at lambda_method(Closure , LifetimeContext , CompositionOperation )
   at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate(Int32 sharingId, CompositionOperation operation, CompositeActivator creator)
   at System.Composition.Hosting.Core.CompositionOperation.Run(LifetimeContext outermostLifetimeContext, CompositeActivator compositionRootActivator)
   at System.Composition.Hosting.Core.LifetimeContext.TryGetExport(CompositionContract contract, Object& export)
   at System.Composition.CompositionContext.GetExport(CompositionContract contract)
   at System.Composition.CompositionContext.GetExport[TExport](String contractName)
   at OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider, CompositionHost compositionHost)
   at OmniSharp.Http.Startup.Configure(IApplicationBuilder app, IServiceProvider serviceProvider, ILoggerFactory loggerFactory, HttpEnvironment httpEnvironment)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
System.NullReferenceException: Object reference not set to an instance of an object.
   at OmniSharp.MSBuild.ProjectSystem..ctor(IOmniSharpEnvironment environment, OmniSharpWorkspace workspace, IMSBuildLocator msbuildLocator, IDotNetCliService dotNetCliService, SdksPathResolver sdksPathResolver, MetadataFileReferenceCache metadataFileReferenceCache, IEventEmitter eventEmitter, IFileSystemWatcher fileSystemWatcher, FileSystemHelper fileSystemHelper, ILoggerFactory loggerFactory, IEnumerable`1 eventSinks)
   at lambda_method(Closure , LifetimeContext , CompositionOperation )
   at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate(Int32 sharingId, CompositionOperation operation, CompositeActivator creator)
   at System.Composition.Hosting.Providers.ImportMany.ImportManyExportDescriptorProvider.<>c__DisplayClass3_2`1.<GetImportManyDescriptor>b__4(ExportDescriptor e)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at lambda_method(Closure , LifetimeContext , CompositionOperation )
   at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate(Int32 sharingId, CompositionOperation operation, CompositeActivator creator)
   at System.Composition.Hosting.Core.CompositionOperation.Run(LifetimeContext outermostLifetimeContext, CompositeActivator compositionRootActivator)
   at System.Composition.Hosting.Core.LifetimeContext.TryGetExport(CompositionContract contract, Object& export)
   at System.Composition.CompositionContext.GetExport(CompositionContract contract)
   at System.Composition.CompositionContext.GetExport[TExport](String contractName)
   at OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider, CompositionHost compositionHost)
   at OmniSharp.Http.Startup.Configure(IApplicationBuilder app, IServiceProvider serviceProvider, ILoggerFactory loggerFactory, HttpEnvironment httpEnvironment)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.<StartAsync>d__26.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.Start()
   at OmniSharp.Http.Host.Start()
   at OmniSharp.Http.Driver.Program.<>c__DisplayClass0_1.<Main>b__1()
   at OmniSharp.HostHelpers.Start(Func`1 action)

My msbuild version:

Microsoft (R) Build Engine version 14.0.23107.0
Copyright (C) Microsoft Corporation. All rights reserved.

VicEsquivel avatar Nov 08 '18 17:11 VicEsquivel

Does omnisharp-sublime 1.9.9 fix it? (I updated omnisharp-roslyn and the msbuild detector seems to be improved)

Rosalie241 avatar Nov 09 '18 10:11 Rosalie241

@tim241 nope, upgraded and the bug remained, then removed omnisharp and msbuild and started all over again and still the OmniSharp: Error talking to localhost/checkreadystatus

RAISE_OMNI_SHARP_LAUNCHER_EXCEPTION:TypeError("'NoneType' object is not iterable",)
Error launching server

VicEsquivel avatar Nov 09 '18 17:11 VicEsquivel

Today Package Control told me that it failed when upgrading Omnisharp and suggested restarted Sublime. But I'm now getting RAISE_OMNI_SHARP_LAUNCHER_EXCEPTION:TypeError("'NoneType' object is not iterable",)

It was all working fine last week.

xenonii avatar Nov 12 '18 07:11 xenonii

Alright, for 2.0.0 I've reverted the previous commit (the omnisharp-roslyn) update

I'll take a closer look now.

EDIT: I'm sorry for causing any inconveniences, I hope I'll get this fixed ASAP

Rosalie241 avatar Nov 12 '18 11:11 Rosalie241

@tim241 2.0.0 is working now. Thanks

xenonii avatar Nov 12 '18 14:11 xenonii

I'm seeing this issue on 2.0.0. This is a fresh install of omniSharp-sublime through Sublime package control. I'm seeing the same Application Startup Exception as @kufii. MsBuild version : 15.1.1012.6693 Mono version : 5.18.0

pixelSmuggler avatar Jan 18 '19 17:01 pixelSmuggler

I'm also had this problem on 2.0.0. About fresh install, by instruction. The same exception on startup as was @kufii. So, it solved by grabbing the lastest for now (v1.32.8) release of omnisharp-roslyn for http-win-x86 (may be the problem was in arch) and replacing with it omnisharp in sublime package.

Rubikoid avatar Jan 19 '19 23:01 Rubikoid

On linux I had to install the dot net core sdk https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-2.2.104

MightyPrinny avatar Feb 16 '19 03:02 MightyPrinny

Hey @tim241 thanks for all the great work on this project.

I'm getting the

RAISE_OMNI_SHARP_LAUNCHER_EXCEPTION:TypeError("'NoneType' object is not iterable",)

error running v2.0.0 on OSX as well.

Is this something that might be resolved temporarily by running an earlier version of omnisharp-sublime?

yohanmishkin avatar Apr 25 '19 12:04 yohanmishkin

I was able to get things running by downloading the latest omnisharp-rosyln release:

https://github.com/OmniSharp/omnisharp-roslyn/releases

and manually starting the server with the run script.

yohanmishkin avatar Apr 25 '19 12:04 yohanmishkin

@yohanmishkin are you sure the code is in focus? that error generally only pops up once you have the warning/log window in focus

Rosalie241 avatar Apr 25 '19 14:04 Rosalie241

Thanks, @tim241. I thought I had the code in focus, but things appear kosher now. So thanks for checking in!

yohanmishkin avatar Apr 25 '19 15:04 yohanmishkin

I'm also getting the OmniSharp: Error talking to localhost/checkreadystatus error on version 2.0.0. My msbuild version:

$ msbuild /version
Microsoft (R) Build Engine version 16.5.0-ci for Mono
Copyright (C) Microsoft Corporation. All rights reserved.

16.5.0.26101

I have installed the net core sdk, and tried manually starting the server

APersonH avatar May 25 '20 19:05 APersonH

Any solution for that? I've done everything possible and I haven't solved anything :/

luizfernandonb avatar Aug 27 '20 01:08 luizfernandonb

Fascinatingly, I have been trying to make this work in Windows 10 for hours then gave up. In my Linux laptop, it just worked out of the box.

Well to be fair, I already access to Mono and MSBuild in my Linux, so that's most likely the reason why.

Sublime Text and Omnisharp must have access to both Mono and MSBuild. I tried using mono --version and msbuild --version in Windows Terminal (using Powershell), yet none of them worked (even if I have BOTH of them installed, most likely they still aren't in PATH, will test again if I regained my sanity). Bonus points if you use the Terminus package for Sublime Text.

rikai-suru avatar Aug 31 '20 05:08 rikai-suru

Same Error! Same output as @kufii when execute omnisharp.cmd. Solution: I found msbuild /version output right not mean omnisharp server can run correctly. Just adding only the filepath of msbuild.exe to PATH can arrive this. With visual studio installed, it provides vcvars64.bat to set environment correctly, but temporary. So I add call vcvars64.bat to the head of omnisharp.cmd then it works. Remember to add the filepath of vcvars64.bat into the PATH! Good luck!

0xPlaydevil avatar Nov 11 '20 10:11 0xPlaydevil