<!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title>Internal Server Error</title> <style> :root { --color-text: #222; --color-background: #fff; --color-border: #ddd; --color-link: #105e85; --color-link-hover: #157eb0; --color-heading-main: #44525e; --color-heading-stacktrace: #363636; --color-table-heading: #44525e; --color-tab-link: #105e85; --color-tab-selected: #fff; --color-tab-selected-background: #105e85; --color-code-background: #fbfbfb; --color-code-highlight: #c70000; --color-code-context-linenum: #606060; --color-code-context: #606060; --color-code-context-button-background: #ddd; } /* Intentional double at-signs here to escape properly when included in cshtml */ @media (prefers-color-scheme: dark) { :root { --color-text: #dcdcdc; --color-background: #222; --color-border: #444; --color-link: #4db7ea; --color-link-hover: #88cfea; --color-heading-main: #a9bac7; --color-heading-stacktrace: #c7c7c7; --color-table-heading: #a9bac7; --color-tab-link: #4db7ea; --color-tab-selected: #222; --color-tab-selected-background: #4db7ea; --color-code-background: #1c1c1c; --color-code-highlight: #ff8787; --color-code-context-linenum: #9B9B9B; --color-code-context: #9B9B9B; --color-code-context-button-background: #444; } } body { font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif; font-size: .813em; color: var(--color-text); background-color: var(--color-background); } h1 { color: var(--color-heading-main); margin: 15px 0 15px 0; } h2 { margin: 10px 5px 0 0; padding: 5px; border-bottom: 1px solid var(--color-border); } h3 { color: var(--color-heading-stacktrace); margin: 5px 5px 0 0; font-weight: normal; } code { font-family: Consolas, "Courier New", courier, monospace; font-weight: bold; } a { color: var(--color-link); text-decoration: none; } a:hover { color: var(--color-link-hover); text-decoration: underline; } /* Exception title & message */ body .titleerror { padding: 3px 3px 6px 3px; display: block; font-size: 1.5em; font-weight: 100; } /* Exception location */ body .location { margin: 3px 0 10px 30px; } /* Tab navigation */ #header { font-size: 18px; padding: 15px 0; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); margin-bottom: 0; } #header li { display: inline; margin: 5px; padding: 5px; color: var(--color-tab-link); cursor: pointer; } #header .selected { color: var(--color-tab-selected); background: var(--color-tab-selected-background); } /* Stack page */ #stackpage .details { font-size: 1.2em; padding: 3px; } #stackpage ul { list-style: none; padding-left: 0; margin: 0; } #stackpage .frame { padding: 0; margin: 0 0 0 30px; } #stackpage .frame h3 { padding: 2px; margin: 0; } /* Stack frame source */ #stackpage .source { padding: 0 0 0 30px; } #stackpage .source ol li { font-family: Consolas, "Courier New", courier, monospace; white-space: pre; background-color: var(--color-code-background); } /* Stack frame source: highlighted line */ #stackpage .source .highlight { border-left: 3px solid var(--color-code-highlight); margin-left: -3px; font-weight: bold; } #stackpage .source .highlight li span { color: var(--color-code-highlight); } /* Stack frame source: context lines */ #stackpage .source .collapsible { color: var(--color-code-context-linenum); } #stackpage .source .collapsible li span { color: var(--color-code-context); } .expandCollapseButton { position: absolute; left: 10px; width: 16px; height: 16px; font-size: 10px; color: inherit; background: var(--color-code-context-button-background); padding: 0; border: 0; cursor: pointer; } /* Table */ .page table { border-collapse: collapse; margin: 0 0 20px; } .page th { padding: 10px 10px 5px 10px; color: var(--color-table-heading); text-align: left; } .page td { padding: 3px 10px; } .page tr { border-bottom: 1px solid var(--color-border); } .page tr > :not(:last-child) { border-right: 1px solid var(--color-border); } /* Raw exception details */ .rawExceptionBlock { font-size: 1.2em; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); } .showRawException { display: inline-block; color: var(--color-link); background: transparent; font: inherit; border: 0; padding: 10px 0; cursor: pointer; } .showRawException:hover { color: var(--color-link-hover); text-decoration: underline; } </style> </head> <body> <h1>An unhandled exception occurred while processing the request.</h1> <div class="titleerror">InvalidOperationException: Sequence contains no elements</div> <p class="location">System.Linq.ThrowHelper.ThrowNoElementsException()</p> <ul id="header"> <li id="stack" tabindex="1" class="selected"> Stack </li> <li id="query" tabindex="2"> Query </li> <li id="cookies" tabindex="3"> Cookies </li> <li id="headers" tabindex="4"> Headers </li> <li id="routing" tabindex="5"> Routing </li> </ul> <div id="stackpage" class="page"> <ul> <li> <h2>InvalidOperationException: Sequence contains no elements</h2> <ul> <li class="frame" id="frame1"> <h3>System.Linq.ThrowHelper.ThrowNoElementsException()</h3> </li> <li class="frame" id="frame2"> <h3>System.Linq.Enumerable.First<TSource>(IEnumerable<TSource> source)</h3> </li> <li class="frame" id="frame3"> <h3>Dapper.SqlMapper.ThrowZeroRows(Row row) in <code title="/_/Dapper/SqlMapper.cs">SqlMapper.cs</code></h3> </li> <li class="frame" id="frame4"> <h3>Dapper.SqlMapper.QueryRowAsync<T>(IDbConnection cnn, Row row, Type effectiveType, CommandDefinition command) in <code title="/_/Dapper/SqlMapper.Async.cs">SqlMapper.Async.cs</code></h3> </li> <li class="frame" id="frame5"> <h3>Pixelio.Search.MediaService+<>c__DisplayClass8_0+<<GetById>b__0>d.MoveNext() in <code title="/home/helix/PixelioDotNet/src/Pixelio.Search/MediaService.cs">MediaService.cs</code></h3> <button class="expandCollapseButton" data-frameId="frame5">+</button> <div class="source"> <ol start="208" class="collapsible"> <li><span></span></li> <li><span> builder.Where("id = @Id", new { Id = id });</span></li> <li><span></span></li> <li><span> if (status.HasValue)</span></li> <li><span> builder.Where("status = @Status", new { Status = (int)status.Value });</span></li> <li><span></span></li> </ol> <ol start="214" class="highlight"> <li><span> return await con.QueryFirstAsync<Media>(selectTemplate.RawSql, selectTemplate.Parameters);</span></li> </ol> <ol start='215' class="collapsible"> <li><span> });</span></li> <li><span> }</span></li> <li><span></span></li> <li><span> public async Task<(IEnumerable<Media> Media, Meta Meta)> GetPopularMedia(int limit)</span></li> <li><span> => await Search(new Request { Limit = limit, Order = new Order(nameof(Request.Score), Sort.Descending), Status = Status.Activated });</span></li> <li><span></span></li> </ol> </div> </li> <li class="frame" id="frame6"> <h3>Pixelio.Database.MySql.UseAndReturnAsync<T>(Func<MySqlConnection, Task<T>> action) in <code title="/home/helix/PixelioDotNet/src/Pixelio.Database/MySql.cs">MySql.cs</code></h3> <button class="expandCollapseButton" data-frameId="frame6">+</button> <div class="source"> <ol start="27" class="collapsible"> <li><span></span></li> <li><span> public async Task<T> UseAndReturnAsync<T>(Func<MySqlConnection, Task<T>> action)</span></li> <li><span> {</span></li> <li><span> using (var con = new MySqlConnection(_connectionString))</span></li> <li><span> {</span></li> <li><span> await con.OpenAsync();</span></li> </ol> <ol start="33" class="highlight"> <li><span> var result = await action(con);</span></li> </ol> <ol start='34' class="collapsible"> <li><span> await con.CloseAsync();</span></li> <li><span></span></li> <li><span> return result;</span></li> <li><span> }</span></li> <li><span> }</span></li> <li><span>}</span></li> </ol> </div> </li> <li class="frame" id="frame7"> <h3>Pixelio.Search.MediaService.GetById(int id, Nullable<Status> status) in <code title="/home/helix/PixelioDotNet/src/Pixelio.Search/MediaService.cs">MediaService.cs</code></h3> <button class="expandCollapseButton" data-frameId="frame7">+</button> <div class="source"> <ol start="189" class="collapsible"> <li><span> return (media, meta);</span></li> <li><span> });</span></li> <li><span> }</span></li> <li><span></span></li> <li><span> public async Task<Media> GetById(int id, Status? status = null)</span></li> <li><span> {</span></li> </ol> <ol start="195" class="highlight"> <li><span> return await _cn.UseAndReturnAsync(async con =></span></li> </ol> <ol start='196' class="collapsible"> <li><span> {</span></li> <li><span> var builder = new SqlBuilder();</span></li> <li><span></span></li> <li><span> var selectTemplate = builder.AddTemplate(</span></li> <li><span> $"""</span></li> <li><span> SELECT</span></li> </ol> </div> </li> <li class="frame" id="frame8"> <h3>Pixelio.Web.App.Pages.MediaModel.OnGetAsync(int id)</h3> </li> <li class="frame" id="frame9"> <h3>Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory+NonGenericTaskHandlerMethod.Execute(object receiver, object[] arguments)</h3> </li> <li class="frame" id="frame10"> <h3>Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync()</h3> </li> <li class="frame" id="frame11"> <h3>Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync()</h3> </li> <li class="frame" id="frame12"> <h3>Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context)</h3> </li> <li class="frame" id="frame13"> <h3>Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)</h3> </li> <li class="frame" id="frame14"> <h3>Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync()</h3> </li> <li class="frame" id="frame15"> <h3>Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)</h3> </li> <li class="frame" id="frame16"> <h3>Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)</h3> </li> <li class="frame" id="frame17"> <h3>Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)</h3> </li> <li class="frame" id="frame18"> <h3>Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)</h3> </li> <li class="frame" id="frame19"> <h3>Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)</h3> </li> <li class="frame" id="frame20"> <h3>Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)</h3> </li> <li class="frame" id="frame21"> <h3>Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)</h3> </li> <li class="frame" id="frame22"> <h3>Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)</h3> </li> <li class="frame" id="frame23"> <h3>Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)</h3> </li> <li class="frame" id="frame24"> <h3>Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)</h3> </li> <li class="frame" id="frame25"> <h3>Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)</h3> </li> <li class="frame" id="frame26"> <h3>Program+<>c__DisplayClass0_1+<<<Main>$>b__10>d.MoveNext()</h3> </li> <li class="frame" id="frame27"> <h3>Program+<>c+<<<Main>$>b__0_9>d.MoveNext()</h3> </li> <li class="frame" id="frame28"> <h3>Microsoft.AspNetCore.RateLimiting.RateLimitingMiddleware.InvokeInternal(HttpContext context, EnableRateLimitingAttribute enableRateLimitingAttribute)</h3> </li> <li class="frame" id="frame29"> <h3>Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)</h3> </li> </ul> </li> <li> <br /> <div class="rawExceptionBlock"> <button class="showRawException" data-exceptionDetailId="exceptionDetail1">Show raw exception details</button> <div id="exceptionDetail1" class="rawExceptionDetails"> <pre class="rawExceptionStackTrace">System.InvalidOperationException: Sequence contains no elements
 at System.Linq.ThrowHelper.ThrowNoElementsException()
 at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
 at Dapper.SqlMapper.ThrowZeroRows(Row row) in /_/Dapper/SqlMapper.cs:line 1256
 at Dapper.SqlMapper.QueryRowAsync[T](IDbConnection cnn, Row row, Type effectiveType, CommandDefinition command) in /_/Dapper/SqlMapper.Async.cs:line 503
 at Pixelio.Search.MediaService.<>c__DisplayClass8_0.<<GetById>b__0>d.MoveNext() in /home/helix/PixelioDotNet/src/Pixelio.Search/MediaService.cs:line 214
--- End of stack trace from previous location ---
 at Pixelio.Database.MySql.UseAndReturnAsync[T](Func`2 action) in /home/helix/PixelioDotNet/src/Pixelio.Database/MySql.cs:line 33
 at Pixelio.Search.MediaService.GetById(Int32 id, Nullable`1 status) in /home/helix/PixelioDotNet/src/Pixelio.Search/MediaService.cs:line 195
 at Pixelio.Web.App.Pages.MediaModel.OnGetAsync(Int32 id)
 at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.NonGenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments)
 at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync()
 at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync()
 at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context)
 at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
 at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync()
 at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
 at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
 at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
 at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
 at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
 at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
 at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
 at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
 at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
 at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
 at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
 at Program.<>c__DisplayClass0_1.<<<Main>$>b__10>d.MoveNext()
