question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Manages crashes when opening aliases (postgres)

See original GitHub issue

Manager crashes when clicking on Aliases menu.

2018-11-23T09:01:30.867588+00:00 app[web.1]:       SELECT m."Id", m."ContentLastModified", m."Created", m."Culture", m."Description", m."Hostnames", m."InternalId", m."IsDefault", m."LastModified", m."SiteTypeId", m."Title"
2018-11-23T09:01:30.867590+00:00 app[web.1]:       FROM "Piranha_Sites" AS m
2018-11-23T09:01:30.867591+00:00 app[web.1]:       WHERE m."Id" = @__id_0
2018-11-23T09:01:30.867593+00:00 app[web.1]:       LIMIT 1
2018-11-23T09:01:30.887069+00:00 app[web.1]: info: Microsoft.EntityFrameworkCore.Database.Command[20101]
2018-11-23T09:01:30.887072+00:00 app[web.1]:       Executed DbCommand (3ms) [Parameters=[@__siteId_0='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
2018-11-23T09:01:30.887074+00:00 app[web.1]:       SELECT a."Id"
2018-11-23T09:01:30.887105+00:00 app[web.1]:       FROM "Piranha_Aliases" AS a
2018-11-23T09:01:30.887106+00:00 app[web.1]:       WHERE a."SiteId" = @__siteId_0
2018-11-23T09:01:30.887108+00:00 app[web.1]:       ORDER BY a."AliasUrl", a."RedirectUrl"
2018-11-23T09:01:30.889900+00:00 app[web.1]: info: Microsoft.EntityFrameworkCore.Database.Command[20101]
2018-11-23T09:01:30.889903+00:00 app[web.1]:       Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
2018-11-23T09:01:30.889904+00:00 app[web.1]:       SELECT m."Id"
2018-11-23T09:01:30.889905+00:00 app[web.1]:       FROM "Piranha_Sites" AS m
2018-11-23T09:01:30.892803+00:00 app[web.1]: info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
2018-11-23T09:01:30.892806+00:00 app[web.1]:       Executed action Piranha.Areas.Manager.Controllers.AliasController.List (Piranha.Manager) in 31.8502ms
2018-11-23T09:01:30.908169+00:00 app[web.1]: fail: Microsoft.AspNetCore.Server.Kestrel[13]
2018-11-23T09:01:30.908172+00:00 app[web.1]:       Connection id "0HLIH463O3G8V", Request id "0HLIH463O3G8V:00000001": An unhandled exception was thrown by the application.
2018-11-23T09:01:30.908267+00:00 app[web.1]: System.NullReferenceException: Object reference not set to an instance of an object.
2018-11-23T09:01:30.908269+00:00 app[web.1]:    at Piranha.Areas.Manager.Models.AliasListModel.Get(IApi api, Nullable`1 siteId)
2018-11-23T09:01:30.908271+00:00 app[web.1]:    at Piranha.Areas.Manager.Controllers.AliasController.List(Nullable`1 siteId)
2018-11-23T09:01:30.908276+00:00 app[web.1]:    at lambda_method(Closure , Object , Object[] )
2018-11-23T09:01:30.908298+00:00 app[web.1]:    at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
2018-11-23T09:01:30.908318+00:00 app[web.1]:    at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
2018-11-23T09:01:30.908320+00:00 app[web.1]:    at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
2018-11-23T09:01:30.908322+00:00 app[web.1]:    at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
2018-11-23T09:01:30.908357+00:00 app[web.1]:    at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
2018-11-23T09:01:30.908360+00:00 app[web.1]:    at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
2018-11-23T09:01:30.908393+00:00 app[web.1]:    at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
2018-11-23T09:01:30.908395+00:00 app[web.1]:    at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
2018-11-23T09:01:30.908396+00:00 app[web.1]:    at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
2018-11-23T09:01:30.908416+00:00 app[web.1]:    at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
2018-11-23T09:01:30.908418+00:00 app[web.1]:    at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
2018-11-23T09:01:30.908419+00:00 app[web.1]:    at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
2018-11-23T09:01:30.908438+00:00 app[web.1]:    at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
2018-11-23T09:01:30.908440+00:00 app[web.1]:    at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
2018-11-23T09:01:30.908441+00:00 app[web.1]:    at Piranha.Manager.ResourceMiddleware.Invoke(HttpContext context)
2018-11-23T09:01:30.908459+00:00 app[web.1]:    at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
2018-11-23T09:01:30.908461+00:00 app[web.1]:    at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
2018-11-23T09:01:30.908463+00:00 app[web.1]:    at Piranha.AspNetCore.SitemapMiddleware.Invoke(HttpContext context, IApi api, IApplicationService service)
2018-11-23T09:01:30.908481+00:00 app[web.1]:    at Piranha.AspNetCore.StartPageMiddleware.Invoke(HttpContext context, IApi api, IApplicationService service)
2018-11-23T09:01:30.908483+00:00 app[web.1]:    at Piranha.AspNetCore.ArchiveMiddleware.Invoke(HttpContext context, IApi api, IApplicationService service)
2018-11-23T09:01:30.908501+00:00 app[web.1]:    at Piranha.AspNetCore.PostMiddleware.Invoke(HttpContext context, IApi api, IApplicationService service)
2018-11-23T09:01:30.908503+00:00 app[web.1]:    at Piranha.AspNetCore.PageMiddleware.Invoke(HttpContext context, IApi api, IApplicationService service)
2018-11-23T09:01:30.908504+00:00 app[web.1]:    at Piranha.AspNetCore.AliasMiddleware.Invoke(HttpContext context, IApi api, IApplicationService service)
2018-11-23T09:01:30.908537+00:00 app[web.1]:    at Piranha.AspNetCore.ApplicationMiddleware.Invoke(HttpContext context, IApi api, IApplicationService service)
2018-11-23T09:01:30.908539+00:00 app[web.1]:    at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
2018-11-23T09:01:30.908571+00:00 app[web.1]:    at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
2018-11-23T09:01:30.908573+00:00 app[web.1]:    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
2018-11-23T09:01:30.909139+00:00 app[web.1]: info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
2018-11-23T09:01:30.909141+00:00 app[web.1]:       Request finished in 75.7825ms 500 

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
alperencaliskancommented, Nov 23, 2018

Hi, i have looked into it. Upgraded existing site to 5.3.0 on a development environment which uses postgresql 10. There was no problem. Then i tried it from a new empty db and the specified problem is occured.

The problem was because of PiranhaManager_SelectedSite cookie. My old site id was stored on it and when calling aliases page, old site id was used which was not available in the Piranha_Sites table. Removing cookies fixed it. https://github.com/PiranhaCMS/piranha.core/blob/ebd2821039f165ed7dd961d53771132b63691e2a/core/Piranha.Manager/Areas/Manager/Controllers/AliasController.cs#L40

This issue is not related to the db provider. I think it could only occur on dev environments because /localhost domain cookies is shared between web instances.

0reactions
steelspacecommented, Nov 24, 2018

I have also noticed that sometimes when I change default site, the other is actually treated as default and vice-versa. This supports the hypothesis that “default site” flag is incorrectly cached in session or memory.

Read more comments on GitHub >

github_iconTop Results From Across the Web

BUG #16874: Postgres Server crashes at commit
Since we migrated to Postgres 13, we experience a crash of the database server. This is the log from the server:
Read more >
How to Analyze a PostgreSQL Crash Dump File
Introduction. In this blog post, I will talk about how to enable the generation of crash dump file (also known as core dump)...
Read more >
26.3. Continuous Archiving and Point-in-Time Recovery ...
This log exists primarily for crash-safety purposes: if the system crashes, the database can be restored to consistency by “replaying” the log entries...
Read more >
Documentation: 15: 9.27. System Administration Functions
To solve this problem, PostgreSQL allows a transaction to export the snapshot it is using. As long as the exporting transaction remains open,...
Read more >
Documentation: 15: pg_ctl
pg_ctl is a utility for initializing a PostgreSQL database cluster, starting, stopping, or restarting the PostgreSQL database server (postgres), ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found