microsoft / vscode-azurearmtools

Azure Resource Manager Tools for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=msazurermtools.azurerm-vscode-tools
MIT License
134 stars 81 forks source link

Just doing my part. #1393

Open valerio-battelle opened 3 years ago

valerio-battelle commented 3 years ago

Does this occur consistently? Repro steps:

1. 2.

Action: Language Server Error Error type: Error Error Message: The connection to the ARM Template Language Server got closed.

Version: 0.15.3 OS: win32 OS Release: 10.0.19042 Product: Visual Studio Code Product Version: 1.60.2 Language: en

Call Stack ``` extension.bundle.js:239:61005extension.bundle.js:239:61005 Object.callWithTelemetryAndErrorHandlingSync extension.bundle.js:16:143260 WrappedErrorHandler.closed extension.bundle.js:239:60851 LanguageClient.handleConnectionClosed vscode-languageclient/client.js:2044:55 LanguageClient.handleConnectionClosed vscode-languageclient/main.js:127:15 closeHandler vscode-languageclient/client.js:2023:18 CallbackList.invoke vscode-jsonrpc/events.js:62:39 Emitter.fire vscode-jsonrpc/events.js:120:36 closeHandler vscode-jsonrpc/main.js:226:26 CallbackList.invoke vscode-jsonrpc/events.js:62:39 Emitter.fire vscode-jsonrpc/events.js:120:36 StreamMessageReader.fireClose vscode-jsonrpc/messageReader.js:111:27 Socket. vscode-jsonrpc/messageReader.js:151:46 Socket.emit events.js:327:22 Pipe. net.js:673:12 ```
StephenWeatherford commented 3 years ago

@valerio-battelle Please continue to do your part. Unfortunately, there's currently not much I can do without more info. Do you get this frequently, or did it occur only once? If frequently, could you please:

Open View->Output -> select "Azure Resource Manager Tools" image

image

And if there are any errors there please copy them here (be sure to remove any sensitive information - e.g. possibly user names). Thanks!

ghost commented 3 years ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 10 days of this comment.

StephenWeatherford commented 3 years ago

@valerio-battelle Would love to be able to track this down. Any info you could provide would be helpful, thanks!

valerio-battelle commented 3 years ago

This happens all the time. For some reason the ARM Template Language Server never starts. I'm on a work laptop and it is pretty locked down. I've honestly not spent much time debugging this, but I figure others out there may be having a similar problem. My terminal output is below.

