microsoft / vscode-docs-authoring

VSCode extension that provides markdown authoring assistance to docs.microsoft.com contributors
MIT License
138 stars 90 forks source link

[Markdocs Server Error]: System.ArgumentNullException: Value cannot be null. #101

Closed mmacy closed 4 years ago

mmacy commented 5 years ago

After updating VS Code, I typically see some version of the following exception upon first launch after update. Here's the latest after my update to VS Code v1.72.2 today:

[Markdocs Server Error]: System.ArgumentNullException: Value cannot be null.
   at System.Threading.Monitor.ReliableEnter(Object obj, Boolean& lockTaken)
   at System.Net.HttpEndPointListener.ProcessAccept(SocketAsyncEventArgs args)
   at System.Net.HttpEndPointListener.Accept(SocketAsyncEventArgs e)
   at System.Net.HttpEndPointListener..ctor(HttpListener listener, IPAddress addr, Int32 port, Boolean secure)
   at System.Net.HttpEndPointManager.GetEPListener(String host, Int32 port, HttpListener listener, Boolean secure)
   at System.Net.HttpEndPointManager.AddPrefixInternal(String p, HttpListener listener)
   at System.Net.HttpEndPointManager.AddListener(HttpListener listener)
   at System.Net.HttpListener.Start()
   at MarkdocsService.MarkdownHttpServer.Start() in C:\projects\markdocs-server\MarkdownHttpServer.cs:line 32
   at MarkdocsService.Program.HandleRequest() in C:\projects\markdocs-server\Program.cs:line 26
   at MarkdocsService.Program.Main(String[] args) in C:\projects\markdocs-server\Program.cs:line 14

The output window displays the following prior to the Markdocs server error popups:

Installing docs preview extension's dependencies...
Platform: linux, x86_64, name=ubuntu, version=18.04

Downloading package "docs-previewService for Linux (x64)" (26101 KB) .................... Done!

Installing package "docs-previewService for Linux (x64)"

Finished

Environment

OS: Ubuntu 18.04 LTS VSCode version: 1.72.2 Docs extension versions: image

jamarw commented 5 years ago

Hi @mmacy , looping in @qinezh for assistance. Thanks

qinezh commented 5 years ago

@mmacy Can you please try the latest version of docs-preview and see whether the issue still exists?

mmacy commented 5 years ago

Hi @qinezh,

After hitting the Reload button for docs-preview 0.3.14, the same exception appeared:

[Markdocs Server Error]: System.ArgumentNullException: Value cannot be null.
   at System.Threading.Monitor.ReliableEnter(Object obj, Boolean& lockTaken)
   at System.Net.HttpEndPointListener.ProcessAccept(SocketAsyncEventArgs args)
   at System.Net.HttpEndPointListener.Accept(SocketAsyncEventArgs e)
   at System.Net.HttpEndPointListener..ctor(HttpListener listener, IPAddress addr, Int32 port, Boolean secure)
   at System.Net.HttpEndPointManager.GetEPListener(String host, Int32 port, HttpListener listener, Boolean secure)
   at System.Net.HttpEndPointManager.AddPrefixInternal(String p, HttpListener listener)
   at System.Net.HttpEndPointManager.AddListener(HttpListener listener)
   at System.Net.HttpListener.Start()
   at MarkdocsService.MarkdownHttpServer.Start() in C:\projects\markdocs-server\MarkdownHttpServer.cs:line 32
   at MarkdocsService.Program.HandleRequest() in C:\projects\markdocs-server\Program.cs:line 26
   at MarkdocsService.Program.Main(String[] args) in C:\projects\markdocs-server\Program.cs:line 14

Screenshot of post-install output:

image

Current versions of all docs* extensions:

image

qinezh commented 5 years ago

ok, I'll find a linux environment to do some investigation these days, thanks for the details.

mmacy commented 5 years ago

@qinezh Sounds good, thanks. Feel free to let me know if there's any way I can help.

qinezh commented 5 years ago

Hi @mmacy , can you please try the latest version to see whether the issue has been fixed?

mmacy commented 5 years ago

Sorry @qinezh, the exception is still thrown in the latest version.

[Markdocs Server Error]: 
Unhandled Exception: System.ArgumentNullException: Value cannot be null.
   at System.Threading.Monitor.ReliableEnter(Object obj, Boolean& lockTaken)
   at System.Net.HttpEndPointListener.ProcessAccept(SocketAsyncEventArgs args)
   at System.Net.HttpEndPointListener.Accept(SocketAsyncEventArgs e)
   at System.Net.HttpEndPointListener..ctor(HttpListener listener, IPAddress addr, Int32 port, Boolean secure)
   at System.Net.HttpEndPointManager.GetEPListener(String host, Int32 port, HttpListener listener, Boolean secure)
   at System.Net.HttpEndPointManager.AddPrefixInternal(String p, HttpListener listener)
   at System.Net.HttpEndPointManager.AddListener(HttpListener listener)
   at System.Net.HttpListener.Start()
   at MarkdocsService.MarkdownHttpServer.Start() in C:\projects\markdocs-server\MarkdownHttpServer.cs:line 32
   at MarkdocsService.Program.HandleRequest() in C:\projects\markdocs-server\Program.cs:line 26
   at MarkdocsService.Program.Main(String[] args) in C:\projects\markdocs-server\Program.cs:line 14

Error notifications on first launch after update:

image

Versions:

image

qinezh commented 5 years ago

@mmacy Just tried from my Ubuntu virtual machine, it looks good to run it:

image

Can you please do below steps to help troubleshoot it?

  1. download the packages: wget https://github.com/qinezh/markdocs-server/releases/download/v1.0.18/netcore.zip
  2. unzip it: unzip netcore.zip -d netcore
  3. run it with dotnet cli: dotnet netcore/MarkdocsService.dll

Does it throw the same exception on you machine?

mmacy commented 5 years ago

@qinezh No, the exception is not thrown when executing the service in this manner:

marsh@marsh:~/Downloads$ dotnet netcore/MarkdocsService.dll 
Start...

I get the exception on two different Ubuntu machines, so there must be some other issue contributing to the nullref when launching in a full desktop scenario.

qinezh commented 5 years ago

@mmacy appreciate your help, I'll try to repro it in a full Ubuntu desktop as you mentioned and let you know if any updates.

ijash commented 5 years ago

i am getting this error too

qinezh commented 5 years ago

@ijash Are you getting this error in Ubuntu or other operation system?

ijash commented 5 years ago

@qinezh in linux mint 19.1, which derivatives of ubuntu 18.04

bharney0 commented 4 years ago

docs-preview has substantially changed in the code base and now uses markdown-it extension based on built-in preview from VS Code. Closing this issue out due to the changes made to docs-preview no longer using this code.

mmacy commented 4 years ago

@bharney0 I can confirm that I've not seen this error in quite some time. Thanks!