Skip to content

Unhandled exception when linking to localhost #156

@bmorelli25

Description

@bmorelli25

The following steps (1+2) renders correctly:

  Follow these instructions to get started with docs-builder on your machine.
  
  ::::{tab-set}
  
  :::{tab-item} macOS
  
  ### macOS Installation
  
  1. **Download the Binary:**
     Download the latest macOS binary from [releases](https://github.com/elastic/docs-builder/releases/latest/):
     ```sh
     curl -LO https://github.com/elastic/docs-builder/releases/latest/download/docs-builder-mac-arm64.zip
     ```
  
  2. **Extract the Binary:**
     Unzip the downloaded file:
     ```sh
     unzip docs-builder-mac-arm64.zip
     ```
  
  :::
  
  ::::

Adding a third step which consists of a link to localhost breaks the docs build:

  Follow these instructions to get started with docs-builder on your machine.
  
  ::::{tab-set}
  
  :::{tab-item} macOS
  
  ### macOS Installation
  
  1. **Download the Binary:**
     Download the latest macOS binary from [releases](https://github.com/elastic/docs-builder/releases/latest/):
     ```sh
     curl -LO https://github.com/elastic/docs-builder/releases/latest/download/docs-builder-mac-arm64.zip
     ```
  
  2. **Extract the Binary:**
     Unzip the downloaded file:
     ```sh
     unzip docs-builder-mac-arm64.zip
     ```
  
  3. **Run the Binary:**
     Use the `serve` command to start serving the documentation at [http://localhost:5000](http://localhost:5000):
     ```sh
     ./docs-builder-mac-arm64 serve
     ```
  
  :::
  
  ::::

The error:

:: fail: Microsoft.AspNetCore.Server.Kestrel[13] => ConnectionId:0HN9G7SH1MM60 => RequestPath:/contribute/change-local.html RequestId:0HN9G7SH1MM60:00000002 Connection id "0HN9G7SH1MM60", Request id "0HN9G7SH1MM60:00000002": An unhandled exception was thrown by the application. System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'length')    at System.Range.ThrowArgumentOutOfRangeException() + 0x30    at System.Runtime.CompilerServices.RuntimeHelpers.GetSubArray[T](T[], Range) + 0xf0    at Elastic.Markdown.Myst.InlineParsers.DiagnosticLinkInlineParser.Match(InlineProcessor, StringSlice&) + 0x6dc    at Markdig.Parsers.InlineProcessor.ProcessInlineLeaf(LeafBlock) + 0x1a8    at Markdig.Parsers.MarkdownParser.ProcessInlines(InlineProcessor, MarkdownDocument) + 0x1e8    at Markdig.Parsers.MarkdownParser.Parse(String, MarkdownPipeline, MarkdownParserContext) + 0x1a4    at Elastic.Markdown.Myst.MarkdownParser.<ParseAsync>d__17.MoveNext() + 0x3d4 --- End of stack trace from previous location ---    at Elastic.Markdown.Myst.MarkdownParser.<ParseAsync>d__17.MoveNext() + 0x51c --- End of stack trace from previous location ---    at Elastic.Markdown.IO.MarkdownFile.<ParseFullAsync>d__46.MoveNext() + 0x120 --- End of stack trace from previous location ---    at Documentation.Builder.Http.DocumentationWebHost.<ServeDocumentationFile>d__5.MoveNext() + 0x64 --- End of stack trace from previous location ---    at Microsoft.AspNetCore.Http.Generated.<GeneratedRouteBuilderExtensions_g>F9FD095A96D7BF9FDD7558DD250356B89D81867A5B211CAD9BB449D90D8933B04__GeneratedRouteBuilderExtensionsCore.<>c__DisplayClass3_0.<<MapGet1>g__RequestHandler|5>d.MoveNext() + 0x23c --- End of stack trace from previous location ---    at Microsoft.AspNetCore.Routing.EndpointMiddleware.<<Invoke>g__AwaitRequestTask|7_0>d.MoveNext() + 0x60 --- End of stack trace from previous location ---    at Westwind.AspNetCore.LiveReload.LiveReloadMiddleware.<HandleHtmlInjection>d__8.MoveNext() + 0x160 --- End of stack trace from previous location ---    at Westwind.AspNetCore.LiveReload.LiveReloadMiddleware.<InvokeAsync>d__6.MoveNext() + 0x144 --- End of stack trace from previous location ---    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.<ProcessRequests>d__238`1.MoveNext() + 0x288
:: info: Microsoft.AspNetCore.Hosting.Diagnostics[2] => ConnectionId:0HN9G7SH1MM60 => RequestPath:/contribute/change-local.html RequestId:0HN9G7SH1MM60:00000002 Request finished HTTP/1.1 GET http://localhost:5000/contribute/change-local.html - 500 0 - 3.0053ms

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions