title: .NET Core App with Postgres runs fine locally, doesn't work as intended on staging/production
body: <p>Not really sure if this issue specifically targets dockerized .NET Core applications running with a Postgres-based EF database or not but here goes.</p>
  
  <p>I'm actually running a .NET Core 2.2.6 Application that only:</p>
  
  <ol>
  <li>Injects a DbContext on Npgsql</li>
  <li>Injects the Layer/s for communicating between the DbContext and a HostedService</li>
  <li>Injects the HostedService that will run 24/7</li>
  </ol>
  
  <p>I ran this project locally without fail for 5 days, tried to change pods on my kubernetes cluster as well and it didn't work. This is what I always get on my logs on the kube cluster:</p>
  
  <pre><code>warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
        No XML encryptor configured. Key {918d59eb-e0f5-4a5a-83c9-e5dc196805f5} may be persisted to storage in unencrypted form.
  warn: Microsoft.EntityFrameworkCore.Model.Validation[20600]
        Property 'Guid' on entity type 'ApiToken' is part of a primary or alternate key but has a constant default value set. Constant default values are not useful for primary or alternate keys since these properties must always have non-null unqiue values.
  warn: Microsoft.AspNetCore.Mvc.RazorPages.Internal.CompiledPageRouteModelProvider[1]
        The page at '/Areas/Users/Views/Manage/ExternalLogins.cshtml' is located under the area root directory '/Areas/' but does not follow the path format '/Areas/AreaName/Pages/Directory/FileName.cshtml
  warn: Microsoft.EntityFrameworkCore.Query[10106]
        The Include operation for navigation '[ct].Currencies.AnalysedComponents.AnalysedHistoricItems' is unnecessary and was ignored because the navigation is not reachable in the final query results. See https://go.microsoft.com/fwlink/?linkid=850303 for more information.
  warn: Microsoft.EntityFrameworkCore.Query[10106]
        The Include operation for navigation '[ct].Currencies.Requests.RequestComponents' is unnecessary and was ignored because the navigation is not reachable in the final query results. See https://go.microsoft.com/fwlink/?linkid=850303 for more information.
  warn: Microsoft.EntityFrameworkCore.Query[20500]
        The LINQ expression 'where [ct].TypeShortForm.Equals(__typeShortForm_0, InvariantCultureIgnoreCase)' could not be translated and will be evaluated locally.
  warn: Microsoft.EntityFrameworkCore.Query[20500]
        The LINQ expression 'from Currency &lt;generated&gt;_0 in {from Currency c in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[Nozomi.Data.Models.Currency.Currency]) where (([c].DeletedAt == null) AndAlso [c].IsEnabled) where {from AnalysedComponent ac in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[Nozomi.Data.Models.Web.Analytical.AnalysedComponent]) where (([ac].DeletedAt == null) AndAlso [ac].IsEnabled) where  ?= (Convert(Property([c], "Id"), Nullable`1) == Property([ac], "CurrencyId")) =? select [ac] =&gt; Any()} orderby [c].Id asc where  ?= (Property([ct], "Id") == Property([c], "CurrencyTypeId")) =? select new Currency() {Id = [c].Id, CurrencyTypeId = [c].CurrencyTypeId, Abbreviation = [c].Abbreviation, Slug = [c].Slug, Name = [c].Name, Description = [c].Description, Denominations = [c].Denominations, DenominationName = [c].DenominationName, LogoPath = [c].LogoPath, AnalysedComponents = {from AnalysedComponent ac in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[Nozomi.Data.Models.Web.Analytical.AnalysedComponent]) where (([ac].DeletedAt == null) AndAlso [ac].IsEnabled) where  ?= (Convert(Property([c], "Id"), Nullable`1) == Property([ac], "CurrencyId")) =? select new AnalysedComponent([ac], __index_1, 100, ahi =&gt; ((((ahi.DeletedAt == null) AndAlso ahi.IsEnabled) AndAlso (ahi.HistoricDateTime &gt;= DateTime.UtcNow.Subtract(__FromDays_2))) AndAlso IsNumericDecimal(ahi.Value)))}.ToList(), Requests = {from Request r in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[Nozomi.Data.Models.Web.Request]) where (([r].DeletedAt == null) AndAlso [r].IsEnabled) where  ?= (Convert(Property([c], "Id"), Nullable`1) == Property([r], "CurrencyId")) =? select new Request() {Guid = [r].Guid, RequestComponents = {from RequestComponent rc in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[Nozomi.Data.Models.Web.RequestComponent]) where (([rc].DeletedAt == null) AndAlso [rc].IsEnabled) where  ?= (Property([r], "Id") == Property([rc], "RequestId")) =? select [rc]}.ToList()}}.ToList()} =&gt; Skip((__index_1 * 100)) =&gt; Take(100)}' could not be translated and will be evaluated locally.
  warn: Microsoft.EntityFrameworkCore.Query[10106]
        The Include operation for navigation '[cp].Source' is unnecessary and was ignored because the navigation is not reachable in the final query results. See https://go.microsoft.com/fwlink/?linkid=850303 for more information.
  warn: Microsoft.EntityFrameworkCore.Query[20500]
        The LINQ expression 'where [cp].MainCurrencyAbbrv.Equals(__currencyAbbrv_0, InvariantCultureIgnoreCase)' could not be translated and will be evaluated locally.
  warn: Microsoft.EntityFrameworkCore.Query[20500]
        The LINQ expression 'where (([cp.Source].DeletedAt == null) AndAlso [cp.Source].IsEnabled)' could not be translated and will be evaluated locally.
  warn: Microsoft.EntityFrameworkCore.Query[10106]
        The Include operation for navigation '[ct].AnalysedComponents.AnalysedHistoricItems' is unnecessary and was ignored because the navigation is not reachable in the final query results. See https://go.microsoft.com/fwlink/?linkid=850303 for more information.
  </code></pre>
  
  <p>Nothing insightful to be honest. </p>
  
  <p><strong>So the key question is, how do I find out which part of the project does it hang at?</strong></p>
  
  <p>It seems like its hanging because the logs always seem to end there.</p>