--- End of stack trace from previous location ---
 at Program.<>c.<<<Main>$>b__0_9>d.MoveNext()
--- End of stack trace from previous location ---
 at Microsoft.AspNetCore.RateLimiting.RateLimitingMiddleware.InvokeInternal(HttpContext context, EnableRateLimitingAttribute enableRateLimitingAttribute)
 at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)</pre> </div> </div> </li> </ul> </div> <div id="querypage" class="page"> <p>No query string data.</p> </div> <div id="cookiespage" class="page"> <table> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>$Path</td> <td>/</td> </tr> <tr> <td>$Version</td> <td>1</td> </tr> <tr> <td>samesite</td> <td>strict</td> </tr> <tr> <td>XSRF-TOKEN</td> <td>CfDJ8JeNmzHGfAVKqj-GqZ_Ka-Z5LEYaPTP4FOcraTX3ITrwWtdkRKYXhyF1qamfoCsKzQ2ClosJzozrWgdlWx1_1l5EEnw6U7eJeZnk5kit6ksgKrWOUVbYRPkCV8JeHHsi8L0M10Vve6TI6FAkFnFnDs8</td> </tr> </tbody> </table> </div> <div id="headerspage" class="page"> <table> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>Accept</td> <td>text/html,image/png,image/jpeg,image/pjpeg,image/x-xbitmap,image/svg+xml,image/gif;q=0.9,*/*;q=0.1</td> </tr> <tr> <td>Accept-Encoding</td> <td>gzip, identity;q=0.9</td> </tr> <tr> <td>Accept-Language</td> <td>en, *</td> </tr> <tr> <td>Connection</td> <td>keep-alive</td> </tr> <tr> <td>Cookie</td> <td>$Version=1; XSRF-TOKEN=CfDJ8JeNmzHGfAVKqj-GqZ_Ka-Z5LEYaPTP4FOcraTX3ITrwWtdkRKYXhyF1qamfoCsKzQ2ClosJzozrWgdlWx1_1l5EEnw6U7eJeZnk5kit6ksgKrWOUVbYRPkCV8JeHHsi8L0M10Vve6TI6FAkFnFnDs8; $Path=/; samesite=strict; $Path=/</td> </tr> <tr> <td>Host</td> <td>10.3.0.100:5083</td> </tr> <tr> <td>Referer</td> <td>http://10.3.0.100:5083/search?catId=11</td> </tr> <tr> <td>User-Agent</td> <td>Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98)</td> </tr> </tbody> </table> </div> <div id="routingpage" class="page"> <h2>Endpoint</h2> <table> <thead> <tr> <th>Name</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>Display Name</td> <td>/Media</td> </tr> <tr> <td>Route Pattern</td> <td>media/{id}</td> </tr> <tr> <td>Route Order</td> <td>0</td> </tr> </tbody> </table> <h2>Route Values</h2> <table> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>0</td> </tr> <tr> <td>page</td> <td>/Media</td> </tr> </tbody> </table> </div> <script> //<!-- (function (window, undefined) { "use strict"; function ns(selector, element) { return new NodeCollection(selector, element); } function NodeCollection(selector, element) { this.items = []; element = element || window.document; var nodeList; if (typeof (selector) === "string") { nodeList = element.querySelectorAll(selector); for (var i = 0, l = nodeList.length; i < l; i++) { this.items.push(nodeList.item(i)); } } } NodeCollection.prototype = { each: function (callback) { for (var i = 0, l = this.items.length; i < l; i++) { callback(this.items[i], i); } return this; }, children: function (selector) { var children = []; this.each(function (el) { children = children.concat(ns(selector, el).items); }); return ns(children); }, hide: function () { this.each(function (el) { el.style.display = "none"; }); return this; }, toggle: function () { this.each(function (el) { el.style.display = el.style.display === "none" ? "" : "none"; }); return this; }, show: function () { this.each(function (el) { el.style.display = ""; }); return this; }, addClass: function (className) { this.each(function (el) { var existingClassName = el.className, classNames; if (!existingClassName) { el.className = className; } else { classNames = existingClassName.split(" "); if (classNames.indexOf(className) < 0) { el.className = existingClassName + " " + className; } } }); return this; }, removeClass: function (className) { this.each(function (el) { var existingClassName = el.className, classNames, index; if (existingClassName === className) { el.className = ""; } else if (existingClassName) { classNames = existingClassName.split(" "); index = classNames.indexOf(className); if (index > 0) { classNames.splice(index, 1); el.className = classNames.join(" "); } } }); return this; }, attr: function (name) { if (this.items.length === 0) { return null; } return this.items[0].getAttribute(name); }, on: function (eventName, handler) { this.each(function (el, idx) { var callback = function (e) { e = e || window.event; if (!e.which && e.keyCode) { e.which = e.keyCode; // Normalize IE8 key events } handler.apply(el, [e]); }; if (el.addEventListener) { // DOM Events el.addEventListener(eventName, callback, false); } else if (el.attachEvent) { // IE8 events el.attachEvent("on" + eventName, callback); } else { el["on" + type] = callback; } }); return this; }, click: function (handler) { return this.on("click", handler); }, keypress: function (handler) { return this.on("keypress", handler); } }; function frame(el) { ns(".source .collapsible", el).toggle(); } function expandCollapseButton(el) { var frameId = el.getAttribute("data-frameId"); frame(document.getElementById(frameId)); if (el.innerText === "+") { el.innerText = "-"; } else { el.innerText = "+"; } } function tab(el) { var unselected = ns("#header .selected").removeClass("selected").attr("id"); var selected = ns("#" + el.id).addClass("selected").attr("id"); ns("#" + unselected + "page").hide(); ns("#" + selected + "page").show(); } ns(".rawExceptionDetails").hide(); ns(".collapsible").hide(); ns(".page").hide(); ns("#stackpage").show(); ns(".expandCollapseButton") .click(function () { expandCollapseButton(this); }) .keypress(function (e) { if (e.which === 13) { expandCollapseButton(this); } }); ns("#header li") .click(function () { tab(this); }) .keypress(function (e) { if (e.which === 13) { tab(this); } }); ns(".showRawException") .click(function () { var exceptionDetailId = this.getAttribute("data-exceptionDetailId"); ns("#" + exceptionDetailId).toggle(); }); })(window); //--> </script> <script src="/_framework/aspnetcore-browser-refresh.js"></script></body> </html>