Using dotnet core executable at c:\Users\valerio\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\3.1.19\dotnet.exe
Starting ARM Template Language Server at c:\Users\valerio\.vscode\extensions\msazurermtools.azurerm-vscode-tools-0.15.4\languageServer\Microsoft.ArmLanguageServer.dll
Language server nuget version: 3.0.0-preview.21474.3
Client options:
{
  "documentSelector": [
    {
      "language": "arm-template",
      "scheme": "file"
    },
    {
      "language": "arm-template",
      "scheme": "untitled"
    }
  ],
  "diagnosticCollectionName": "ARM Template Language Server diagnostics",
  "outputChannel": {
    "outputChannel": {
      "name": "Azure Resource Manager Tools",
      "extensionPrefix": "azureResourceManagerTools",
      "_outputChannel": {
        "name": "Azure Resource Manager Tools",
        "_channel": {}
      }
    }
  },
  "revealOutputChannelOn": 3,
  "synchronize": {
    "configurationSection": "azureResourceManagerTools"
  },
  "middleware": {}
}
Server options:
{
  "run": {
    "command": "c:\\Users\\valerio\\AppData\\Roaming\\Code\\User\\globalStorage\\ms-dotnettools.vscode-dotnet-runtime\\.dotnet\\3.1.19\\dotnet.exe",
    "args": [
      "c:\\Users\\valerio\\.vscode\\extensions\\msazurermtools.azurerm-vscode-tools-0.15.4\\languageServer\\Microsoft.ArmLanguageServer.dll",
      "--logLevel",
      "Warning"
    ],
    "options": {
      "shell": false
    }
  },
  "debug": {
    "command": "c:\\Users\\valerio\\AppData\\Roaming\\Code\\User\\globalStorage\\ms-dotnettools.vscode-dotnet-runtime\\.dotnet\\3.1.19\\dotnet.exe",
    "args": [
      "c:\\Users\\valerio\\.vscode\\extensions\\msazurermtools.azurerm-vscode-tools-0.15.4\\languageServer\\Microsoft.ArmLanguageServer.dll",
      "--logLevel",
      "Warning"
    ],
    "options": {
      "shell": false
    }
  }
}
Unhandled exception. Newtonsoft.Json.JsonSerializationException: Error setting value to 'RootPath' on 'OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams'.
 ---> System.UriFormatException: Invalid URI: The hostname could not be parsed.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at System.Uri..ctor(String uriString)
   at OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams.set_RootPath(String value)
   at Newtonsoft.Json.Serialization.ExpressionValueProvider.SetValue(Object target, Object value)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Serialization.ExpressionValueProvider.SetValue(Object target, Object value)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(String method, JToken params)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(IMethodWithParams instance)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.GetDescriptor(Request request)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.OmniSharp.Extensions.JsonRpc.IRequestRouter<OmniSharp.Extensions.JsonRpc.IHandlerDescriptor>.GetDescriptor(Request request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.HandleRequest(String request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.ProcessInputStream()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
Error: The connection to the ARM Template Language Server got closed.
[Info  - 9:03:21 AM] Connection to server got closed. Server will restart.
Unhandled exception. Newtonsoft.Json.JsonSerializationException: Error setting value to 'RootPath' on 'OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams'.
 ---> System.UriFormatException: Invalid URI: The hostname could not be parsed.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at System.Uri..ctor(String uriString)
   at OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams.set_RootPath(String value)
   at Newtonsoft.Json.Serialization.ExpressionValueProvider.SetValue(Object target, Object value)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Serialization.ExpressionValueProvider.SetValue(Object target, Object value)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(String method, JToken params)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(IMethodWithParams instance)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.GetDescriptor(Request request)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.OmniSharp.Extensions.JsonRpc.IRequestRouter<OmniSharp.Extensions.JsonRpc.IHandlerDescriptor>.GetDescriptor(Request request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.HandleRequest(String request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.ProcessInputStream()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
Error: The connection to the ARM Template Language Server got closed.
[Info  - 9:03:22 AM] Connection to server got closed. Server will restart.
Unhandled exception. Newtonsoft.Json.JsonSerializationException: Error setting value to 'RootPath' on 'OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams'.
 ---> System.UriFormatException: Invalid URI: The hostname could not be parsed.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at System.Uri..ctor(String uriString)
   at OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams.set_RootPath(String value)
   at Newtonsoft.Json.Serialization.ExpressionValueProvider.SetValue(Object target, Object value)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Serialization.ExpressionValueProvider.SetValue(Object target, Object value)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(String method, JToken params)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(IMethodWithParams instance)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.GetDescriptor(Request request)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.OmniSharp.Extensions.JsonRpc.IRequestRouter<OmniSharp.Extensions.JsonRpc.IHandlerDescriptor>.GetDescriptor(Request request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.HandleRequest(String request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.ProcessInputStream()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
Error: The connection to the ARM Template Language Server got closed.
[Info  - 9:03:23 AM] Connection to server got closed. Server will restart.
Unhandled exception. Newtonsoft.Json.JsonSerializationException: Error setting value to 'RootPath' on 'OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams'.
 ---> System.UriFormatException: Invalid URI: The hostname could not be parsed.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at System.Uri..ctor(String uriString)
   at OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams.set_RootPath(String value)
   at Newtonsoft.Json.Serialization.ExpressionValueProvider.SetValue(Object target, Object value)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Serialization.ExpressionValueProvider.SetValue(Object target, Object value)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(String method, JToken params)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(IMethodWithParams instance)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.GetDescriptor(Request request)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.OmniSharp.Extensions.JsonRpc.IRequestRouter<OmniSharp.Extensions.JsonRpc.IHandlerDescriptor>.GetDescriptor(Request request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.HandleRequest(String request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.ProcessInputStream()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
Error: The connection to the ARM Template Language Server got closed.
[Info  - 9:03:25 AM] Connection to server got closed. Server will restart.
Unhandled exception. Newtonsoft.Json.JsonSerializationException: Error setting value to 'RootPath' on 'OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams'.
 ---> System.UriFormatException: Invalid URI: The hostname could not be parsed.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at System.Uri..ctor(String uriString)
   at OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams.set_RootPath(String value)
   at Newtonsoft.Json.Serialization.ExpressionValueProvider.SetValue(Object target, Object value)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Serialization.ExpressionValueProvider.SetValue(Object target, Object value)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(String method, JToken params)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(IMethodWithParams instance)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.GetDescriptor(Request request)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.OmniSharp.Extensions.JsonRpc.IRequestRouter<OmniSharp.Extensions.JsonRpc.IHandlerDescriptor>.GetDescriptor(Request request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.HandleRequest(String request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.ProcessInputStream()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
Error: The connection to the ARM Template Language Server got closed.
[Error - 9:03:26 AM] Connection to server got closed. Server will not be restarted.
StephenWeatherford commented 3 years ago

Thanks, that's very helpful! I'll look at the code, see if I can figure out what might be causing this.

PDunbarCGI commented 2 years ago

I'm getting this as well. Same output as above.

Providing trace logging in case that's more useful:

Using dotnet core executable at c:\Users\pdunbar\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\6.0.3\dotnet.exe
Starting ARM Template Language Server at c:\Users\pdunbar\.vscode\extensions\msazurermtools.azurerm-vscode-tools-0.15.6\languageServer\Microsoft.ArmLanguageServer.dll
Language server nuget version: 3.0.0-preview.22111.2
Client options:
{
  "documentSelector": [
    {
      "language": "arm-template",
      "scheme": "file"
    },
    {
      "language": "arm-template",
      "scheme": "untitled"
    }
  ],
  "diagnosticCollectionName": "ARM Template Language Server diagnostics",
  "outputChannel": {
    "name": "Azure Resource Manager Tools",
    "extensionPrefix": "azureResourceManagerTools",
    "_outputChannel": {
      "name": "Azure Resource Manager Tools"
    }
  },
  "revealOutputChannelOn": 3,
  "synchronize": {
    "configurationSection": "azureResourceManagerTools"
  },
  "middleware": {}
}
Server options:
{
  "run": {
    "command": "c:\\Users\\pdunbar\\AppData\\Roaming\\Code\\User\\globalStorage\\ms-dotnettools.vscode-dotnet-runtime\\.dotnet\\6.0.3\\dotnet.exe",
    "args": [
      "c:\\Users\\pdunbar\\.vscode\\extensions\\msazurermtools.azurerm-vscode-tools-0.15.6\\languageServer\\Microsoft.ArmLanguageServer.dll",
      "--logLevel",
      "Trace"
    ],
    "options": {
      "shell": false
    }
  },
  "debug": {
    "command": "c:\\Users\\pdunbar\\AppData\\Roaming\\Code\\User\\globalStorage\\ms-dotnettools.vscode-dotnet-runtime\\.dotnet\\6.0.3\\dotnet.exe",
    "args": [
      "c:\\Users\\pdunbar\\.vscode\\extensions\\msazurermtools.azurerm-vscode-tools-0.15.6\\languageServer\\Microsoft.ArmLanguageServer.dll",
      "--logLevel",
      "Trace"
    ],
    "options": {
      "shell": false
    }
  }
}
Unhandled exception. System.UriFormatException: Invalid URI: The hostname could not be parsed.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
   at System.Uri..ctor(String uriString, UriKind uriKind)
   at OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters.AbsoluteUriConverter.ReadJson(JsonReader reader, Type objectType, Uri existingValue, Boolean hasExistingValue, JsonSerializer serializer)
   at Newtonsoft.Json.JsonConverter`1.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(String method, JToken params)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(IMethodWithParams instance)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.GetDescriptor(Request request)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.OmniSharp.Extensions.JsonRpc.IRequestRouter<OmniSharp.Extensions.JsonRpc.IHandlerDescriptor>.GetDescriptor(Request request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.HandleRequest(String request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.ProcessInputStream()
   at System.Threading.Thread.StartCallback()
Error: The connection to the ARM Template Language Server got closed.
[Info  - 11:44:54 AM] Connection to server got closed. Server will restart.
Unhandled exception. System.UriFormatException: Invalid URI: The hostname could not be parsed.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
   at System.Uri..ctor(String uriString, UriKind uriKind)
   at OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters.AbsoluteUriConverter.ReadJson(JsonReader reader, Type objectType, Uri existingValue, Boolean hasExistingValue, JsonSerializer serializer)
   at Newtonsoft.Json.JsonConverter`1.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(String method, JToken params)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(IMethodWithParams instance)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.GetDescriptor(Request request)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.OmniSharp.Extensions.JsonRpc.IRequestRouter<OmniSharp.Extensions.JsonRpc.IHandlerDescriptor>.GetDescriptor(Request request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.HandleRequest(String request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.ProcessInputStream()
   at System.Threading.Thread.StartCallback()
Error: The connection to the ARM Template Language Server got closed.
[Info  - 11:44:56 AM] Connection to server got closed. Server will restart.
Unhandled exception. System.UriFormatException: Invalid URI: The hostname could not be parsed.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
   at System.Uri..ctor(String uriString, UriKind uriKind)
   at OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters.AbsoluteUriConverter.ReadJson(JsonReader reader, Type objectType, Uri existingValue, Boolean hasExistingValue, JsonSerializer serializer)
   at Newtonsoft.Json.JsonConverter`1.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(String method, JToken params)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(IMethodWithParams instance)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.GetDescriptor(Request request)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.OmniSharp.Extensions.JsonRpc.IRequestRouter<OmniSharp.Extensions.JsonRpc.IHandlerDescriptor>.GetDescriptor(Request request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.HandleRequest(String request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.ProcessInputStream()
   at System.Threading.Thread.StartCallback()
Error: The connection to the ARM Template Language Server got closed.
[Info  - 11:44:58 AM] Connection to server got closed. Server will restart.
Unhandled exception. System.UriFormatException: Invalid URI: The hostname could not be parsed.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
   at System.Uri..ctor(String uriString, UriKind uriKind)
   at OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters.AbsoluteUriConverter.ReadJson(JsonReader reader, Type objectType, Uri existingValue, Boolean hasExistingValue, JsonSerializer serializer)
   at Newtonsoft.Json.JsonConverter`1.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(String method, JToken params)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(IMethodWithParams instance)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.GetDescriptor(Request request)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.OmniSharp.Extensions.JsonRpc.IRequestRouter<OmniSharp.Extensions.JsonRpc.IHandlerDescriptor>.GetDescriptor(Request request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.HandleRequest(String request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.ProcessInputStream()
   at System.Threading.Thread.StartCallback()
Error: The connection to the ARM Template Language Server got closed.
[Info  - 11:45:00 AM] Connection to server got closed. Server will restart.
Unhandled exception. System.UriFormatException: Invalid URI: The hostname could not be parsed.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
   at System.Uri..ctor(String uriString, UriKind uriKind)
   at OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters.AbsoluteUriConverter.ReadJson(JsonReader reader, Type objectType, Uri existingValue, Boolean hasExistingValue, JsonSerializer serializer)
   at Newtonsoft.Json.JsonConverter`1.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(String method, JToken params)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.FindDescriptor(IMethodWithParams instance)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.GetDescriptor(Request request)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.OmniSharp.Extensions.JsonRpc.IRequestRouter<OmniSharp.Extensions.JsonRpc.IHandlerDescriptor>.GetDescriptor(Request request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.HandleRequest(String request)
   at OmniSharp.Extensions.JsonRpc.InputHandler.ProcessInputStream()
   at System.Threading.Thread.StartCallback()
Error: The connection to the ARM Template Language Server got closed.
[Error - 11:45:02 AM] Connection to server got closed. Server will not be restarted.
Error: ARM Template Language Server: An error occurred starting the language server.

Connection to server got closed. Server will not be restarted.
Language server failed on start-up: ARM Template Language Server: An error occurred starting the language server.

Connection to server got closed. Server will not be restarted.: Error: ARM Template Language Server: An error occurred starting the language server.

Connection to server got closed. Server will not be restarted.
    at c:\Users\pdunbar\.vscode\extensions\msazurermtools.azurerm-vscode-tools-0.15.6\dist\extension.bundle.js:16:298188
    at Generator.throw (<anonymous>)
    at rejected (c:\Users\pdunbar\.vscode\extensions\msazurermtools.azurerm-vscode-tools-0.15.6\dist\extension.bundle.js:16:289316)
StephenWeatherford commented 2 years ago

Thanks for the extra info. Unfortunately it doesn't help much. Could you try uninstalling the extension by deleting this folder: c:\Users\\.vscode\extensions\msazurermtools.azurerm-vscode-tools-0.15.6 and let it reinstall again? (probably won't help but worth trying)

PDunbarCGI commented 2 years ago

As expected, I got the same result.

PDunbarCGI commented 2 years ago

Further diagnostics: for good measure, I've disabled all other extensions and cleared the settings from my settings file that start with azureResoruceManagerTools, restarted vscode and I still get the same result.

PDunbarCGI commented 2 years ago

Where could I find alternate builds/versions of Microsoft.ArmLanguageServer.dll?

PDunbarCGI commented 2 years ago

Update: in my case at least, this seems to be a duplicate of #1295. I've been using a workspace with multiple folders (no WSL installed). I opened the folder by itself and the ARM Language Server starts as desired without error.

StephenWeatherford commented 2 years ago

@PDunbarCGI Weird, I don't have any trouble with multiple-folder workspaces. Any chance you can provide a simple scenario that reproduces it?

PDunbarCGI commented 2 years ago

I didn't actively try - but I did seem to reproduce the issue again. I make use of the GitLens extension - one of the features allows you to browse a branch in the current window without doing an actual pull/clone into a new folder. I'm not sure if that's what caused the problem to reoccur, but the problem did in fact reoccur. The same workaround that I mentioned on #1295 resolved the issue for me, though:

  1. Open a folder in vscode (instead of the workspace with multiple folders added)
  2. Open an ARM template to start the server
  3. Open the workspace containing multiple folders
  4. Open the ARM template, the language server seems to work as desired - even after reboot.